CLI Reference¶
This section provides details on using the custom tux
command-line interface, built with Click.
Environment Selection¶
The tux
CLI defaults to development mode for all command groups (bot
, db
, dev
, docker
). This ensures that operations like database migrations or starting the bot target your development resources unless explicitly specified otherwise.
-
Production Mode: To run a command targeting production resources (e.g., production database, production bot token), you must use the global
--prod
flag immediately aftertux
: -
Development Mode (Default / Explicit): Running any command without
--prod
automatically uses development mode. You can also explicitly use the--dev
flag, although it is redundant.
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
.
tux¶
Tux CLI
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--version | boolean | Show the version and exit. | False |
--help | boolean | Show this message and exit. | False |
Subcommands
- db: Database management commands
- dev: Development tools
- docker: Docker management commands
- docs: Documentation related commands
- start: Start the Discord bot
tux db¶
Database management commands
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
Subcommands
- generate: Generate Prisma client.
- migrate: Run database migrations.
- pull: Pull schema from database.
- push: Push schema changes to database.
- reset: Reset database.
tux db generate¶
Generate Prisma client.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux db migrate¶
Run database migrations.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux db pull¶
Pull schema from database.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux db push¶
Push schema changes to database.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux db reset¶
Reset database.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux dev¶
Development tools
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
Subcommands
- format: Format code with Ruff.
- lint: Run linting with Ruff.
- lint-fix: Run linting with Ruff and apply fixes.
- pre-commit: Run pre-commit checks.
- type-check: Check types with Pyright.
tux dev format¶
Format code with Ruff.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux dev lint¶
Run linting with Ruff.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux dev lint-fix¶
Run linting with Ruff and apply fixes.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux dev pre-commit¶
Run pre-commit checks.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux dev type-check¶
Check types with Pyright.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux docker¶
Docker management commands
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
Subcommands
- build: Build Docker images.
- down: Stop Docker services.
- exec: Execute a command inside a running service container.
- logs: Show logs for a Docker service.
- ps: List running Docker containers.
- up: Start Docker services.
tux docker build¶
Build Docker images.
Runs docker compose build
.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux docker down¶
Stop Docker services.
Runs docker compose down
.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux docker exec¶
Execute a command inside a running service container.
Runs docker compose exec [service] [command]
.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux docker logs¶
Show logs for a Docker service.
Runs docker compose logs [service]
.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
-f , --follow | boolean | Follow log output. | False |
--help | boolean | Show this message and exit. | False |
tux docker ps¶
List running Docker containers.
Runs docker compose ps
.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux docker up¶
Start Docker services.
Runs docker compose up
. Can optionally build images first with --build.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
-d , --detach | boolean | Run containers in the background. | False |
--build | boolean | Build images before starting containers. | False |
--help | boolean | Show this message and exit. | False |
tux docs¶
Documentation related commands
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
Subcommands
tux docs build¶
Build documentation site.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux docs serve¶
Serve documentation locally.
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |
tux start¶
Start the Discord bot
Usage:
Options:
Name | Type | Description | Default |
---|---|---|---|
--help | boolean | Show this message and exit. | False |