# CLI Companion Use `oxideterm` to inspect settings, automate migrations, or open a terminal or connection in the desktop app. ## Install the CLI Open **Settings → General → CLI Companion** and click **Install**. If the app shows **Reinstall required** after an update, click **Reinstall** to use the bundled version. If your shell cannot find the command, add the directory shown on that card to your `PATH`, then run `oxideterm --help`. The current command name is `oxideterm`; update scripts that still call `oxt`. ## Configuration and output ```sh oxideterm --config-dir oxideterm --profile OXIDETERM_CONFIG_DIR= oxideterm ``` `--profile` uses the `profiles/` subdirectory of the selected configuration directory. Check the resolved files with `oxideterm paths --json` using the same options as your script. Most write commands share the same safety flags: - `--dry-run`: show the plan without writing. - `--yes`: confirm a real write. - `--json`: produce machine-readable output. For `connections export`, `--format` selects the connection data format (`sync` or `raw-safe`). ## Choose a command | Task | Commands | |---|---| | Locate data and diagnose problems without changing settings | `paths`, `diagnose`, `doctor`, `errors`. Use `report` for a support report; `report --bundle` writes a file. | | Open something in the desktop app | `terminal` opens a local tab; `ssh user@host` opens a temporary SSH session; `open` takes a supported connection URI; `connections open` uses a saved profile. | | Inspect or change configuration | `settings`, `connections`, `forwards`, `quick-commands`, `plugins`, `secrets`. List or inspect before changing a record. | | Move or recover data | `oxide` for encrypted archives, `backup` for local configuration snapshots, `portable` for the portable keystore, `cloud-sync` for a shared backend. | | Integrate with another tool | `batch` applies a reviewed plan; `mcp bridge` connects an authorized stdio client to the desktop app; `completion` generates or installs shell completions. | Use `oxideterm --help` for subcommands and `oxideterm --help` for its flags. Not every write takes `--yes`: `oxide export` writes the specified output file, and `secrets set` changes protected storage directly. For a rehearsal, point `--config-dir` at an empty directory, use fictitious records and leave the system credential store alone. ## Open a terminal or connection ```sh oxideterm terminal --cwd ~/project oxideterm terminal --cwd ~/project -- python3 -i oxideterm ssh alice@example.com -p 2222 oxideterm open 'rdp://alice@desktop.example.com' oxideterm open 'vnc://desktop.example.com:5901' oxideterm open 'spice://vm.example.com:5900' ``` Without `--cwd`, a local terminal starts in the calling shell’s working directory. To run a program in the new tab, put it and its arguments after `--`. To use shell syntax such as a pipeline, invoke a shell explicitly, for example `-- /bin/sh -lc 'git log --oneline | head'`. `open` accepts `ssh://`, `telnet://`, `mosh://`, `rdp://`, `vnc://`, and `spice://` and opens a temporary connection in the desktop app. Install and enable the matching remote desktop provider before using a desktop URI. For SSH with a password, use `ssh --password-stdin` to avoid putting it in the URI. `terminal` and `connections open` use the app’s active data directory; omit configuration overrides for those commands. ## Diagnostics ```sh oxideterm paths --json oxideterm diagnose --json oxideterm doctor --strict oxideterm report --json ``` Use `doctor --strict` when warnings should fail CI. Use `report --bundle ` to save a support bundle for review and sharing. ## Settings ```sh oxideterm settings validate --strict oxideterm settings sections --json oxideterm settings get ai.providers --json oxideterm settings set terminal.fontSize 14 --dry-run oxideterm settings export --section appearance > ./settings-snapshot.json oxideterm settings diff ./settings-snapshot.json --section appearance ``` Without `--json`, `settings export` prints the snapshot itself. Redirect it to a file for `settings diff` or `settings import`. With `--json`, the snapshot is inside `data.snapshot`. `set` and `unset` update existing JSON paths only. Use `--yes` to confirm writes. ## Connections ```sh oxideterm connections list oxideterm connections search prod --json oxideterm connections open prod oxideterm connections create --name prod --host example.internal --user deploy --port 22 --dry-run oxideterm connections edit prod --totp-credential "Shared MFA" --dry-run oxideterm connections edit prod --clear-totp-credential --dry-run oxideterm connections rename prod production --yes oxideterm connections validate --strict oxideterm connections export --format raw-safe --json ``` `connections open` takes a saved SSH connection’s full name (case-insensitive) or exact ID. Use the ID when several connections share a name. The desktop app opens the profile with its saved credentials and connection options. `connections create` and `connections edit` accept `--totp-credential` with an existing credential's name or ID. Names are matched without case sensitivity; use an ID if several credentials share a name. JSON specs use `totpCredential`, including within `proxyChain` entries, or `clearTotpCredential: true` to remove the target connection's binding. Credential seeds stay in protected storage. For password or passphrase input, prefer `--password-stdin`, `--password-env`, `--passphrase-stdin`, or `--passphrase-env`. Do not pass secret values directly as shell arguments. `connections batch-create` creates many connections at once from an OpenSSH-style template plus one data line per host. Template: at most one `Host` block, whose `HostName` is `{host}` or omitted. Placeholders `{host}`, `{profile}`, `{user}`, `{port}`, `{name}`, `{group}` are substituted in `User`, `IdentityFile`, `CertificateFile`, and `ProxyCommand`; `Port` takes a literal number. Comment lines starting with `#` are dropped, and any other directive is reported with its line number. Data: `[user[:auth]@]host[:port][?name=…&group=…&profile=…&tags=a,b]`, one connection per line, `#` starts a comment. Every row needs a username from the row or the template. When a template value a row actually uses contains `{profile}` (the template user, its `ProxyCommand`, or the template identity for rows without their own credential), that row must supply `profile=`. An inline `auth` slot that contains `/` or `\`, or starts with `~`, is a private key path; anything else is a password. Use `key=` to force a key path and `pass=` to force a password that happens to look like a path. A row's inline credential beats the template `IdentityFile`. Rows without one use the template identity; if the template has no identity file, the shared `--password-env`/`--password-stdin`/`--key-path` flags supply authentication, and they are rejected when the template carries `IdentityFile` or `CertificateFile`. An empty slot (`user:@host`) is an error, and a batch is limited to 2,000 rows. Input: `--spec ` points to a JSON file with `template`, `data`, and an optional `duplicate` policy. It cannot be combined with `--template-file`/`--data-file`. `--dry-run` lists the rows that would be added, skipped, or rejected without writing; `--json` switches the report to JSON. Writes need `--yes`, and a write is refused while any line is invalid, so a batch is never applied partially. Duplicates: rows are the same connection only when the account and the credential match (`user@host:port` plus the same key or password); such a repeated row is always skipped. A name that already exists for the same `user@host:port` is reported as `batchUnchanged` when the row repeats it under the default skip policy, and as `batchUpdate` when the row differs (a new `group=` or `tags=` lands on the stored connection); the same name on a different target is skipped by default, or suffixed when you pass `--duplicate rename`. A `ProxyCommand` template needs ProxyCommand authorization enabled in the app settings. ```sh oxideterm connections batch-create --template-file ./template.conf --data-file ./hosts.txt --dry-run oxideterm connections batch-create --template-file ./template.conf --data-file ./hosts.txt --password-env OX_SSH_PW --yes ``` Inline credentials in a data or spec file are plaintext on disk: prefer `--password-stdin`/`--password-env` for a shared password, and protect or delete any file that carries one. ProxyCommand placeholders are expanded within individual arguments, so spaces and quotes in data do not create extra arguments. Use a direct executable, such as `ProxyCommand aws ssm start-session --profile {profile} --target %h --document-name AWS-StartSSHSession --parameters portNumber=%p`. Keep the executable and any inline shell script fixed; pass dynamic values to a POSIX shell as separate positional arguments. Windows command hosts and `env -S` do not accept dynamic values in batch templates. ## Backups and Restore ```sh oxideterm backup create --output ./oxideterm-backup.json --json oxideterm backup inspect ./oxideterm-backup.json --summary oxideterm backup restore ./oxideterm-backup.json --section settings --dry-run --json ``` Restore commands should be reviewed in dry-run form before `--yes`. ## Cloud Sync ```sh oxideterm cloud-sync status --json oxideterm cloud-sync diff --dirty-only --format table oxideterm cloud-sync backend webdav configure --endpoint https://example.invalid/sync --dry-run oxideterm cloud-sync sync --dry-run --json oxideterm cloud-sync sync --yes --json oxideterm cloud-sync secrets status --json ``` Close the desktop app before running CLI sync, including a dry-run: the command requires exclusive access to the configuration. `sync --dry-run` prepares a plan from the remote backend without applying or publishing it. `preview` and `diff` inspect cached state. Review the plan before using `--yes`. The current causal sync merges independent changes. The retained `push`, `pull` and `apply --from remote` commands use the same merge coordinator; their names do not select upload-only or download-only behavior. `pull` and `apply` accept only the merge strategy. Choose individual remote conflict candidates in the desktop preview. `resolve --strategy local-wins` selects local candidates for conflicts; inspect its dry-run before applying. Archive-import strategies such as skip, rename and replace belong to `.oxide` imports. Local application and remote publication have separate outcomes. If publication fails after local changes were applied, retain the configuration and retry sync. See [conflicts and interrupted sync](cloud-sync-and-backups.md#conflicts-and-interrupted-sync) for recovery. ## Connect a stdio MCP client `oxideterm mcp bridge` connects a stdio client to the running desktop app. Follow [Public MCP](ai-and-mcp.md#public-mcp) to create a client, grant tool groups, and get its JSON configuration. Have the MCP client launch the bridge and send requests to its standard input. - Endpoint discovery reads the active configuration directory. If the desktop app uses a custom data directory or named profile, pass the matching `--config-dir PATH` or `--profile NAME` in the client’s CLI arguments. Run `oxideterm paths --json` with the same options to check the directory. - If discovery is unavailable, use `--endpoint` or `OXIDETERM_MCP_ENDPOINT` with the local HTTP endpoint copied from Settings, for example `http://127.0.0.1:31415/mcp`. - The bridge reads the client credential from `OXIDETERM_MCP_TOKEN` by default. `--token-env NAME` changes the variable name; supply the value through the client’s secret environment settings. Run `oxideterm mcp bridge --help` for the options. If the client cannot connect, see [Public MCP troubleshooting](troubleshooting.md#oxidesens-acp-and-public-mcp). ## Apply a batch plan Batch plans combine several changes into one reviewed operation: ```sh oxideterm batch apply ./plan.json --dry-run oxideterm batch apply ./plan.json --yes --json ``` Use batch mode for scripted setup where settings, connection snapshots, and cloud-sync configuration should be reviewed together. ## Install shell completions ```sh oxideterm completion zsh > ~/.zfunc/_oxideterm oxideterm completion path zsh oxideterm completion install zsh ``` Use `--force` with `completion install` only when replacing an existing generated completion file.