Anvil CLI Command Reference
Every slash command, organized by category — with workflow descriptions and practical examples. Start with /help in the REPL or browse below.
Getting Started
Anvil is distributed as a single self-contained binary. Install it with Homebrew on macOS or run the install script on any Unix system. Once installed, run `anvil` in any project directory to open the interactive REPL — no project initialization required.
brew tap culpur/anvil && brew install anvilInstall via Homebrew (macOS)
curl -fsSL https://anvilhub.culpur.net/install.sh | shInstall via shell script (Linux / macOS)
anvil --updateSelf-update to the latest release without reinstalling
anvilStart the interactive REPL in the current directory
/loginAuthenticate with your AI provider (Anthropic OAuth or API key)
Core Commands
These commands manage your session state, model selection, and basic navigation. Use `/status` at any time to see what model is active and how many tokens you have used. `/compact` is useful in long sessions — it compresses the conversation history into a summary, freeing up context window space without losing important information.
/helpShow all available commands with short descriptions
/statusShow current session status: active model, token usage, and provider
/model <name>Switch AI model mid-session without losing conversation history
Example: /model gpt-4o
/costDisplay token costs accumulated in the current session
/clearClear conversation history and start fresh in the same session
/focusToggle focus view — show only prompts, tool summaries, and responses (Ctrl+O)
/forkBranch the conversation — create, list, or switch between branches
Example: /fork experiment | /fork list | /fork switch 1
/compactCompress conversation history to a summary to free context window space
/versionShow Anvil version, build hash, and build date
/language <code>Switch the UI language (en / de / es / fr / ja / zh-CN / ru)
Example: /language de
File & Code Operations
Anvil understands your codebase at the AST level, not just as text. The `/semantic-search` command uses language-specific parsers to find symbols — functions, classes, structs — by name or type across your entire project. The `/refactor` commands rewrite code safely: rename propagates across all files, and extract turns a line range into a named function.
/semantic-searchAST-aware symbol search across the project (functions, classes, structs)
Example: /semantic-search --type function --lang rust authenticate
/refactor rename <old> <new>Rename a symbol across all files in the project with conflict detection
Example: /refactor rename getUserById fetchUserById
/refactor extract <file> <lines>Extract a range of lines into a new named function with proper signature inference
Example: /refactor extract src/auth.ts 42-61
/diffShow the current working directory diff with AI-generated change summary
AI-Powered Development
Anvil can generate tests, perform code reviews, and produce documentation automatically. `/test generate` reads your source file and writes unit tests using the test framework already present in your project. `/review` performs a full static analysis pass with security and quality findings. The `/docs` suite can produce README files, architecture diagrams in Mermaid syntax, and changelogs derived directly from your git history.
/test generate <file>Auto-generate unit tests for a source file using the project's existing test framework
Example: /test generate src/auth/jwt.ts
/test runRun the project test suite — auto-detects Cargo, npm, pytest, and go test
/test coverageGenerate a test coverage report and highlight uncovered branches
/review <file>AI code review of a single file: security issues, logic errors, and style
Example: /review src/api/auth.ts
/review stagedReview all staged git changes before committing — catches issues early
/review prReview the full diff of the current pull request against its base branch
/docs generateAuto-generate project documentation based on source code analysis
/docs readmeGenerate or update README.md with project overview, usage, and API docs
/docs architectureGenerate an architecture overview with Mermaid diagrams
/docs changelogGenerate a formatted changelog from git commit history
Git & GitHub
Anvil integrates deeply with git and GitHub. `/commit` reads your staged diff and writes a conventional commit message. `/commit-push-pr` does all three steps in one shot — ideal for small focused changes. The `/git` subcommands assist with more complex operations: rebase conflict resolution, cherry-pick risk assessment, and stash management all get AI guidance inline.
/commitGenerate an AI commit message from the staged diff and open it for review
/commit-push-prCommit with an AI message, push to origin, and open a draft pull request
/prCreate a GitHub pull request with an AI-generated title and description
/issueCreate a GitHub issue with AI-assisted title, body, and label suggestions
/git rebaseInteractive rebase assistant — resolves conflicts with AI explanations
/git conflictsDetect merge conflicts in the working tree and suggest resolutions
/git cherry-pick <sha>Cherry-pick a commit with risk assessment for conflicts
Example: /git cherry-pick a3f9c12
/git stashStash management: save, list, apply, and drop with descriptive names
Infrastructure & DevOps
Anvil includes a full suite of DevOps tools for managing containers, Kubernetes clusters, infrastructure-as-code, CI/CD pipelines, and SSH sessions. The `/iac` commands wrap Terraform and OpenTofu — use `/iac drift` to detect configuration drift between your state file and live infrastructure. The `/pipeline` command generates CI/CD workflow files for GitHub Actions, GitLab CI, and other providers based on your project's language and test setup.
/docker ps|logs|compose|buildContainer management: list containers, stream logs, run Compose, build images
Example: /docker logs my-api-container
/k8s pods|logs|apply|describeKubernetes cluster management: inspect workloads, stream logs, apply manifests
Example: /k8s pods --namespace production
/iac plan|apply|validate|driftTerraform/OpenTofu IaC management with AI-generated plan summaries
Example: /iac drift
/pipeline generate|lint|runCI/CD pipeline builder: generates GitHub Actions, GitLab CI, or Jenkinsfile
Example: /pipeline generate --provider github-actions
/ssh list|connect|tunnel|keysSSH session manager: save hosts, connect, set up tunnels, manage keys
Example: /ssh connect prod-bastion
Security & Vault
The security suite covers vulnerability scanning, credential management, and dependency auditing. `/security scan` performs static analysis for common vulnerability patterns (OWASP Top 10, injection, path traversal). `/vault` is a full encrypted credential store using AES-256-GCM encryption with Argon2id key derivation — it also supports TOTP so you can manage 2FA codes alongside API keys and passwords.
/security scanScan the project for vulnerability patterns — SQL injection, XSS, path traversal, and more
/security secretsDetect hardcoded credentials, API keys, and tokens in source files
/security depsAudit project dependencies against the CVE database and advisory feeds
/security reportGenerate a comprehensive security report combining scan, secrets, and dep audit results
/vault setupInitialize an encrypted credential vault (AES-256-GCM + Argon2id key derivation)
/vault unlockUnlock the vault with your master password to begin a session
/vault store <label>Store a credential in the vault, encrypted at rest
Example: /vault store github-token
/vault get <label>Decrypt and retrieve a credential, optionally copying it to the clipboard
Example: /vault get github-token
/vault totp add <label>Add a TOTP entry to the vault using a seed or QR code
Example: /vault totp add github-2fa
/vault totp <label>Generate the current TOTP code for a stored entry
Example: /vault totp github-2fa
Database & API
Anvil can connect to PostgreSQL, MySQL, SQLite, and MongoDB databases, inspect schemas, and run queries with AI assistance. The `/api` suite accelerates API development: generate an OpenAPI spec from source code, spin up a mock server from that spec, run endpoint tests, and produce documentation — all without leaving the terminal.
/db connectConnect to a database (PostgreSQL, MySQL, SQLite, MongoDB) using a connection string
Example: /db connect postgresql://localhost/myapp
/db schemaInspect and visualize the database schema with table relationships
/db queryRun a SQL query with AI-assisted query building and result explanation
/db migrateGenerate and apply database migrations with dry-run preview
/api specGenerate an OpenAPI 3.1 spec from route definitions in your source code
/api mockStart a mock server from an OpenAPI spec, returning realistic fake data
/api testRun API endpoint tests against a live or mock server
/api docsGenerate human-readable API documentation from an OpenAPI spec
Notifications
Anvil can send notifications to 8 different platforms when long-running tasks complete. This is useful for CI-style workflows where you kick off a build or test run and want to be notified when it finishes — without watching the terminal. All platform commands share the same `/notify send` prefix for consistency.
/notify send <msg>Send a desktop notification (macOS, Linux with libnotify)
Example: /notify send 'Build complete'
/notify discord <webhook> <msg>Post a message to a Discord channel via webhook URL
/notify slack <webhook> <msg>Post a message to a Slack channel via incoming webhook
/notify telegram <chat_id> <msg>Send a Telegram message via bot token to a chat or channel
/notify whatsapp <number> <msg>Send a WhatsApp message to a phone number via configured gateway
/notify signal <number> <msg>Send a Signal message via signal-cli to a registered number
/notify matrix <room> <msg>Post a message to a Matrix room using the configured homeserver token
Example: /notify matrix '!roomid:matrix.org' 'Deploy done'
/notify webhook <url> <msg>POST a JSON payload to any generic webhook endpoint
Workspace & Memory
Anvil's persistent memory system stores facts, notes, and context across sessions using the QMD knowledge base. Use `/pin` to add files to the active context so they are always included in AI requests — useful for config files, shared types, or architecture docs. `/init` writes an `anvil.toml` project file that captures your model preferences, pinned files, and custom tool configuration.
/memoryView, search, and manage persistent memory entries stored in the QMD knowledge base
/memory layer 1Live snapshot of the working-memory inventory — kind, size, and preview for every section in injection order
/memory show episodic|procedural|cacheEnumerate the contents of an individual memory layer — episodic (daily summaries + history + sessions), procedural (goals + skills + cron), or cache (file-cache + command-cache + QMD-cache stats)
Example: /memory show episodic
/memory promote <nomination-id>Persist a nominated fact to disk with provenance comments. Use --target <file> to route to a specific file (relative, absolute, or ~-expanded)
Example: /memory promote nom-2026-05-22-001 --target ~/.anvil/ANVIL.md
/memory prune episodicTTL-based retention with trash-bin safety. --dry-run is default ON; --confirm is required for actual moves. Default TTL 90 days, override via --ttl <days>
Example: /memory prune episodic --ttl 60 --confirm
/memory prune cache --dry-runWalk file-cache and command-cache for stale/missing-file candidates without mutating anything; pair with /file-cache prune and /cmd-cache prune for the actual sweep
/initInitialize Anvil in the current project — creates anvil.toml with recommended defaults
/configView or edit the Anvil configuration file directly
/configureOpen the interactive configuration menu for providers, models, and preferences — includes a Language Picker submenu with all 18 locales rendered in their native script
/contextInspect and manage the current conversation context window contents
/pin <file>Pin a file to the active context so it is always included in AI requests
Example: /pin src/types/index.ts
/unpin <file>Remove a previously pinned file from the active context
AnvilHub & Plugins
AnvilHub is the community marketplace for Anvil extensions. Packages are installed with a single command and activated immediately — no restart needed. The `/plugin-sdk` commands scaffold a new package, run tests against the Anvil plugin API, and publish to AnvilHub when you're ready. Skills, plugins, agents, and themes are all distributed as AnvilHub packages.
/hubOpen the AnvilHub browser in the terminal — navigate packages by category
/hub search <query>Search AnvilHub packages by name, description, or tag
Example: /hub search kubernetes
/hub install <name>Install a package from AnvilHub into the current Anvil installation
Example: /hub install culpur/anvil-k8s
/plugin listList all installed plugins with version and enabled status
/plugin install <name>Install a plugin by name from AnvilHub or a local path
/plugin enable|disable <name>Enable or disable an installed plugin without uninstalling it
/plugin-sdk initScaffold a new plugin with the recommended directory structure and manifest
Example: /plugin-sdk init my-plugin
/plugin-sdk buildBuild the plugin in the current directory and verify the manifest
/plugin-sdk testRun the plugin test suite against the Anvil plugin API sandbox
/plugin-sdk publishPublish the plugin to AnvilHub — requires authentication
Remote Control
Live bidirectional terminal-to-browser bridge. Type /remote-control to generate a URL and pairing code. Open it on any device — phone, tablet, another machine — and you have a full web interface to your live session with real-time streaming, 98 commands, and secure pairing.
/remote-controlStart a remote control session — generates URL + 6-digit pairing code, opens browser automatically
Example: /remote-control → generates URL + 6-digit code
/remote-control statusCheck remote control connection status and client count
/remote-control stopEnd the remote control session and disconnect all viewers
Advanced & Automation
The advanced commands cover scaffolding, profiling, debugging, log analysis, monorepo support, and more. `/scaffold` generates a complete project skeleton for Rust, Node, Python, React, Next.js, Go, or Docker — including CI config, Dockerfile, and test setup. The `/mono` commands are designed for monorepo workflows: list workspaces, graph dependencies, detect which packages changed since a base ref, and run commands scoped to affected packages only.
/scaffold new <template>Generate a full project skeleton from a template (rust / node / python / react / nextjs / go / docker)
Example: /scaffold new nextjs my-app
/perf profile|benchmark|flamegraphProfile a running process, run microbenchmarks, or generate a flamegraph SVG
Example: /perf flamegraph --bin my-server
/debug start|breakpoint|watch|explainDebugging assistant: set breakpoints, watch variables, and get AI explanations of crashes
/logs tail|search|analyze|statsLog analysis: tail live logs, search by pattern, get AI anomaly detection, view stats
Example: /logs analyze --file /var/log/app.log
/regex build|test|explainRegex builder: describe what you need in plain English, test against samples, explain existing patterns
Example: /regex build 'match ISO 8601 datetimes'
/migrate framework|language|depsGuided codebase migration assistant for framework upgrades, language ports, and dependency updates
Example: /migrate framework react-17-to-18
/snippets save|list|get|searchPersonal code snippet library — save, tag, retrieve, and search reusable code blocks
Example: /snippets save db-pagination
/deps tree|outdated|audit|whyDependency management: visualize the dep tree, find outdated packages, audit CVEs, explain why a dep is included
/mono list|graph|changed|runMonorepo workspace tools: list packages, graph dependencies, find changed packages, run scoped commands
Example: /mono changed --since main
/notebook run|cell|exportJupyter notebook support: run notebooks, execute individual cells, export to script
Example: /notebook run analysis.ipynb
/lsp start|symbols|referencesLanguage server integration: start an LSP, query symbols, find all references
Example: /lsp references src/auth.ts:42
/markdown preview|toc|lintMarkdown tools: preview rendered output, generate table of contents, lint for broken links
/env show|set|load|diffEnvironment variable management: inspect current env, set values, load from .env files, diff environments
Example: /env diff .env .env.production
/changelogAuto-generate a formatted changelog from git history using conventional commit parsing
/finetune prepare|validate|start|statusAI model fine-tuning pipeline: prepare training data, validate format, submit a fine-tuning job, check status
/webhook list|add|test|removeWebhook endpoint management: register, test with sample payloads, and remove endpoints
/browser open|screenshot|testBrowser automation: open a URL in a headless browser, take screenshots, run interaction tests
Example: /browser screenshot https://example.com
/theme set|create|import|exportTheme customization: switch between 8 built-in themes, create custom themes, import/export theme files
Example: /theme set monokai
Something missing?
Check the changelog for the latest additions, or browse AnvilHub for community extensions that add new commands.