CLI and onboarding direction
This is the agreed target API, not a description of commands already shipped. The current supported commands remain documented in the installation and daily operation guides. No compatibility aliases are required for this transition.
Public commands
| Command | Intended behavior |
|---|---|
cowboy | Open the configured default experience; offer onboarding when unconfigured. |
cowboy init [name] | Create an agent configuration using the shared settings UI. |
cowboy start [name] | Start a configured persistent agent. |
cowboy attach [target] | Attach to an existing agent by name or endpoint; never implicitly create one. |
cowboy stop [name] | Stop an agent. |
cowboy restart [name] | Restart an agent. |
cowboy list | Show all configured/discovered agents, including stopped agents and status. |
cowboy logs [name] | Show logs; --follow follows new output. |
cowboy ask "prompt" | One-shot request; --agent chooses an agent. |
cowboy doctor [name] | Diagnose runtime, provider and connection readiness. |
cowboy help [command] | Help and examples; also support --help and per-command --help. |
Omitted names use the configured default. cowboy list --status running filters
by state; --json supports scripts. Running describes process liveness, not
successful authentication or responsiveness. Unknown inspection results remain
unknown. Detaching leaves a persistent agent running.
Expose the version through --version. Shell completion is a documented
integration feature (cowboy completions <shell>), not part of the standard
verb list or the primary help overview.
Implementation progress
- Reopenable session settings in the harness.
- Reuse the Rust bootstrap wizard for first launch and persistent settings.
- Atomic XDG configuration and credential-reference saves, including noninteractive local settings files.
- Explicit opt-in discovery of existing setup.
- Include Zellij in the Nix-packaged CLI.
- Minimal Python
initpicker: Harness or Docker only. - Wheel delivery of Zellij.
- Persistent Docker agent with independent terminal and browser clients.
- Browser settings selected by a flag for Docker/Nix.
- Complete managed Nix settings view and declaration export.
- Migrate the public CLI to the verb set above and update internal callers.
- Fresh-distribution smoke tests across every supported runtime.
Python owns only the runtime picker. Without an explicit name, one Rust wizard collects name and provider/tool settings through confirmation. Naming advances in place; Docker consumes the confirmed settings without reopening the wizard. Harness enters a normal session without an onboarding conversation. Docker’s bootstrap system prompt establishes the user’s intended work in chat, then guides creation and testing of scripts, schedules, and relevant connectors. The Docker wizard records optional connector interests; the use case and actual connector configuration are discussed in chat. Full persistent connector settings remain unfinished; session model settings are separate.
CLI migration
Remove the redundant run command: bare cowboy covers interactive launch.
Do not add run --daemon: start owns persistent launch. Remove public serve
after migrating its detached-launch and container callers to the lifecycle
implementation. Service managers and container entry points invoke the runtime
internally; foreground Montana debugging does not need a public Cowboy verb.
Rename connect to attach outright. Fold status into list. Do not add a
public setup or settings verb. Retire public bake, config, models,
plugins, and the version verb as their replacements land. harness is an
internal managed-launch entry point, not a public command to teach newcomers.
Build/apply belongs to settings; use a function, or an internal __bake only
if a process boundary actually requires a command.
One settings flow, multiple runtimes
The initial lightweight Python terminal picker offers Harness or Docker. It needs neither runtime until the user chooses. Check that mode’s prerequisites before proceeding.
The TUI is the default onboarding and settings interface in every mode. Ship
Zellij with the supported Cowboy runtime rather than making it an optional
interface. Docker and Nix users can explicitly choose the browser interface
with --browser; this is a flag, not another mode picker or public verb. Both
interfaces use the same settings, validation, persistence and ownership rules.
- Harness requires Zellij. Launch it directly into Cowboy settings on first
use, then switch to chat after configuration. Reopen settings with
/settingsand a visible keyboard shortcut. Do not build a second terminal chat implementation just to eliminate Zellij. - Docker requires Docker, not host Zellij. Explain agent name, image download,
persistent storage and explicit workspace mounts before provisioning. Ship
Zellij inside the image and attach an interactive terminal to its settings
TUI by default. Montana owns the persistent agent; Zellij is a client, so
detaching must not stop the agent or container. With
--browser, serve the setup/settings UI from the container, bound to localhost and authenticated. This browser UI is planned, not currently shipped. - Full Nix uses the same logical settings view with values prefilled and their
ownership shown. Include Zellij in the distribution and default to the TUI;
--browserselects the browser interface to the managed service. Nix-owned fields are read-only in either interface; explain the declaration to change. There is no parallel imperative infrastructure configuration store.
OpenCode’s TUI is a reference for focused, reopenable provider/model dialogs reached from the conversation, rather than a separate application. Cowboy should reuse its existing bootstrap widgets and model data while separating rendering, validation, persistence and activation. A settings dialog is UI state, not a prompt sent to the model.
Configuration and credentials
Use XDG config for local preferences and setup schema version; XDG data for conversations/workspaces; XDG state for logs; XDG cache for disposable runtime artifacts. Apply standard defaults when variables are unset. Credentials are separate from ordinary settings and restricted to the operator. Never place secrets in chat, model context, logs, exported configuration or the Nix store.
Discovery of credentials or configuration from other applications is opt-in. Provide an explicit “Discover existing setup” action, show candidate references without secret values, and require selection before use. Do not scan or import on startup. Reading Cowboy’s own saved configuration and checking runtime availability are normal operations, not discovery consent.
A settings field identifies whether it is locally configured, container-owned or managed by Nix. Managed secrets initially use guided provisioning and validation of the configured reference (for example agenix), not plaintext key entry into the agent. A future operator credential service can support writing an approved backend without granting that authority to agent tools. A proxy’s credential presence cannot be inferred from a stub token inside the agent.
Interactive missing-provider/authentication cases open the relevant settings field. Tokenless configurations remain valid. Rejected credentials, unchecked authentication and unavailable checks are distinct states. Headless launches fail before model work if required configuration is absent. Preserve existing conversations and offer targeted repair rather than resetting setup.
Save setup completion atomically only after required validation. Preserve the working configuration when save/build/activation fails. Returning to settings must preserve current selections and let the user cancel without changes. Offer export to local configuration or a Nix declaration with secret references, so initial interactive setup can bootstrap a declarative deployment.
Dependencies
Harness interaction requires Zellij. Include it in Docker images and Nix
packages even when an operator uses the browser interface. The wheel’s local
harness path must also provide a compatible Zellij runtime; its native binary
delivery mechanism remains a packaging decision. Docker provisioning/lifecycle
requires Docker, with no host Zellij dependency. Nix-managed lifecycle uses
the provisioned service manager. Keep the Python wheel lean: bundle
the harness WASM and model data, but not the native Montana runtime. Ship
Montana through Nix packages and Docker images. Wheel users can manage Docker
agents without installing Montana on the host; native headless launch is not
a wheel-only feature. Current local ask uses Zellij; do not claim otherwise until
its execution path changes. Help, version, completions and the initial picker
need neither. Inventory should degrade gracefully when a runtime is absent.