Skip to content

Commit 6dc00fe

Browse files
committed
refactor(docs): update CLI documentation and mkdocs configuration
- Revised the CLI documentation to provide a clearer overview of command groups and their usage. - Updated mkdocs.yml to correct a typo in the namespace package setting and added mkdocs-typer plugin for enhanced CLI documentation. - Removed outdated comments and improved the structure of the documentation for better readability.
1 parent 9c6168a commit 6dc00fe

File tree

2 files changed

+19
-37
lines changed

2 files changed

+19
-37
lines changed

docs/content/dev/cli/index.md

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,19 @@
11
# CLI Reference
22

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.
44

5-
## Environment Selection
5+
## Overview
66

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:
88

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
1115

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
3618
:command: cli
37-
:prog_name: tux
38-
:depth: 0
39-
:style: table
40-
:list_subcommands: True
19+
:depth: 1

docs/mkdocs.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ plugins:
122122
- assets/stylesheets/extra.css
123123
- assets/stylesheets/mkdocstrings.css
124124

125+
# # https://pypi.org/project/mkdocs-typer2/
126+
# - mkdocs-typer2:
127+
# pretty: true
128+
125129
# https://mkdocstrings.github.io/
126130
- mkdocstrings:
127131
# https://mkdocstrings.github.io/python/usage/#installation
@@ -267,7 +271,7 @@ plugins:
267271
nav_section_title: Tux Reference
268272
api_root_uri: reference
269273
exclude_private: false
270-
on_implicit_namespace_packge: raise
274+
on_implicit_namespace_package: raise
271275
# https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#revisioning
272276
# - git-revision-date-localized:
273277
# enable_creation_date: false
@@ -280,8 +284,6 @@ plugins:
280284
#
281285
markdown_extensions:
282286
- attr_list
283-
# https://github.com/mkdocs/mkdocs-click
284-
- mkdocs-click:
285287
# https://mkdocstrings.github.io/usage/theming/#syntax-highlighting
286288
- pymdownx.highlight:
287289
use_pygments: true
@@ -293,6 +295,7 @@ markdown_extensions:
293295
anchor_linenums: true
294296
- toc:
295297
permalink: true
298+
- mkdocs-typer:
296299
- pymdownx.superfences
297300
- pymdownx.inlinehilite
298301
# - pymdownx.snippets
@@ -315,4 +318,4 @@ nav:
315318
- Database Patterns: dev/database_patterns.md
316319
- Permissions: dev/permissions.md
317320
- Self Hosting: dev/self_hosting.md
318-
# - CLI Reference: dev/cli/index.md
321+
- CLI Reference: dev/cli/index.md

0 commit comments

Comments
 (0)