CodeCommands

Commands

Bahulam has three command surfaces: slash commands typed in the REPL, CLI flags passed when launching Bahulam, and top-level subcommands for common tasks.


Slash Commands

Type these at the > prompt. Commands are grouped by function. Many flat commands have namespaced replacements — both forms work, but namespaced versions are preferred.

Plan

CommandDescription
/planPlan and task overview
/plan statusPlan owner and task files
/plan editShow editable task/plan paths
/tasksList project tasks
/tasks add <text>Add a backlog task
/tasks active|blocked|done <text>Append to a task list

Status & Usage

CommandDescription
/statusSession snapshot (model, auth, system info)
/status contextLoaded .bahulam context files
/status metricsProgress bars and runtime metrics (aliased from /stats)
/status costCredits and usage breakdown (aliased from /cost)
/status budget <amount|clear>Set or clear a session cost cap (aliased from /budget)
/modelOpen the interactive per-role model picker
/model <model>Override the coding model for the session
/model <role> <model>Override a specific role (reasoning, fast, orchestrator, explore, plan, verify, debug, refactor)
/model fast|thinking|extra|maxSet a named mode; the platform maps it to a pinned model
/model listShow the curated (harness-validated) platform catalog
/model statusShow active session overrides, effective backend defaults, catalog source, model counts, and last refresh time
/model refreshRe-pull /api/models, report backend/snapshot source and model counts, and keep session overrides unchanged
/model clear [role]Clear all overrides, or a single role, and return to backend defaults
/attach <path>Attach an image file to the next prompt
/attach clipboardAttach the OS clipboard image
/attachmentsList pending image attachments
/attachments clearClear pending image attachments

The live slash-command hint under the input dock includes /model status, /model refresh, /model list, and /model clear. For example, typing /model r suggests /model refresh.

History

CommandDescription
/historyRecent conversation transcript
/history approvalsApproval decision log
/history lastExpand the last tool output
/history expand [n|all]Expand a specific tool output
/history foldHide a previously expanded output
/history checkpointList recent file checkpoints
/history undoRestore the latest file checkpoint
/history reportSave the mission report as markdown

Settings & Auth

CommandDescription
/settings policyShow the effective project policy
/settings loginSign in via browser
/settings logoutSign out and clear credentials
/settings whoamiShow the currently logged-in user
/settings quietHide sub-agent inner tools
/settings verboseShow sub-agent inner tools
/settings surgicalShow everything including reasoning

Approvals

CommandDescription
/autoSession autopilot: auto-approve routine tools (dangerous still prompts)
/auto fullFull autopilot — auto-approve every tool including dangerous tiers (mid-session equivalent of --dangerously-skip-permissions); hard safety blocks still enforced
/auto offRestore approval prompts
/approvalsList session approval grants
/approvals allow <tool>Auto-approve one specific tool for this session
/approvals remove <tool>Remove one session grant
/approvals clearRevoke all session auto-approvals

Worktree

CommandDescription
/gitGit status
/diffGit diff
/mapShow the registered project tree
/preflightRe-run the onboarding diagnostic
/safetyShow safety guardrail status

Agents

CommandDescription
/agentsList built-in and local agents
/subagentsAlias of /agents
/agents create <name>Scaffold .bahulam/agents/<name>.yaml
/agents edit <name>Open the local agent YAML for editing
/agents sync [name]Optionally publish local agents to the backend for account/cloud reuse
/explore <instruction>Spawn a read-only code explorer agent
/review <instruction>Spawn a code review agent
/architect <instruction>Spawn an architecture planning agent

Skills

CommandDescription
/skillsOpen the interactive picker — ↑↓ move, Enter view SKILL.md, r remove, Esc close
/skills list [--project|--all]Print the installed-skills table
/skills install <git-url|path> [--project] [--force]Install a skill bundle
/skills view <name> [resource]Render SKILL.md, or a bundled resource file
/skills remove <name> [--project]Uninstall a skill
/skills update <name> [--project]Reinstall from the recorded source

Session

CommandDescription
/sessionsList resumable sessions
/resume [id]Resume a previous session
/compactCompact the conversation context
/newStart a fresh session
/clearClear the conversation history
/exit, /quitExit the Bahulam REPL

Utility

CommandDescription
/helpShow available commands
/help allShow every available command
/help <group>Show commands for a specific group
/whyPrint the agent’s reasoning for the last decision
/mapShow the registered project file tree

Legacy Aliases

These flat commands still work but show a hint to use the namespaced version:

LegacyPreferred
/stats/status metrics
/cost/status cost
/budget/status budget
/last/history last
/expand/history expand
/fold/history fold
/undo/history undo
/checkpoint/history checkpoint
/report/history report
/login/settings login
/logout/settings logout
/whoami/settings whoami
/quiet/settings quiet
/verbose/settings verbose
/surgical/settings surgical

Top-Level Subcommands

Run these directly from your terminal shell:

CommandDescription
bahulamStart the interactive REPL
bahulam dashboardOpen the local analytics dashboard for sessions, stats, and prompt history
bahulam workspace open [path]Open a local browser workspace for a folder or document
bahulam workspace listList recent local browser workspace sessions
bahulam local open [path]Alias for bahulam workspace open [path]
bahulam sessionsList recent local sessions
bahulam statsShow aggregate local session statistics
bahulam historyShow recent prompt history
bahulam initScaffold .bahulam/, including .bahulam/BAHULAM.md, settings, tasks, a starter skill, and a starter command
bahulam loginSign in via browser (callback to bahulam.ai)
bahulam logoutSign out and clear credentials
bahulam versionShow the installed version
bahulam helpShow help text

Agent Subcommands

CommandDescription
bahulam agent listList backend-published user-defined agents
bahulam agent get <slug>Show one backend-published agent definition
bahulam agent syncOptionally publish .bahulam/agents YAML files to the backend
bahulam agent sync --dir <path>Publish agent definitions from a custom directory

Skills Subcommands

CommandDescription
bahulam skills list [--all|--project] [--json]List installed skills (aligned table by default)
bahulam skills view <name> [resource]View a skill’s details
bahulam skills install <path-or-git-url> [--project] [--force]Install a skill from a path or Git URL
bahulam skills update <name> [--project]Reinstall from the recorded source
bahulam skills remove <name> [--project]Remove a skill

Inside the REPL, /skills opens an interactive picker with the same subcommands available inline — see the Skills slash section above.

Local Browser Workspace Subcommands

Full walkthrough in Local Browser Workspace.

CommandDescription
bahulam workspace open [path]Start a localhost browser workspace for the selected file or folder
bahulam workspace start [path]Alias for open
bahulam workspace serve [path]Alias for open
bahulam workspace listList recent local browser workspace sessions
bahulam workspace statusAlias for list
bahulam local open [path]Short alias for bahulam workspace open [path]

Options:

OptionDescription
--port <n>Bind a specific 127.0.0.1 port
--kind <name>Override inferred kind: coding, documents, or workspace
--no-openStart the service without opening a browser
--jsonPrint session JSON and the workspace URL

Remote Session Subcommands

Full walkthrough in Remote Sessions.

CommandDescription
bahulam daemonize [prompt]Fork a detached background daemon; prints new session id
bahulam listList running daemon sessions (cwd, model, pid)
bahulam attach <sess_id>Attach to a running daemon; mirror events, approve/deny with a/d, Ctrl-D to detach
bahulam stop <sess_id>SIGTERM a daemon; flushes event log and exits
bahulam pair get-code [name]Ask the gateway for a 6-digit pairing code
bahulam pair <code> [name]Register THIS device with a code from another paired device
bahulam pair statusShow local pairing state
bahulam device listList paired devices for the current user
bahulam device revoke <device_id>Revoke a device (kill switch)
bahulam device whoamiPrint this device’s id + pubkey fingerprint
bahulam remote enableDaemon dials the relay on next session start
bahulam remote disableKill switch — running daemon drops relay in ≤10s
bahulam remote statusShow current relay-connection intent

CLI Flags

Pass these when launching Bahulam from the terminal.

FlagDescription
--model, -m <id>Override the model for explicit-route headless or local runs
--route, --model-route <platform|byok>Explicit billing/credential route for backend headless --model
--permission-mode <mode>Set permission mode: bypassPermissions, acceptEdits, plan, auto, dontAsk
--print, -p <prompt>Non-interactive mode: run a single prompt and exit
--output-format <fmt>Output format: text (default), json, stream-json
--system-prompt <text>Override the system prompt
--add-dir <dir>Additional directory to search for CLAUDE.md
--max-turns <n>Maximum conversation turns before stopping
--timeout <n>Timeout in seconds
--allowedTools <tools>Comma-separated list of allowed tools
--disallowedTools <tools>Comma-separated list of denied tools
--resume, --continue, -r [sessionId]Resume the last session (or a specific session)
--headlessNon-interactive mode: auto-approve, JSONL output to stdout
--cache-report <file>Write prompt-cache summary JSON to a file (headless only)
--localUse the bundled local runtime for agent execution; model calls still route through Bahulam Gateway
--dangerously-skip-permissionsSkip ALL approval prompts, including dangerous tiers; hard safety blocks still apply
--verbose, -vVerbose output
--debug, -dDebug mode
--planStart in planning mode (read-only, block all writes)
--no-indexSkip project indexing on startup
--help, -hShow help text and exit
--versionPrint the installed version and exit

Examples:

# Non-interactive: run a single prompt
bahulam -p "What is the entry point of this project?"
 
# Headless mode with a platform model override
bahulam platform --headless --timeout 300 --model deepseek/deepseek-v4-flash "Fix the bug"
 
# Headless mode with a BYOK model override
bahulam byok --headless --timeout 300 --model anthropic/claude-sonnet-4-6 "Fix the bug"
 
# Resume the last session
bahulam --resume
 
# Skip all approvals (use with caution)
bahulam --dangerously-skip-permissions
 
# Force bundled local runtime execution
bahulam --local --model claude-sonnet-4-6

Backend headless --model requires an explicit route. platform uses Bahulam-managed credentials and credit billing; byok uses your configured provider key and records usage without platform model-credit deduction. Interactive mode uses the model configured in Bahulam settings. Use the dashboard or /settings to inspect or change the interactive default.


Environment Variables

See Reference → Environment Variables for the full list.

Common ones:

VariablePurpose
BAHULAM_HOMEOverride the Bahulam config directory (default: ~/.bahulam)
BAHULAM_TOKENAuth token for CI/CD pipelines
BAHULAM_PRODUCTProduct variant
BAHULAM_NO_PREFLIGHTSkip onboarding diagnostic on startup (1 or true)
BAHULAM_MODEL_CATALOG_OFFLINESkip the background /api/models refresh; use the shipped snapshot only (1 to enable)
BAHULAM_DAEMON_EVENTLOG1 starts a socket server on session_info so other terminals / paired devices can attach (Remote Sessions)
BAHULAM_AUTO_ATTACH1 makes bahulam (no args) auto-attach to a live daemon for the current cwd
BAHULAM_APPROVAL_TIMEOUTApproval policy for unattended runs: hold (default), deny:<sec>, or allow:<sec>
BAHULAM_RELAY_KILL1 prevents the daemon from dialing the relay regardless of bahulam remote enable
BAHULAM_GATEWAY_URLOverride the gateway base URL (default https://gateway.bahulam.ai)
BAHULAM_RELAY_URLOverride the relay base URL (default wss://relay.bahulam.ai)
BAHULAM_LIBREOFFICE_PATHPath to the local LibreOffice soffice executable for DOCX/PPTX preview conversion
BAHULAM_LOCAL_SAVE_MAX_BYTESMaximum text-backed file size the browser workspace can save
BAHULAM_LOCAL_UPLOAD_MAX_BODY_BYTESMaximum browser workspace upload request size
ANTHROPIC_API_KEY / ANTHROPIC_MODELDirect Anthropic access + default model
OPENAI_API_KEY / OPENAI_BASE_URLDirect OpenAI access + endpoint override
OPENROUTER_API_KEYOpenRouter for BYOK
GEMINI_API_KEY / GOOGLE_API_KEYGoogle AI (Gemini) access
DEBUG / MCP_DEBUGEnable verbose logging