v2.2.19

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.

$ curl -fsSL https://anvilhub.culpur.net/install.sh | sh# or: brew tap culpur/anvil && brew install anvil

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 anvil

Install via Homebrew (macOS)

curl -fsSL https://anvilhub.culpur.net/install.sh | sh

Install via shell script (Linux / macOS)

anvil --update

Self-update to the latest release without reinstalling

anvil

Start the interactive REPL in the current directory

/login

Authenticate 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.

/help

Show all available commands with short descriptions

/status

Show current session status: active model, token usage, and provider

/model <name>

Switch AI model mid-session without losing conversation history

Example: /model gpt-4o

/cost

Display token costs accumulated in the current session

/clear

Clear conversation history and start fresh in the same session

/focus

Toggle focus view — show only prompts, tool summaries, and responses (Ctrl+O)

/fork

Branch the conversation — create, list, or switch between branches

Example: /fork experiment | /fork list | /fork switch 1

/compact

Compress conversation history to a summary to free context window space

/version

Show 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-search

AST-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

/diff

Show 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 run

Run the project test suite — auto-detects Cargo, npm, pytest, and go test

/test coverage

Generate 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 staged

Review all staged git changes before committing — catches issues early

/review pr

Review the full diff of the current pull request against its base branch

/docs generate

Auto-generate project documentation based on source code analysis

/docs readme

Generate or update README.md with project overview, usage, and API docs

/docs architecture

Generate an architecture overview with Mermaid diagrams

/docs changelog

Generate 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.

/commit

Generate an AI commit message from the staged diff and open it for review

/commit-push-pr

Commit with an AI message, push to origin, and open a draft pull request

/pr

Create a GitHub pull request with an AI-generated title and description

/issue

Create a GitHub issue with AI-assisted title, body, and label suggestions

/git rebase

Interactive rebase assistant — resolves conflicts with AI explanations

/git conflicts

Detect 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 stash

Stash 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|build

Container management: list containers, stream logs, run Compose, build images

Example: /docker logs my-api-container

/k8s pods|logs|apply|describe

Kubernetes cluster management: inspect workloads, stream logs, apply manifests

Example: /k8s pods --namespace production

/iac plan|apply|validate|drift

Terraform/OpenTofu IaC management with AI-generated plan summaries

Example: /iac drift

/pipeline generate|lint|run

CI/CD pipeline builder: generates GitHub Actions, GitLab CI, or Jenkinsfile

Example: /pipeline generate --provider github-actions

/ssh list|connect|tunnel|keys

SSH 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 scan

Scan the project for vulnerability patterns — SQL injection, XSS, path traversal, and more

/security secrets

Detect hardcoded credentials, API keys, and tokens in source files

/security deps

Audit project dependencies against the CVE database and advisory feeds

/security report

Generate a comprehensive security report combining scan, secrets, and dep audit results

/vault setup

Initialize an encrypted credential vault (AES-256-GCM + Argon2id key derivation)

/vault unlock

Unlock 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 connect

Connect to a database (PostgreSQL, MySQL, SQLite, MongoDB) using a connection string

Example: /db connect postgresql://localhost/myapp

/db schema

Inspect and visualize the database schema with table relationships

/db query

Run a SQL query with AI-assisted query building and result explanation

/db migrate

Generate and apply database migrations with dry-run preview

/api spec

Generate an OpenAPI 3.1 spec from route definitions in your source code

/api mock

Start a mock server from an OpenAPI spec, returning realistic fake data

/api test

Run API endpoint tests against a live or mock server

/api docs

Generate 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.

/memory

View, search, and manage persistent memory entries stored in the QMD knowledge base

/memory layer 1

Live snapshot of the working-memory inventory — kind, size, and preview for every section in injection order

/memory show episodic|procedural|cache

Enumerate 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 episodic

TTL-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-run

Walk 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

/init

Initialize Anvil in the current project — creates anvil.toml with recommended defaults

/config

View or edit the Anvil configuration file directly

/configure

Open the interactive configuration menu for providers, models, and preferences — includes a Language Picker submenu with all 18 locales rendered in their native script

/context

Inspect 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.

/hub

Open 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 list

List 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 init

Scaffold a new plugin with the recommended directory structure and manifest

Example: /plugin-sdk init my-plugin

/plugin-sdk build

Build the plugin in the current directory and verify the manifest

/plugin-sdk test

Run the plugin test suite against the Anvil plugin API sandbox

/plugin-sdk publish

Publish 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-control

Start a remote control session — generates URL + 6-digit pairing code, opens browser automatically

Example: /remote-control → generates URL + 6-digit code

/remote-control status

Check remote control connection status and client count

/remote-control stop

End 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|flamegraph

Profile a running process, run microbenchmarks, or generate a flamegraph SVG

Example: /perf flamegraph --bin my-server

/debug start|breakpoint|watch|explain

Debugging assistant: set breakpoints, watch variables, and get AI explanations of crashes

/logs tail|search|analyze|stats

Log analysis: tail live logs, search by pattern, get AI anomaly detection, view stats

Example: /logs analyze --file /var/log/app.log

/regex build|test|explain

Regex builder: describe what you need in plain English, test against samples, explain existing patterns

Example: /regex build 'match ISO 8601 datetimes'

/migrate framework|language|deps

Guided codebase migration assistant for framework upgrades, language ports, and dependency updates

Example: /migrate framework react-17-to-18

/snippets save|list|get|search

Personal code snippet library — save, tag, retrieve, and search reusable code blocks

Example: /snippets save db-pagination

/deps tree|outdated|audit|why

Dependency management: visualize the dep tree, find outdated packages, audit CVEs, explain why a dep is included

/mono list|graph|changed|run

Monorepo workspace tools: list packages, graph dependencies, find changed packages, run scoped commands

Example: /mono changed --since main

/notebook run|cell|export

Jupyter notebook support: run notebooks, execute individual cells, export to script

Example: /notebook run analysis.ipynb

/lsp start|symbols|references

Language server integration: start an LSP, query symbols, find all references

Example: /lsp references src/auth.ts:42

/markdown preview|toc|lint

Markdown tools: preview rendered output, generate table of contents, lint for broken links

/env show|set|load|diff

Environment variable management: inspect current env, set values, load from .env files, diff environments

Example: /env diff .env .env.production

/changelog

Auto-generate a formatted changelog from git history using conventional commit parsing

/finetune prepare|validate|start|status

AI model fine-tuning pipeline: prepare training data, validate format, submit a fine-tuning job, check status

/webhook list|add|test|remove

Webhook endpoint management: register, test with sample payloads, and remove endpoints

/browser open|screenshot|test

Browser automation: open a URL in a headless browser, take screenshots, run interaction tests

Example: /browser screenshot https://example.com

/theme set|create|import|export

Theme 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.