feat(maestro): wire maestro-cli to unified config (NAP-233)

CLI now reads `[shared].registry_url` and `[cli].cookie` from the unified
file via maestro-config instead of `~/.config/maestro/cli.toml`. The
two persistence paths are now distinct:

- `maestro set-registry <url>` → writes `[shared].registry_url`
- captured Set-Cookie on first contact → writes `[cli].cookie`

Both go through read-modify-write so they preserve any `[daemon]` /
`[registry]` content already in the file.

Env-var renames on the CLI flag layer:
- `--registry-url` reads `MAESTRO_SHARED_REGISTRY_URL` (was `MAESTRO_REGISTRY_URL`)
- `--config`       reads `MAESTRO_CONFIG`               (was `MAESTRO_CLI_CONFIG`)

Default config path is now `~/.config/maestro/config.toml`.
This commit is contained in:
2026-05-26 09:24:51 +00:00
parent bc9279b7ae
commit efaa8bfe13
6 changed files with 148 additions and 71 deletions
+4 -4
View File
@@ -14,12 +14,12 @@ use uuid::Uuid;
)]
pub struct Cli {
/// Override the registry URL for this invocation (e.g. `https://maestro.example.com`).
/// If omitted, the URL persisted in `~/.config/maestro/cli.toml` is used.
#[arg(long, global = true, env = "MAESTRO_REGISTRY_URL")]
/// If omitted, `[shared].registry_url` from the unified config file is used.
#[arg(long, global = true, env = "MAESTRO_SHARED_REGISTRY_URL")]
pub registry_url: Option<String>,
/// Path to the CLI config file. Default `~/.config/maestro/cli.toml`.
#[arg(long, global = true, env = "MAESTRO_CLI_CONFIG")]
/// Path to the unified Maestro config file. Default `~/.config/maestro/config.toml`.
#[arg(long, global = true, env = "MAESTRO_CONFIG")]
pub config: Option<PathBuf>,
/// Increase log verbosity. Repeat for more: `-v` = debug, `-vv` = trace.