This page provides a comprehensive quick reference for all ap CLI commands, organized by functional category. It includes core lifecycle commands, dependency management utilities, and code quality tools.
The CLI uses a custom AliasGroup src/afterpython/cli/main.py34-85 to manage primary commands and their aliases (e.g., ap check and ap lint).
Sources: src/afterpython/cli/main.py106-134 src/afterpython/main.py11-15
| Command | Description | Key Flags | Implementation |
|---|---|---|---|
ap init | Initialize project structure and website template | --yes, --skip-website | src/afterpython/cli/commands/init.py |
ap sync | Propagate metadata to authors.yml and myst.yml | None | src/afterpython/cli/commands/sync.py |
ap build | Build MyST content and SvelteKit website | --execute | src/afterpython/cli/commands/build.py |
ap dev | Start development servers with live reload | --all, --doc, --blog, etc. | src/afterpython/cli/commands/dev.py |
ap preview | Preview production build via pnpm preview | None | src/afterpython/cli/commands/preview.py |
ap serve | Serve production build via pnpm serve | None | src/afterpython/cli/commands/serve.py |
ap clean | Remove build artifacts and temporary files | None | src/afterpython/cli/commands/clean.py |
Sources: src/afterpython/cli/main.py106-123 src/afterpython/cli/commands/serve.py7-30
| Command | Description | Key Flags | Implementation |
|---|---|---|---|
ap install | Run uv sync and pixi install | None | src/afterpython/cli/commands/install.py |
ap add | Add dependency to both uv and pixi | --optional, --group | src/afterpython/cli/commands/add.py |
ap remove | Remove dependency from uv and pixi | --optional, --group | src/afterpython/cli/commands/remove.py |
ap lock | Update uv.lock and pixi.lock | None | src/afterpython/cli/commands/lock.py |
ap update deps | Update dependency versions (pcu) | --upgrade, --all | src/afterpython/cli/commands/update.py |
Sources: src/afterpython/cli/commands/add.py9-68 src/afterpython/cli/main.py132-134
| Command | Description | Alias | Implementation |
|---|---|---|---|
ap check | Run ruff linter/format check | lint | src/afterpython/cli/commands/check.py |
ap format | Run ruff formatter | None | src/afterpython/cli/commands/format.py |
ap commit | Create conventional commit | cz | src/afterpython/cli/commands/commit.py |
ap bump | Bump version and update pixi.lock | None | src/afterpython/cli/commands/bump.py |
ap release | Trigger release workflow | None | src/afterpython/cli/commands/release.py |
Sources: src/afterpython/cli/main.py110-130
The FAQ system demonstrates how YAML source data is transformed into JSON for the frontend.
Sources: src/afterpython/builders/faq_json.py13-43 afterpython/faq_sample.yml7-54
The ap add command ensures parity between uv and pixi by mapping flags to their respective ecosystem equivalents.
Sources: src/afterpython/cli/commands/add.py25-67
The CLI provides two primary entry points:
ap: The main run_cli function src/afterpython/main.py11-14pcu: A direct alias for ap update deps via run_pcu src/afterpython/main.py17-21If the environment variable AP_AUTO_SYNC is set to "1", the CLI automatically invokes ap sync before executing most subcommands src/afterpython/cli/main.py97-103
Sources: src/afterpython/main.py11-21 src/afterpython/cli/main.py97-103