Skip to content
Mycelis Roleplay · Reference · 10 min min read

CLI Reference (mycelis-roleplay)

Overview & Global Options

mycelis-roleplay is the .NET command-line tool for the Roleplay runtime. It drives standalone execution via the embedded LocalHub and handles service installation, Hub enrollment, portable state export/import, and signed self-updates.

Global Flag / Env Var Purpose
--data-dir DIR Override the runtime data directory (or set MYCELIS_ROLEPLAY_DATA)
--version / -v Print installed runtime version
--help / -h Show full usage help and --expect postcondition syntax

Important note when enrolled to a Hub: Once a device is enrolled via enroll, creating/canceling tasks (mission create/cancel), answering approvals (approvals), intervening (pause, resume, cancel-action, step-mode), and stop are governed centrally by the Hub Cockpit. Local CLI mutating commands refuse cleanly until you explicitly return to standalone mode with mycelis-roleplay unenroll.

Exit Codes

Code Meaning
0 Success
1 Runtime or verification error
2 Invalid arguments / usage error
3 Not supported on this OS platform

Tasks & Approvals (Standalone Mode)

# Create a task with explicit steps and machine-verifiable postconditions
mycelis-roleplay mission create \
  --goal "Configure nginx" \
  --step "Write site configuration" --expect "file-exists:/etc/nginx/sites-enabled/app.conf" \
  --step "Reload nginx" --expect "process-running:nginx" --expect "http-status:200::http://localhost/health" \
  [--tokens N] [--max-steps N] [--minutes N] [--cost USD] [--step-mode off|ui|all]

# Or load steps from a JSON plan file:
mycelis-roleplay mission create --goal "..." --steps-file plan.json

mycelis-roleplay mission list
mycelis-roleplay mission status [ID]
mycelis-roleplay mission cancel ID

mycelis-roleplay approvals list [--pending]
mycelis-roleplay approvals approve ID
mycelis-roleplay approvals deny ID

# Immediate device-wide emergency stop
mycelis-roleplay stop

Live Interventions & Terminal Watch

mycelis-roleplay pause [--mission ID]          # Pause right before the next action
mycelis-roleplay resume [--mission ID]         # Re-evaluate current scene and resume
mycelis-roleplay cancel-action ACTION          # Abort only the active action/process tree
mycelis-roleplay step-mode off|ui|all [--mission ID]
mycelis-roleplay watch [--mission ID] [--once] # Live action timeline and remote-access status in terminal

Recording & Playbooks

mycelis-roleplay record start [--id ID]
mycelis-roleplay record stop ID

mycelis-roleplay playbook distill --recording ID --name NAME
mycelis-roleplay playbook list
mycelis-roleplay playbook show NAME [--version V]
mycelis-roleplay playbook set-expect NAME --step N --expect POSTCONDITION [--expect ...]
mycelis-roleplay playbook confirm NAME [--version V] [--by PERSON]
mycelis-roleplay playbook run NAME [--version RANGE] [--param K=V]... [--tokens N]

Password fields are never captured during recording.


Roles, Brain Keys & Secrets

# Store a model API key via stdin into the OS secret store (standalone mode)
mycelis-roleplay brain-key set ANTHROPIC_API_KEY

# Generate, validate & apply, or inspect the active role blueprint
mycelis-roleplay role init [--name N] [--driver anthropic|openai-compatible] [--model M] [--endpoint URL] [--out FILE]
mycelis-roleplay role set FILE
mycelis-roleplay role show

# Review agent-drafted role proposals (standalone mode)
mycelis-roleplay role proposals
mycelis-roleplay role approve NAME
mycelis-roleplay role reject NAME

# Manage local app credentials (connected mode uses Cockpit Vault instead)
mycelis-roleplay secret set NAME FIELD=VALUE... [--description TEXT]
mycelis-roleplay secret list
mycelis-roleplay secret remove NAME

Employee State (Schedules, Memory, Skills, Events)

mycelis-roleplay schedule list
mycelis-roleplay schedule add "Daily digest" --cron "0 8 * * 1-5" [--tz Europe/Berlin] [--name digest] [--approve]
mycelis-roleplay schedule add "One-shot check" --at "2026-12-10T09:00"
mycelis-roleplay schedule enable ID | disable ID | remove ID

mycelis-roleplay memory list | search TEXT | forget ID
mycelis-roleplay skill list | show NAME | remove NAME
mycelis-roleplay events

Installation, Service, Enrollment & Export

# Install as a background OS service (with role file or Hub enrollment code)
mycelis-roleplay install [--role FILE] [--enroll-code CODE --hub URL] [--import ARCHIVE.zip] [--screen present|none] [--response-file FILE] [--unattended]
mycelis-roleplay uninstall [--yes] [--keep-data]

# Run Supervisor in foreground and inspect service status or OS permissions
mycelis-roleplay run [--role FILE] [--max-missions N] [--screen present|none]
mycelis-roleplay status
mycelis-roleplay permissions [--open]          # e.g. macOS Accessibility & Screen Recording

# Enroll or switch Hubs, or return to standalone mode
mycelis-roleplay enroll [CODE --hub URL | --uri URL] [--screen present|none]
mycelis-roleplay unenroll

# Portable state archive (memory, skills, schedules, watch sources, work/)
mycelis-roleplay state export FILE.zip
mycelis-roleplay state import FILE.zip

# Signed self-update
mycelis-roleplay update check [--hub URL | --manifest URL] [--public-key FILE] [--json]
mycelis-roleplay update apply [--hub URL | --manifest URL] [--public-key FILE] [--json]

Next steps