Skip to main content
Mirage’s shell combines commands from Core Tools and Data & Network with variables, control flow, and persistent sessions.

Syntax

Shell commands

These are common options, not an exhaustive flag reference.

Sessions and permissions

ws.shell(...) keeps the session’s working directory, variables, and functions between calls. Supplying cwd or env uses an isolated copy for that call. Calls on one session run in order; use separate sessions for concurrent command streams. Python accepts a cancellation event through cancel; TypeScript accepts an abort signal.

Per-session mount modes

Session mount modes can narrow access to read, write, or exec (r, rw, rwx). Unlisted mounts keep their configured modes. Interpreters such as python3 and js require exec; shell scripts run with the permissions of each command they contain. Use a agent profile to hide paths or restrict commands.

Limits

  • Positive read -t values are accepted but do not enforce a timeout.
  • bg, complete, compgen, ulimit, coproc, and exec -a/-l are not implemented.
  • A process substitution lives as long as the command naming it, which waits for its output consumers; exec onto one (exec 3> >(command)) fails with exit status 2. Its /dev/fd/N paths are Mirage pipes, not host descriptors.
  • There is no interactive terminal or OS process job control. The supported job commands manage Mirage jobs. Use the CLI’s --background and mirage job for work that should outlive a request.
  • set and shopt recognize more option names than they implement; accepting or displaying an option does not mean every Bash behavior is available.
  • Enable extglob before the call that uses its syntax, or use eval after enabling it. A whole shell() call is parsed before it runs.
  • Command substitutions and background jobs do not inherit stdin. Writes through an already open output descriptor append rather than track a write offset.
  • Syntax errors return exit status 2. Compatibility is a supported subset of Bash, not a full Bash installation.