CLI Reference¶
The shakti command handles project scaffolding, running the dev server, and code/migration generation.
shakti new¶
Scaffold a new project.
Generates app/main.py, app/models/, config/settings.yaml + config/settings.production.yaml, tests/test_app.py, conftest.py, .env, .gitignore, README.md, and requirements.txt. Fails if the target directory already exists, or if name isn't a valid identifier (letters/digits/-/_, must start with a letter).
shakti run¶
Start the dev server (uvicorn under the hood).
app is an import string, default app.main:app. --reload enables autoreload (mutually exclusive with --workers — reload always runs single-process). Requires the server extra: pip install "shakti-framework[server]".
shakti version¶
shakti generate (alias g)¶
shakti generate model <Name> [field:type[:modifier] ...]
shakti generate crud <Name>
shakti generate api <Name> field:type[:modifier] [...]
model writes a model file; crud writes a CRUD router for an existing model; api does both in one shot (and requires at least one field). Name must be PascalCase. See Code Generation for the full field DSL.
shakti makemigrations (alias mm)¶
Auto-generates an Alembic migration from the diff between your models and the database. message defaults to "auto".
shakti migrate¶
Applies migrations up to revision (default head, i.e. everything pending).
shakti db¶
See Migrations for how these map to Alembic and what gets generated the first time you run them.