azu_cli v0.1.2
Azu CLI - Command Line Interface
Feature-Complete, Production-Ready CLI for the Azu Toolkit
AZU is a toolkit for artisans with expressive, elegant syntax that offers great performance to build rich, interactive type safe, applications quickly, with less code and cohesive parts that adapts to your preferred style.
Features
- ๐ Rails-Like Workflows - Complete database management, generators, and development tools
- ๐ฅ Hot Reloading - Development server with automatic recompilation on file changes
- ๐ฆ 25+ Commands - Comprehensive CLI for all development tasks
- ๐จ 12+ Generators - Scaffold models, endpoints, services, jobs, and more
- ๐๏ธ CQL ORM Integration - Full support for CQL database operations
- โก JoobQ Integration - Background job management and monitoring
- ๐ Session Management - Redis, Memory, and Database backends
- ๐งช Testing Infrastructure - Test runner with watch mode
- ๐ง Mailer Support - Email generation with async jobs
- ๐ฌ WebSocket Channels - Real-time communication scaffolding
- ๐ Authentication - Complete auth system generation (JWT/Session)
Target Frameworks
The Azu CLI is specifically designed to work with two main frameworks from the Azu Toolkit ecosystem:
CQL ORM Framework
CQL (Crystal Query Language) is a comprehensive Object-Relational Mapping (ORM) library designed to simplify and enhance the management and execution of SQL queries in Crystal.
Key Features:
- Type-safe ORM using Crystal's static type system
- Macro-powered DSL for defining models and relationships
- Active Record-style API with flexibility for Repository and Data Mapper patterns
- Support for major relational databases through Crystal DB drivers (PostgreSQL, MySQL, SQLite)
- Built for performance, leveraging compile-time optimizations
- Comprehensive query builder with type safety
- Migration system for database schema management
Repository: https://github.com/azutoolkit/cql
Azu Web Framework
Azu is a high-performance, type-safe web framework for Crystal that emphasizes developer productivity, compile-time safety, and real-time capabilities.
Key Features:
- Type-Safe Architecture: Compile-time type checking for requests, responses, and parameters
- Real-Time Capabilities: WebSocket channels with automatic connection management
- Performance-Optimized: High-performance routing with LRU cache and path optimization
- Developer Experience: Comprehensive error handling and flexible middleware system
- Modern Web Patterns: Live components, Spark system for reactive UI updates
- Content Negotiation: Supporting JSON, HTML, XML, and plain text
- Template Engine: Hot reloading in development with production caching
Repository: https://github.com/azutoolkit/azu
Jennifer ORM Support (Legacy)
Jennifer is an ORM (Object Relation Mapping) built for Crystal language that is supported for legacy projects.
Documentation
- Azu Toolkit - https://azutopia.gitbook.io/azu/
- CQL ORM Framework - https://github.com/azutoolkit/cql
- Azu Web Framework - https://github.com/azutoolkit/azu
- Jennifer ORM (Legacy) - https://imdrasil.github.io/jennifer.cr/docs/
Installation
From Source
# Clone repository
git clone https://github.com/azutoolkit/azu_cli
cd azu_cli
# Install dependencies
shards install
# Build CLI
shards build
# Install globally (may require sudo)
sudo make install
Using Makefile
make install
The azu command will be available system-wide.
Quick Start
# Create a new project (interactive mode asks about JoobQ and other options)
azu new my-app
# Or create with specific options
azu new my-app --type web --database postgresql --joobq
# Navigate to project
cd my-app
# Setup database
azu db:create
azu db:migrate
# Generate a model
azu generate model User name:string email:string
# Generate a complete CRUD scaffold
azu generate scaffold Post title:string content:text
# Start development server with hot reloading
azu serve
# Run tests in watch mode (in another terminal)
azu test --watch
Available Commands
Project Management
azu new <name>- Create a new Azu projectazu init- Initialize Azu in existing projectazu generate <type> <name>- Generate code from templates
Database Commands (Rails-Like)
azu db:create- Create the databaseazu db:drop- Drop the databaseazu db:migrate- Run pending migrationsazu db:rollback- Rollback migrationsazu db:seed- Seed the database with dataazu db:reset- Reset database (drop, create, migrate)azu db:status- Show migration statusazu db:setup- Setup database (create and migrate)
Development Commands
azu serve- Start development server with hot reloadazu test [--watch]- Run application tests
Job Queue Commands (JoobQ)
azu jobs:worker- Start background job workersazu jobs:status- Show queue status and statisticsazu jobs:clear- Clear job queuesazu jobs:retry- Retry failed jobsazu jobs:ui- Start JoobQUI web interface
Session Commands
azu session:setup- Setup session management (Redis/Memory/Database)azu session:clear- Clear all sessions
Code Generators
model- CQL database modelsservice- Business logic servicesjoobq- JoobQ background job infrastructure setupjob- Background jobs (JoobQ)mailer- Email functionalitychannel- WebSocket channelsauth- Authentication system (JWT/Session)scaffold- Complete CRUD with all componentsendpoint- HTTP request handlerscontract- Request validationpage- Response pagesmigration- Database migrationsmiddleware- HTTP middlewarecomponent- Reusable componentsvalidator- Custom validators
Examples
Create a Blog
# Create project
azu new blog
cd blog
# Setup database
azu db:create
# Generate models
azu generate model User name:string email:string
azu generate model Post title:string content:text author_id:int64
# Generate CRUD
azu generate scaffold Post title:string content:text published:bool
# Setup authentication
azu generate auth --strategy jwt
# Migrate and seed
azu db:migrate
azu db:seed
# Start development
azu serve
Create an API
# Create API project
azu new api-service --type api
cd api-service
# Generate API scaffold
azu generate scaffold Product name:string price:float64 --api-only
# Setup background jobs
azu generate job ProcessOrder order_id:int64
azu session:setup --backend redis
# Start services
azu db:create && azu db:migrate
azu serve &
azu jobs:worker --workers 4 &
Migration System
Azu CLI uses CQL's powerful migration system with automatic schema synchronization:
# Generate a migration
azu generate migration CreateUsers name:string email:string age:int32
# Migrations use CQL Schema DSL
class CreateUsers < CQL::Migration(20240115103045_i64)
def up
schema.table :users do
primary :id, Int64
column :name, String
column :email, String, unique: true
timestamps
end
schema.users.create!
end
def down
schema.users.drop!
end
end
# Run migrations (automatically updates src/db/schema.cr)
azu db:migrate
# Rollback migrations
azu db:rollback --steps 2
Key Features:
- โ
Uses CQL's built-in
Migratorclass - โ Automatic schema file synchronization
- โ Type-safe Crystal migrations
- โ Pretty-printed migration status
- โ Supports PostgreSQL, MySQL, and SQLite
See MIGRATION_FIXES_SUMMARY.md for detailed migration guide.
Documentation
For complete documentation, see:
- CLI Reference: CLI_REFERENCE.md
- Migration Guide: MIGRATION_FIXES_SUMMARY.md
- Test Report: TEST_VALIDATION_REPORT.md
- Implementation: IMPLEMENTATION_SUMMARY.md
- Azu Framework: https://azutopia.gitbook.io/azu/
- CQL ORM: https://github.com/azutoolkit/cql
- JoobQ: https://github.com/azutoolkit/joobq
- Session: https://github.com/azutoolkit/session
Contributing
- Fork it (https://github.com/azutoolkit/azu_cli/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Elias J. Perez - creator and maintainer
azu_cli
- 5
- 0
- 0
- 0
- 8
- 3 days ago
- May 4, 2021
MIT License
Tue, 28 Oct 2025 11:46:02 GMT