CLI Reference¶
Complete reference for Aksara CLI commands.
Usage¶
Global Options¶
| Option | Description |
|---|---|
--help |
Show help message |
--version |
Show version |
--quiet |
Suppress non-error Aksara UI output |
--plain |
Disable Rich rendering and animations |
--no-color |
Disable colored terminal output |
--force-color |
Force colored output when supported |
--settings PATH |
Settings module path (planned) |
--pythonpath PATH |
Add a path to sys.path (planned) |
--verbose |
Increase output verbosity (planned) |
Global output flags must be placed before the subcommand. Examples: aksara --quiet migrate, aksara --plain dev, aksara --no-color info.
Note:
--settings,--pythonpath, and--verboseare planned. Use theAKSARA_SETTINGSenvironment variable in the meantime.
Project Commands¶
startproject¶
Create a new Aksara project.
| Option | Description |
|---|---|
--directory DIR |
Target directory |
--template TEMPLATE |
Project template |
Example:
startapp¶
Create a new application.
| Option | Description |
|---|---|
--directory DIR |
Target directory |
Example:
Database Commands¶
makemigrations¶
Create new migrations.
| Option | Description |
|---|---|
--name NAME |
Migration name |
--empty |
Create empty migration |
--check |
Check only, don't create |
--dry-run |
Show without creating |
Example:
aksara makemigrations
aksara makemigrations users --name add_bio_field
aksara makemigrations --check
migrate¶
Apply migrations from the project-wide migrations/ directory.
| Option | Description |
|---|---|
--database-url, -d |
PostgreSQL connection URL |
--migrations-dir, -m |
Migrations directory (default: ./migrations) |
--dry-run |
Preview without applying |
--fake |
Mark as applied without running |
Example:
aksara migrate
aksara migrate --dry-run
aksara migrate --fake
aksara migrate --migrations-dir custom_migrations
status¶
Show migration status.
| Option | Description |
|---|---|
--database-url, -d |
PostgreSQL connection URL |
Example:
Server Commands¶
dev¶
Start the preferred local development server with the Aksara hero banner.
| Option | Default | Description |
|---|---|---|
--host HOST |
127.0.0.1 |
Bind host |
--port PORT |
8000 |
Bind port |
--reload |
True | Enable auto-reload |
--no-reload |
False | Disable auto-reload |
--log-level LEVEL |
info |
Uvicorn log level |
Example:
aksara dev
aksara dev myproject.main:app --log-level debug
aksara dev --no-reload --port 3000
aksara run dev
run¶
Start a specific ASGI app path directly.
| Option | Default | Description |
|---|---|---|
--host HOST |
127.0.0.1 |
Bind host |
--port PORT |
8000 |
Bind port |
--reload |
True | Auto-reload |
--workers N |
1 |
Worker count |
Example:
aksara run main:app
aksara run main:app --port 3000
aksara run main:app --host 0.0.0.0 --port 8080
aksara run myproject.main:app --reload
Shell Commands¶
shell¶
Start interactive Python shell.
| Option | Description |
|---|---|
--database-url, -d |
PostgreSQL connection URL |
--no-ipython |
Disable IPython even if available |
--bpython |
Use BPython instead of IPython (planned) |
--command, -c |
Execute a Python command and exit (planned) |
Example:
aksara shell
aksara shell --database-url postgresql://postgres:password@localhost:5432/myapp
aksara shell --no-ipython
dbshell¶
Planned — not yet available.
Open a raw psql session connected to the project database.
inspectdb¶
Planned — not yet available.
Generate Aksara model definitions by introspecting an existing PostgreSQL schema.
Utility Commands¶
routes¶
List all routes.
| Option | Description |
|---|---|
--format FMT |
Output format (table, json) |
--filter PATTERN |
Filter routes by path pattern (planned) |
--method METHOD |
Filter routes by HTTP method (planned) |
Example:
Output:
Method Path Name Handler
------ ---------------------- ------------------ ----------------------
GET /api/users/ users-list UserViewSet.list
POST /api/users/ users-create UserViewSet.create
GET /api/users/{id}/ users-detail UserViewSet.retrieve
PUT /api/users/{id}/ users-update UserViewSet.update
DELETE /api/users/{id}/ users-delete UserViewSet.destroy
info¶
Show project information.
| Option | Description |
|---|---|
--database-url, -d |
PostgreSQL connection URL |
Output:
Aksara Project Information
==========================
Version: 0.5.46
Python: 3.11.0
Settings: myproject.settings
Database: postgresql://localhost/myproject
Apps: users, posts, comments
Models:
- users.User
- users.Profile
- posts.Post
- posts.Comment
models¶
List registered models.
| Option | Description |
|---|---|
--app APP |
Application models module to import |
--ai |
Show AI metadata |
--detail |
Show detailed field definitions (planned) |
Example:
test¶
Run tests.
Additional arguments are passed through to pytest.
| Flag | Description |
|---|---|
-v / --verbose |
Verbose output |
--failfast |
Stop on first failure |
--parallel |
Run in parallel (requires pytest-xdist) |
--cov / --coverage |
Measure coverage (requires pytest-cov) |
-k EXPRESSION |
Filter by name expression |
--tb=short |
Shorter tracebacks |
Example:
aksara test
aksara test tests/test_users.py
aksara test -v --tb=short
aksara test -k "test_create"
aksara test --failfast
aksara test --parallel
collectstatic¶
Collect static files.
Creates missing project static assets such as static/welcome.html. This also runs automatically before aksara dev and aksara run.
| Option | Description |
|---|---|
--no-input |
Skip confirmation prompts (planned) |
--clear |
Delete existing static files first (planned) |
--dry-run |
Preview without writing files (planned) |
check¶
Planned — not yet available.
Validate the project configuration and run system checks.
| Option | Description |
|---|---|
--deploy |
Run stricter production-safety checks |
Example output:
⚡ Aksara System Check
✓ Database connection OK
✓ Migrations up to date
✓ Settings valid
✓ Admin configured
✓ Static files present
0 issues found.
settings¶
Planned — not yet available.
Display the current project settings.
| Option | Description |
|---|---|
--setting NAME |
Show only the specified setting |
Watch & Automation¶
watch¶
Planned — not yet available.
Watch for file changes and re-run tests automatically.
Data Commands¶
dumpdata¶
Planned — not yet available.
Export database content to a fixture file.
| Option | Description |
|---|---|
--output FILE |
Output file path |
--format FMT |
Output format (json, yaml) |
--all |
Include all apps |
--indent N |
JSON indentation |
loaddata¶
Planned — not yet available.
Load fixture data into the database.
Auth Commands¶
createsuperuser¶
Create admin user.
| Option | Description |
|---|---|
--database-url, -d |
PostgreSQL connection URL |
--email EMAIL, -e |
User email |
--password PASSWORD, -p |
User password |
--no-input |
Use provided values without prompts (planned) |
--username USERNAME |
Username for username-based auth (planned) |
Example:
changepassword¶
Planned — not yet available.
Change the password for an existing user.
AI Commands¶
ai query¶
Query data with natural language.
| Option | Description |
|---|---|
--output FMT |
Output format (table, json, csv) |
--limit N |
Result limit |
Example:
ai generate¶
Generate code.
| Option | Description |
|---|---|
--output FILE |
Output file |
--preview |
Preview only |
Example:
aksara ai generate model "User with email, name, role"
aksara ai generate viewset User
aksara ai generate test User --output tests/test_users.py
ai doctor¶
Analyze schema for issues.
| Option | Description |
|---|---|
--fix |
Auto-fix issues |
--interactive |
Confirm each fix |
Example:
ai plan¶
Plan complex tasks.
| Option | Description |
|---|---|
--execute |
Execute the plan |
--preview |
Preview only |
Example:
aksara ai plan "Add user profile feature with avatar upload"
aksara ai plan "Refactor auth to use JWT" --preview
ai agent¶
Run AI agent.
| Option | Description |
|---|---|
--tools TOOLS |
Allowed tools (comma-separated) |
--max-steps N |
Maximum steps |
Example:
aksara ai agent "Analyze the codebase and suggest improvements"
aksara ai agent "Fix failing tests" --max-steps 10
ai patch¶
Apply code changes.
| Option | Description |
|---|---|
--preview |
Preview changes |
--dry-run |
Don't apply |
Example:
ai ask¶
Ask questions about the codebase.
Example:
ai config¶
Configure AI settings.
| Option | Description |
|---|---|
--provider NAME |
Set provider |
--model NAME |
Set model |
--show |
Show current config |
Example:
Task Queue Commands¶
tasks stats¶
Show task queue counts grouped by status and queue.
Example output:
Queue: default
pending 3
running 1
completed 412
failed 2
Queue: emails
pending 0
running 0
completed 87
failed 1
Total
pending 3
running 1
completed 499
failed 3
tasks list¶
List task records. Defaults to showing failed tasks.
| Option | Default | Description |
|---|---|---|
--status, -s |
failed |
Filter by status (pending, running, completed, failed) |
--queue, -q |
— | Filter by queue name |
--task-name, -t |
— | Substring match on task_name |
--limit, -n |
20 |
Maximum rows returned |
Examples:
aksara tasks list
aksara tasks list --status pending
aksara tasks list --status failed --queue emails --limit 50
aksara tasks list --task-name send_welcome
tasks reenqueue¶
Re-enqueue a failed task by ID, or all failed tasks at once.
Re-enqueuing resets attempts, locked_at, last_error, and available_at
so the task is treated as brand-new.
| Option | Description |
|---|---|
--all |
Re-enqueue all failed tasks |
--queue, -q |
Filter by queue when using --all |
--yes, -y |
Skip confirmation prompt |
Examples:
aksara tasks reenqueue 3f2a1c4e-... # one task by UUID
aksara tasks reenqueue --all # all failed tasks
aksara tasks reenqueue --all --queue emails
aksara tasks reenqueue --all --yes # skip confirmation
tasks purge¶
Delete old task records from the database.
| Option | Default | Description |
|---|---|---|
--status, -s |
completed |
Status(es) to purge (repeatable) |
--older-than-days, -d |
7 |
Delete rows last updated more than N days ago |
--yes, -y |
— | Skip confirmation prompt |
Examples:
aksara tasks purge # completed, >7 days
aksara tasks purge --status failed --older-than-days 30
aksara tasks purge --status completed --status failed -d 1 --yes
Custom Commands¶
Creating Commands¶
# myapp/management/commands/mycommand.py
from aksara.cli import Command, argument, option
class MyCommand(Command):
"""Description of my command."""
name = "mycommand"
@argument("name", help="The name argument")
@option("--count", "-c", default=1, help="Count option")
async def handle(self, name: str, count: int):
for i in range(count):
self.output(f"Hello, {name}!")
Running Custom Commands¶
Environment Variables¶
| Variable | Description |
|---|---|
AKSARA_SETTINGS_MODULE |
Settings module path |
AKSARA_DEBUG |
Enable debug mode |
DATABASE_URL |
Database connection URL |
Exit Codes¶
| Code | Description |
|---|---|
0 |
Success |
1 |
General error |
2 |
Command not found |
3 |
Invalid arguments |