Skip to content

CLI Reference

The justapi CLI provides development, scaffolding, and management commands.

Terminal window
# Via cargo (permanent install)
cargo install justapi-cli
justapi --version
# Via uvx (run without installing)
uvx justapi --version

Start the development or production server.

Terminal window
justapi serve [OPTIONS]
Flag Default Description
--host 127.0.0.1 Bind address
--port 8000 Bind port
--workers CPU count Number of worker processes
--reload false Enable hot-reload on file changes
--timeout 30 Request timeout (seconds)
--unix Unix socket path
--scale false Enable load-based auto-scaling
--min-workers 2 Minimum workers (with –scale)
--max-workers CPU count Maximum workers (with –scale)
--scale-low 100 RPS to scale down
--scale-high 1000 RPS to scale up
--scale-cooldown 30 Seconds between scaling events

Generate a new project from a template.

Terminal window
justapi create [OPTIONS] <project_name>
Flag Default Description
--db (interactive) Database engine (sqlite, postgres, mysql, duckdb, clickhouse, mongodb, redis)
--api-type (interactive) API protocol (rest, graphql, grpc, jsonrpc)

Database migration commands.

Terminal window
justapi db migrate # Apply pending migrations
justapi db rollback # Rollback last migration
justapi db list # List migration status
justapi db seed # Seed database with initial data
justapi db reset # Drop and recreate all tables
justapi db inspect # Inspect database schema

List all registered routes.

Terminal window
justapi routes

Output:

Method Path Handler
GET / root
GET /items/{item_id} read_item
POST /items/ create_item

Run system diagnostics.

Terminal window
justapi doctor

Checks Python version, Rust availability, database connectivity, and configuration validity.

Generate artifacts.

Terminal window
justapi gen openapi > openapi.json # Generate OpenAPI spec
justapi gen client --lang typescript # Generate TypeScript client

Validate configuration without starting the server.

Terminal window
justapi check

Profile handler performance.

Terminal window
justapi profile --endpoint /items/42

Alias for justapi create.

Flag Description
--help Show help message
--version Show version