Complete guide to Akron CLI commands for database management, migrations, and development workflow.
The Akron CLI provides powerful command-line tools for database management, schema migrations, data seeding, and development workflows. Akron now supports both modern schema management commands and legacy database operation commands.
Akron features powerful declarative schema management:
akron db init --provider sqlite
The CLI is automatically installed with the Akron package:
pip install akron
These commands provide a modern workflow for managing your database schema declaratively.
Initialize a new Akron project with schema configuration file.
akron db init --provider sqlite
Generate migration files from schema changes automatically.
akron db makemigrations --name "initial"
These commands provide direct database operations and are maintained for backward compatibility.
All CLI commands use the --db
parameter to specify database connections:
Schema definitions use JSON format with Akron type mapping:
Typical development workflow using Akron CLI:
Database connection URL. Must be provided for all commands except --help and --version.
akron command --db "sqlite:///database.db"
Display help information for any command.
akron create-table --help
Show the installed Akron version.
akron --version
✓ Table 'users' created successfully ✓ Seeded 2 records into 'users' table Database Schema: ├── users │ ├── id (int) │ ├── name (str) │ └── email (str) Query Results: [ {"id": 1, "name": "Alice", "email": "alice@example.com"}, {"id": 2, "name": "Bob", "email": "bob@example.com"} ] ✓ Table 'users' dropped successfully
Explore specific CLI commands for detailed usage: