Skip to content

xtr_cli.command

The commands: two that create a project, and one that serves it.

Importing this package declares all of them: @as_command writes to the console's registry as each module is read, which is why the entry point imports this and nothing else.

InitCommand

Create a new application in the current directory.

Nothing is asked: a console application by default, a web application with --webapp. The directory must hold nothing but version-control or editor metadata; an existing git repository is kept rather than initialised again.

NewCommand

Create a new application in a new directory.

Nothing is asked: a console application by default, a web application with --webapp. The packages are installed with uv, and each one's recipe is applied, before the command ends.

ServeCommand

Serve the application the current directory belongs to.

The web entry point is found in the project — its web console script, or else a module-level ASGI application — and run in the project's own environment with uv run. The server restarts on every source change unless --no-reload is given. Ctrl-C stops the server, and waits for the application to shut down.