Skip to content

CLI Commands

The ostwin CLI is the unified entry point for all OSTwin operations β€” plan creation, execution, monitoring, skill management, and more. It lives at .agents/bin/ostwin and is a pure PowerShell script (requires pwsh 7+).

Global Options

FlagDescription
-h, --helpShow help text and exit
-v, --versionShow version and build hash

ostwin run

Execute a plan. This is the primary entry point for running work.

Terminal window
ostwin run <plan_id>
ostwin run <plan_id> --dry-run
ostwin run <plan_id> --resume --expand
ostwin run plans/my-feature.md

The first positional argument is resolved in this order:

  1. Plan ID β€” a hex string (8–64 characters) resolved via the dashboard API to a plan file and working directory
  2. File path β€” an existing .md file used directly
  3. Fallback β€” passed through as-is (will error if invalid)

When a plan ID is provided and the dashboard is reachable, ostwin run automatically resolves the plan file location and extracts the working_dir from the plan metadata.

FlagDescription
--dry-runParse plan, build DAG, but do not execute
--resumeResume a previously stopped plan execution
--expandExpand the plan using AI before execution
--reviewRun in review-only mode
--max-rooms NLimit concurrent war-rooms
--working-dir PATHOverride the working directory for the plan
--non-interactive, -nSkip all interactive prompts

Auto Role Scaffolding

If the plan references roles that are not installed, ostwin run will prompt (or auto-create in non-interactive mode) to scaffold the missing roles using Auto-CreateRole.ps1.

Project Initialization

Before execution, ostwin run ensures the project directory is initialized (runs init.ps1 idempotently). This creates .agents/ and .opencode/opencode.json if they don’t exist.

ostwin plan

Plan management with AI-assisted creation.

Terminal window
ostwin plan create "Implement user auth"
ostwin plan create --file brief.txt
ostwin plan create brief.md
ostwin plan start <plan_id>
ostwin plan list
ostwin plan clear --force
SubcommandDescription
createGenerate a plan via the dashboard API from a title or file
startExecute a plan (same resolution as ostwin run)
listList all plans tracked in the project
clearDelete all plan files and zvec indexes

plan create

Terminal window
ostwin plan create "My Feature"
ostwin plan create --file brief.txt
ostwin plan create brief.md # smart-detect: .md file treated as --file
ArgumentDescription
[Title]Plan title (positional)
--file, -fRead initial content from a file
bare .md pathIf the positional arg is an existing .md file, it’s used as the init file automatically

Creates the plan via the dashboard API and opens the plan editor in your browser.

Requires the dashboard to be running (ostwin dashboard start).

plan start

Terminal window
ostwin plan start <plan_id>
ostwin plan start <plan_id> --dry-run

Accepts the same plan_id or file path resolution as ostwin run, plus the same flags (--dry-run, --resume, --expand, --working-dir).

plan clear

Terminal window
ostwin plan clear
ostwin plan clear --force

Removes all plan files from ~/.ostwin/.agents/plans/ (preserving PLAN.template.md) and clears the zvec index. Stops and restarts the dashboard if it was running.

FlagDescription
--force, -f, -ySkip confirmation prompt

ostwin init

Scaffold Agent OS into a project directory.

Terminal window
ostwin init # Initialize current directory
ostwin init /path/to/project # Initialize a specific directory
ostwin init --yes # Non-interactive mode
FlagDescription
--yes, -yAccept all defaults without prompts
--help, -hShow help

Creates .agents/, config.json, role directories, and the opencode configuration. Lighter than a full install β€” does not install Python dependencies.

ostwin sync

Sync framework updates from the global OSTwin installation to an initialized project.

Terminal window
ostwin sync
ostwin sync /path/to/project

Updates .agents/ scripts and configuration to match the installed version.

ostwin status

Show the current state of all war-rooms.

Terminal window
ostwin status
ostwin status --watch
ostwin status --json
FlagDescription
--jsonMachine-readable JSON output
--watchContinuously refresh the status display

Reads status, state_changed_at, and retries from each room directory.

ostwin logs

View war-room channel logs.

Terminal window
ostwin logs
ostwin logs room-001
ostwin logs room-001 --follow
ostwin logs --type done --last 20
FlagDescription
--follow, -fStream new log entries in real time
--type TYPEFilter by message type (task, done, review, pass, fail, fix, error, signoff)
--from ROLEFilter by sender role
--last NShow only the last N messages

ostwin stop

Graceful shutdown of running processes.

Terminal window
ostwin stop
ostwin stop --force
FlagDescription
--forceForce-kill the entire process tree immediately

Stops the dashboard and any running channel processes. Without --force, sends a graceful termination signal and waits up to 5 seconds before force-killing.

ostwin dashboard

Manage the web dashboard server.

Terminal window
ostwin dashboard start
ostwin dashboard stop
ostwin dashboard restart
ostwin dashboard status
ostwin dashboard logs
ostwin dashboard logs --follow
SubcommandDescription
startStart the dashboard in the background
stopStop the running dashboard
restartStop and start the dashboard
statusShow running state, URL, and memory pool health
logsShow the last 50 log lines (use -f to follow)

The dashboard runs on port 3366 by default (overridable via DASHBOARD_PORT env var).

ostwin channel

Manage communication channel integrations (Telegram, Discord, Slack).

Terminal window
ostwin channel start
ostwin channel stop
ostwin channel status
ostwin channel logs
ostwin channel list
ostwin channel connect
ostwin channel disconnect
ostwin channel test
ostwin channel pair
ostwin channel deploy
SubcommandDescription
startStart the channel service
stopStop the channel service
statusShow channel connection status
logsView channel service logs
listList configured channels
connectConnect a channel integration
disconnectDisconnect a channel integration
testTest channel connectivity
pairPair a channel with a war-room
deployDeploy channel configuration

ostwin skills

Manage skill discovery, installation, and updates.

Terminal window
ostwin skills search "web"
ostwin skills install my-skill
ostwin skills install https://github.com/user/repo
ostwin skills install --from /path/to/skill
ostwin skills install my-skill --agent engineer
ostwin skills list
ostwin skills update --all
ostwin skills remove my-skill
ostwin skills sync
SubcommandDescription
installInstall a skill from ClawHub catalog, GitHub URL, or local directory
listShow installed skills (via dashboard API)
searchSearch the ClawHub catalog
updateUpdate a specific skill or all skills
removeUninstall a skill
syncSynchronize skills across the project

install sources

The install subcommand supports three sources:

SourceExample
ClawHub slugostwin skills install my-skill
GitHub URLostwin skills install https://github.com/user/skill-repo
Local directoryostwin skills install --from /path/to/skill-dir

When installing from a GitHub URL, ostwin clones the repository, scans for SKILL.md files, and installs each skill found. Nested skills (skills inside other skill directories) are skipped.

FlagDescription
--from DIRInstall from a local directory
--agent ROLEInstall to a specific role’s skill directory instead of global

ostwin mcp

Manage MCP extensions and permissions.

Terminal window
ostwin mcp sync
ostwin mcp install chrome-devtools
ostwin mcp install --http https://stitch.googleapis.com/mcp
ostwin mcp list
ostwin mcp catalog
ostwin mcp remove chrome-devtools
ostwin mcp credentials set API_KEY
ostwin mcp test chrome-devtools
SubcommandDescription
syncResolve MCP servers from role definitions and generate agent permissions
installInstall an MCP extension from catalog, git, or HTTP
listShow installed extensions
catalogShow available packages in the central catalog
removeUninstall an extension
credentialsManage credentials in the vault (set, list, delete)
testTest MCP server connectivity

mcp sync

Terminal window
ostwin mcp sync

Resolves MCP server references from role.json mcp_refs and generates the agent permission configuration in ~/.config/opencode/opencode.json. Run this after installing new MCP extensions or updating role configurations.

ostwin memory

Manage agent memory namespaces.

Terminal window
ostwin memory list
ostwin memory stats <plan_id>
ostwin memory tree <plan_id>
ostwin memory clear <plan_id> --force
ostwin memory delete <plan_id> <note_id>
ostwin memory archive <plan_id>
ostwin memory export <plan_id>
SubcommandDescription
listList all namespaces with note counts and sizes
statsShow stats for a namespace (notes, tags, keywords, paths)
treeShow the note directory tree for a namespace
clearDelete all notes in a namespace
deleteDelete a single note by ID
archiveArchive notes and start fresh
exportExport a namespace as .tar.gz

Requires the dashboard to be running.

FlagDescription
--forceSkip confirmation prompt (for clear)

ostwin role

Run a role’s subcommand or list available roles.

Terminal window
ostwin role # List all roles with subcommands
ostwin role <name> # List subcommands for a role
ostwin role <name> <sub> [args] # Run a role subcommand

Roles define their subcommands in subcommands.json. Each subcommand has an invoke template that is resolved and executed in the role’s module root directory.

ostwin clone-role

Clone a global role to a project-local directory for customization.

Terminal window
ostwin clone-role engineer
ostwin clone-role engineer --project-dir /path/to/project
FlagDescription
--project-dir PATHTarget project directory (default: current directory)

This is a shortcut for ostwin role manager clone -RoleName <role> -ProjectDir <path>.

ostwin config

View or update configuration.

Terminal window
ostwin config --get manager.poll_interval_seconds
ostwin config --set manager.default_model "google-vertex/gemini-3.1-pro"
FlagDescription
--get KEYRead a configuration value
--set KEY VALUEWrite a configuration value

ostwin health

Check system health.

Terminal window
ostwin health
ostwin health --json
FlagDescription
--jsonMachine-readable JSON output

Validates the PowerShell engine, dashboard API, dashboard frontend, memory daemon, and active war-room states.

ostwin test

Run test suites.

Terminal window
ostwin test
ostwin test --suite NAME --verbose
FlagDescription
--suite NAMERun a specific test suite
--verboseVerbose output

Executes Pester tests across lib/, channel/, war-rooms/, roles/, and plan/ modules.

ostwin reload-env

Reload environment variables from ~/.ostwin/.env into MCP configuration files.

Terminal window
ostwin reload-env

Parses the .env file and injects all variables into the environment (or env) blocks of every configured MCP server. Useful after adding new API keys or changing environment configuration.

ostwin mac

macOS desktop automation shorthand. Delegates to the macos-automation-engineer role.

Terminal window
ostwin mac app help
ostwin mac window list
ostwin mac capture screen
ostwin mac type "Hello World"
ostwin mac click 100 200

Available scripts: app, window, click, type, capture, system, finder, axbridge, devtools. Run ostwin mac <script> help for per-script usage.

This is a shortcut for ostwin role macos-automation-engineer <script> <command>.

ostwin version

Show the current version.

Terminal window
ostwin version

Displays the version from config.json and the build hash (if available).

Environment Variables

VariableDescription
ENGINEER_CMDOverride the CLI tool spawned for the engineer role
QA_CMDOverride the CLI tool spawned for the QA role
MOCK_SIGNOFFSet to "true" for automatic signoff (testing)
AGENT_OS_LOG_LEVELLog level: DEBUG, INFO, WARN, ERROR (default: INFO)
WARROOMS_DIROverride the war-rooms data directory (default: <project>/.war-rooms)
DASHBOARD_PORTOverride the dashboard port (default: 3366)
DASHBOARD_URLOverride the dashboard URL (default: http://localhost:3366)
OSTWIN_HOMEOverride the OSTwin home directory (default: ~/.ostwin)
OSTWIN_API_KEYAPI key for dashboard authentication

Environment files are loaded in this order (later values do not override already-set variables):

  1. ~/.ostwin/.env β€” global
  2. <project-root>/.env β€” project root
  3. .agents/.env β€” agents directory

Plan ID Resolution

When a command accepts a <plan_id> argument, the following resolution logic applies:

  1. Existing file β€” If the argument is a path to an existing file, use it directly and extract working_dir from the file content
  2. Hex ID β€” If the argument matches ^[0-9a-fA-F]{8,64}$ (no slashes or dots), query the dashboard API at /api/plans/<id> to resolve the plan file location and working directory
  3. Fallback β€” Pass through as-is

This means you can use either short hex IDs (e.g., a1b2c3d4e5f6) or full file paths interchangeably.