|
1 | 1 | # CLI Reference |
2 | 2 |
|
3 | | -This section provides details on using the custom `tux` command-line interface, built with Click. |
| 3 | +This page provides comprehensive documentation for all Tux CLI commands. The CLI is organized into several command groups, each handling specific aspects of the project. |
4 | 4 |
|
5 | | -## Environment Selection |
| 5 | +## Overview |
6 | 6 |
|
7 | | -The `tux` CLI defaults to **development mode** for all command groups (`db`, `dev`, `docker`). This ensures that operations like database migrations or starting the bot target your development resources unless explicitly specified otherwise. |
| 7 | +The Tux CLI provides a unified interface for all project operations. You can access individual command groups using the following commands: |
8 | 8 |
|
9 | | -* **Production Mode:** |
10 | | - To run a command targeting production resources (e.g., production database, production bot token), you **must** use the global `--prod` flag immediately after `tux`: |
| 9 | +- `uv run db` - Database operations and management |
| 10 | +- `uv run dev` - Development tools and workflows |
| 11 | +- `uv run docker` - Docker operations and management |
| 12 | +- `uv run docs` - Documentation operations and management |
| 13 | +- `uv run test` - Testing operations and management |
| 14 | +- `uv run tux` - Tux bot operations and management |
11 | 15 |
|
12 | | - ```bash |
13 | | - # Example: Apply migrations to production database |
14 | | - uv run tux db migrate --prod |
15 | | - |
16 | | - # Example: Start the bot using production token/DB |
17 | | - uv run tux start --prod |
18 | | - ``` |
19 | | - |
20 | | -* **Development Mode (Default / Explicit):** |
21 | | - Running any command without `--prod` automatically uses development mode. You can also explicitly use the `--dev` flag, although it is redundant. |
22 | | - |
23 | | - ```bash |
24 | | - # These are equivalent and run in development mode: |
25 | | - uv run tux db push |
26 | | - uv run tux db push --dev |
27 | | -
|
28 | | - uv run tux start |
29 | | - uv run tux start --dev |
30 | | - ``` |
31 | | - |
32 | | -This default-to-development approach prioritizes safety by preventing accidental operations on production environments. The environment determination logic can be found in `tux/utils/env.py`. |
33 | | - |
34 | | -::: mkdocs-click |
35 | | - :module: tux.cli |
| 16 | +::: mkdocs-typer |
| 17 | + :module: scripts.cli |
36 | 18 | :command: cli |
37 | | - :prog_name: tux |
38 | | - :depth: 0 |
39 | | - :style: table |
40 | | - :list_subcommands: True |
| 19 | + :depth: 1 |
0 commit comments