Skip to the content.

Command-Line Interface

axion ships a small CLI (axion) for scaffolding and running projects. It is installed with the package.

usage: axion [-h] {startproject,run} ...

startproject

Scaffold a complete project layout:

axion startproject my_app

Creates my_app/ with:

my_app/
├── config/
│   └── settings.py   # project settings overrides
├── static/
│   ├── css/
│   ├── js/
│   └── imgs/
├── views/
│   └── index.html
└── main.py

The generated main.py already contains a working application — an SSR homepage plus a POST /api/user route with Pydantic body validation. Run it with:

cd my_app
python main.py

If the target directory already exists, startproject prints an error and does nothing.

run

Run any axion application script:

axion run main.py

This spawns main.py as a subprocess (python main.py). The default script is main.py. Since WebServer.run() blocks, python main.py and axion run main.py are equivalent.

Hot reload

axion run main.py --reload

--reload watches the current directory tree and restarts the server whenever a .py file changes. Events are debounced so a single editor save triggers exactly one restart. VCS and virtual-environment directories (.git, .venv, venv, __pycache__, node_modules, …) are ignored. Press Ctrl+C to stop.

Equivalent manual workflow

Everything the CLI does is plain Python, so you can skip it entirely:

python main.py

Next steps