mirror of
https://github.com/basnijholt/compose-farm.git
synced 2026-02-03 06:03:25 +00:00
cli: Add short command aliases (#148)
* cli: Add short command aliases Add single and two-letter aliases for frequently used commands: - a → apply - l → logs - r → restart - u → update - p → pull - s → stats - c → compose - rf → refresh - ck → check - tf → traefik-file Aliases are hidden from --help to keep output clean. * docs: Document command aliases in README
This commit is contained in:
13
README.md
13
README.md
@@ -53,6 +53,7 @@ A minimal CLI tool to run Docker Compose commands across multiple hosts via SSH.
|
||||
- [Usage](#usage)
|
||||
- [Docker Compose Commands](#docker-compose-commands)
|
||||
- [Compose Farm Commands](#compose-farm-commands)
|
||||
- [Aliases](#aliases)
|
||||
- [CLI `--help` Output](#cli---help-output)
|
||||
- [Auto-Migration](#auto-migration)
|
||||
- [Traefik Multihost Ingress (File Provider)](#traefik-multihost-ingress-file-provider)
|
||||
@@ -395,6 +396,18 @@ Multi-host orchestration that Docker Compose can't do:
|
||||
| `cf config` | Manage config files (init, show, validate, edit, symlink) |
|
||||
| `cf ssh` | Manage SSH keys (setup, status, keygen) |
|
||||
|
||||
### 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` |
|
||||
|
||||
Each command replaces: look up host → SSH → find compose file → run `ssh host "cd /opt/compose/plex && docker compose up -d"`.
|
||||
|
||||
```bash
|
||||
|
||||
@@ -406,5 +406,9 @@ def compose(
|
||||
raise typer.Exit(result.exit_code)
|
||||
|
||||
|
||||
# Alias: cf a = cf apply
|
||||
app.command("a", hidden=True)(apply)
|
||||
# Aliases (hidden from help, shown in --help as "Aliases: ...")
|
||||
app.command("a", hidden=True)(apply) # cf a = cf apply
|
||||
app.command("r", hidden=True)(restart) # cf r = cf restart
|
||||
app.command("u", hidden=True)(update) # cf u = cf update
|
||||
app.command("p", hidden=True)(pull) # cf p = cf pull
|
||||
app.command("c", hidden=True)(compose) # cf c = cf compose
|
||||
|
||||
@@ -659,3 +659,9 @@ def init_network(
|
||||
failed = [r for r in results if not r.success]
|
||||
if failed:
|
||||
raise typer.Exit(1)
|
||||
|
||||
|
||||
# Aliases (hidden from help)
|
||||
app.command("rf", hidden=True)(refresh) # cf rf = cf refresh
|
||||
app.command("ck", hidden=True)(check) # cf ck = cf check
|
||||
app.command("tf", hidden=True)(traefik_file) # cf tf = cf traefik-file
|
||||
|
||||
@@ -201,3 +201,8 @@ def stats(
|
||||
|
||||
console.print()
|
||||
console.print(_build_summary_table(cfg, state, pending))
|
||||
|
||||
|
||||
# Aliases (hidden from help)
|
||||
app.command("l", hidden=True)(logs) # cf l = cf logs
|
||||
app.command("s", hidden=True)(stats) # cf s = cf stats
|
||||
|
||||
Reference in New Issue
Block a user