mirror of
https://github.com/basnijholt/compose-farm.git
synced 2026-02-03 14:13:26 +00:00
docs: Add missing options, aliases, and config settings (#149)
- Add --pull and --build options to cf up (from #146) - Add --no-strays option to cf apply - Add command aliases section (a, l, r, u, p, s, c, rf, ck, tf) - Add cf config init-env subcommand documentation - Add glances_stack config option (from #124) - Add Host Resource Monitoring section to architecture docs
This commit is contained in:
@@ -96,7 +96,7 @@ Typer-based CLI with subcommand modules:
|
|||||||
cli/
|
cli/
|
||||||
├── app.py # Shared Typer app, version callback
|
├── app.py # Shared Typer app, version callback
|
||||||
├── common.py # Shared helpers, options, progress utilities
|
├── common.py # Shared helpers, options, progress utilities
|
||||||
├── config.py # config subcommand (init, show, path, validate, edit, symlink)
|
├── config.py # config subcommand (init, init-env, show, path, validate, edit, symlink)
|
||||||
├── lifecycle.py # up, down, stop, pull, restart, update, apply, compose
|
├── lifecycle.py # up, down, stop, pull, restart, update, apply, compose
|
||||||
├── management.py # refresh, check, init-network, traefik-file
|
├── management.py # refresh, check, init-network, traefik-file
|
||||||
├── monitoring.py # logs, ps, stats
|
├── monitoring.py # logs, ps, stats
|
||||||
@@ -343,3 +343,11 @@ For repeated connections to the same host, SSH reuses connections.
|
|||||||
```
|
```
|
||||||
|
|
||||||
Icons use [Lucide](https://lucide.dev/). Add new icons as macros in `web/templates/partials/icons.html`.
|
Icons use [Lucide](https://lucide.dev/). Add new icons as macros in `web/templates/partials/icons.html`.
|
||||||
|
|
||||||
|
### Host Resource Monitoring (`src/compose_farm/glances.py`)
|
||||||
|
|
||||||
|
Integration with [Glances](https://nicolargo.github.io/glances/) for real-time host stats:
|
||||||
|
|
||||||
|
- Fetches CPU, memory, and load from Glances REST API on each host
|
||||||
|
- Used by web UI dashboard to display host resource usage
|
||||||
|
- Requires `glances_stack` config option pointing to a Glances stack running on all hosts
|
||||||
|
|||||||
@@ -38,6 +38,18 @@ cf --version, -v # Show version
|
|||||||
cf --help, -h # Show help
|
cf --help, -h # Show help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Command Aliases
|
||||||
|
|
||||||
|
Short aliases for frequently used commands:
|
||||||
|
|
||||||
|
| Alias | Command | Alias | Command |
|
||||||
|
|-------|---------|-------|---------|
|
||||||
|
| `cf a` | `apply` | `cf s` | `stats` |
|
||||||
|
| `cf l` | `logs` | `cf c` | `compose` |
|
||||||
|
| `cf r` | `restart` | `cf rf` | `refresh` |
|
||||||
|
| `cf u` | `update` | `cf ck` | `check` |
|
||||||
|
| `cf p` | `pull` | `cf tf` | `traefik-file` |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Lifecycle Commands
|
## Lifecycle Commands
|
||||||
@@ -60,14 +72,16 @@ cf apply [OPTIONS]
|
|||||||
|--------|-------------|
|
|--------|-------------|
|
||||||
| `--dry-run, -n` | Preview changes without executing |
|
| `--dry-run, -n` | Preview changes without executing |
|
||||||
| `--no-orphans` | Skip stopping orphaned stacks |
|
| `--no-orphans` | Skip stopping orphaned stacks |
|
||||||
|
| `--no-strays` | Skip stopping stray stacks (running on wrong host) |
|
||||||
| `--full, -f` | Also refresh running stacks |
|
| `--full, -f` | Also refresh running stacks |
|
||||||
| `--config, -c PATH` | Path to config file |
|
| `--config, -c PATH` | Path to config file |
|
||||||
|
|
||||||
**What it does:**
|
**What it does:**
|
||||||
|
|
||||||
1. Stops orphaned stacks (in state but removed from config)
|
1. Stops orphaned stacks (in state but removed from config)
|
||||||
2. Migrates stacks on wrong host
|
2. Stops stray stacks (running on unauthorized hosts)
|
||||||
3. Starts missing stacks (in config but not running)
|
3. Migrates stacks on wrong host
|
||||||
|
4. Starts missing stacks (in config but not running)
|
||||||
|
|
||||||
**Examples:**
|
**Examples:**
|
||||||
|
|
||||||
@@ -81,6 +95,9 @@ cf apply
|
|||||||
# Only start/migrate, don't stop orphans
|
# Only start/migrate, don't stop orphans
|
||||||
cf apply --no-orphans
|
cf apply --no-orphans
|
||||||
|
|
||||||
|
# Don't stop stray stacks
|
||||||
|
cf apply --no-strays
|
||||||
|
|
||||||
# Also refresh all running stacks
|
# Also refresh all running stacks
|
||||||
cf apply --full
|
cf apply --full
|
||||||
```
|
```
|
||||||
@@ -102,6 +119,8 @@ cf up [OPTIONS] [STACKS]...
|
|||||||
| `--all, -a` | Start all stacks |
|
| `--all, -a` | Start all stacks |
|
||||||
| `--host, -H TEXT` | Filter to stacks on this host |
|
| `--host, -H TEXT` | Filter to stacks on this host |
|
||||||
| `--service, -s TEXT` | Target a specific service within the stack |
|
| `--service, -s TEXT` | Target a specific service within the stack |
|
||||||
|
| `--pull` | Pull images before starting (`--pull always`) |
|
||||||
|
| `--build` | Build images before starting |
|
||||||
| `--config, -c PATH` | Path to config file |
|
| `--config, -c PATH` | Path to config file |
|
||||||
|
|
||||||
**Examples:**
|
**Examples:**
|
||||||
@@ -589,6 +608,7 @@ cf config COMMAND
|
|||||||
| Command | Description |
|
| Command | Description |
|
||||||
|---------|-------------|
|
|---------|-------------|
|
||||||
| `init` | Create new config with examples |
|
| `init` | Create new config with examples |
|
||||||
|
| `init-env` | Generate .env file for Docker deployment |
|
||||||
| `show` | Display config with highlighting |
|
| `show` | Display config with highlighting |
|
||||||
| `path` | Print config file path |
|
| `path` | Print config file path |
|
||||||
| `validate` | Validate syntax and schema |
|
| `validate` | Validate syntax and schema |
|
||||||
@@ -600,6 +620,7 @@ cf config COMMAND
|
|||||||
| Subcommand | Options |
|
| Subcommand | Options |
|
||||||
|------------|---------|
|
|------------|---------|
|
||||||
| `init` | `--path/-p PATH`, `--force/-f` |
|
| `init` | `--path/-p PATH`, `--force/-f` |
|
||||||
|
| `init-env` | `--path/-p PATH`, `--output/-o PATH`, `--force/-f` |
|
||||||
| `show` | `--path/-p PATH`, `--raw/-r` |
|
| `show` | `--path/-p PATH`, `--raw/-r` |
|
||||||
| `edit` | `--path/-p PATH` |
|
| `edit` | `--path/-p PATH` |
|
||||||
| `path` | `--path/-p PATH` |
|
| `path` | `--path/-p PATH` |
|
||||||
@@ -635,6 +656,12 @@ cf config symlink
|
|||||||
|
|
||||||
# Create symlink to specific file
|
# Create symlink to specific file
|
||||||
cf config symlink /opt/compose-farm/config.yaml
|
cf config symlink /opt/compose-farm/config.yaml
|
||||||
|
|
||||||
|
# Generate .env file for Docker deployment
|
||||||
|
cf config init-env
|
||||||
|
|
||||||
|
# Generate .env in current directory
|
||||||
|
cf config init-env -o .env
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -121,6 +121,16 @@ Stack name running Traefik. Stacks on the same host are skipped in file-provider
|
|||||||
traefik_stack: traefik
|
traefik_stack: traefik
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### glances_stack
|
||||||
|
|
||||||
|
Stack name running [Glances](https://nicolargo.github.io/glances/) for host resource monitoring. When set, the web UI displays CPU, memory, and load stats for all hosts.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
glances_stack: glances
|
||||||
|
```
|
||||||
|
|
||||||
|
The Glances stack should run on all hosts and expose port 61208. See the README for full setup instructions.
|
||||||
|
|
||||||
## Hosts Configuration
|
## Hosts Configuration
|
||||||
|
|
||||||
### Basic Host
|
### Basic Host
|
||||||
|
|||||||
Reference in New Issue
Block a user