Register and discover Mirage’s supported CLIs, and use them with workspace files.
These are programs, such as gh, slack and git, that an agent runs inside
a workspace shell. Mirage implements them itself; no binary is installed. The
mirage command you run on your own machine is a different thing: see the
host mirage CLI.
hf and himalaya live in the Node package: import them from
@struktoai/mirage-node. Each page lists the subset Mirage implements, its
limits and its licenses; see
compatibility and licenses.
Register a CLI
Account CLIs need credentials but do not need a service mount:
import { SLACK, Workspace } from '@struktoai/mirage-node'const ws = new Workspace({})ws.registerCli('slack', SLACK, { token: 'xoxb-...' })await ws.shell('slack --help')
registerCli(name, spec, config) validates the config object with the
spec’s schema. git, office, pdfinfo and pdftotext take no config;
register them without the third argument.
Register the same CLI twice under different names for two accounts.
Only your code can register a CLI. An agent cannot install one from the
shell.
machine: in_process runs the CLI inside Mirage. YAML config fields use snake_case in both languages. Setup pages
cover credentials and imports for every program.
man and --help render the registered spec. Unknown commands are refused; wording and exit codes follow the program’s declared style. Use each
reference for command-specific errors rather than assuming one exit code for
all CLIs.which slack prints /usr/bin/slack. Running that path is the same as
running slack. Changing PATH does not change which programs Mirage finds.
CLIs and mounts
A CLI and a mount are separate: neither installs nor finds the other, even
when they share a token.
A CLI’s
Goes to
Service commands, such as slack send-message
The account in that install’s config
File arguments, such as gh --body-file, ntn --filter-file, himalaya --attach and hf upload
Workspace files, relative to the session’s working directory
git -C /repo ...
The repository on a workspace mount
After a CLI changes its service, Mirage drops the cached listings and
search results of every mount its client may reach, so later reads see the
change. gh reaches only GitHub mounts on its API base.
A mount’s mode governs only writes into the mount. A read-only Slack mount
does not stop slack send-message; refuse service actions with a
command policy. The service’s own permissions still
apply.
Add a custom CLI
Use the authoring guide to define a typed command tree,
register multiple accounts, work with VFS paths, or run a script CLI. It also
covers config validation, snapshots and the shared command grammar.