Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Commands

Complete CLI reference for wai.

Wai provides a comprehensive set of commands for managing projects, artifacts, phases, and agent configurations.

Tip: Run wai --help for a quick overview, or wai <command> --help for detailed help on any command.

Global Flags

Available for all commands:

FlagDescription
-v, --verboseIncrease verbosity (-v, -vv, -vvv)
-q, --quietSuppress non-error output
--jsonOutput machine-readable JSON
--no-inputDisable interactive prompts
--yesAuto-confirm actions with defaults
--safeRun in read-only safe mode (blocks write operations)

Safe mode

--safe prevents all write operations. Commands that modify state — add, sync, move, pipeline start/next/init/approve/lock, phase next/back/set, and import — will exit with an error. Read-only commands like status, search, doctor, pipeline verify, and pipeline current work normally.


Workspace & Initialization

Commands for managing the wai workspace and checking repo hygiene.

CommandDescription
wai init [--name <name>]Initialize wai in current directory
wai tutorialRun interactive quickstart tutorial
wai ls [--root <dir>] [--depth <n>] [--timeout <sec>]List all wai workspaces under a root directory
wai doctor [--fix]Diagnose and repair wai workspace health (see checks)
wai way [--fix <CHECK>]Check and scaffold repository best practices
wai import <path>Import existing tool configs (.claude/, .cursorrules)

Choosing the Right Tool

  • Use wai doctor when your .wai/ directory is missing, a project phase is stuck, or a sync command is failing.
  • Use wai way when you want to improve your overall repository for AI friendliness (e.g., adding CLAUDE.md, .editorconfig, or SKILL.md files).

Projects & Artifacts

Manage PARA items (Projects, Areas, Resources, Archives) and their associated artifacts.

Items & Phases

CommandDescription
wai new project <name>Create a new project (also new area, new resource)
wai move <item> <category>Move an item between PARA categories
wai status [--json]Check project status and suggest next steps
wai show [<name>]Show PARA overview or details for a specific item
wai phase [show|next|back|set]Show or change the current project phase

Available phases: research, design, plan, implement, review, archive

Adding Artifacts

CommandDescription
wai add research <content>Add research notes (also plan, design)
wai add review <content>Add a review artifact for an existing artifact
wai add <type> --file <path>Import artifact from file
wai add <type> --tags <tags>Add tagged artifact (frontmatter-based)
wai add <type> --bead <id>Link artifact to a beads issue ID
wai add <type> --project <name>Add to specific project (instead of current)
wai add <type> --corrects <path>Create an addendum correcting a locked artifact

Choosing an Artifact Type

Wai encourages capturing the right kind of documentation at each stage:

  • Research (wai add research) — Use for gathering information, exploring problem spaces, and evaluating options.
    • Example: “Evaluated two DB engines; chose PostgreSQL for its JSONB support.”
  • Design (wai add design) — Use for making architectural decisions and defining system structure.
    • Example: “Proposed microservices architecture with EventBridge for communication.”
  • Plan (wai add plan) — Use for breaking down implementation into specific, actionable steps.
    • Example: “Step 1: Scaffold auth service. Step 2: Implement JWT middleware.”
  • Review (wai add review) — Use for recording validation results against an existing artifact.
    • Example: wai add review --reviews 2026-04-15-findings.md --verdict pass --severity "critical:0,high:1"
    • Requires --reviews <filename> to specify the target artifact.
    • Optional: --verdict (pass/fail/needs-work), --severity (level:count pairs), --produced_by (skill name).

Searching & Timeline

CommandDescription
wai search <query>Search across all artifacts
wai search --type <type>Filter by type (research/plan/design/handoff)
wai search --in <project>Search within specific project
wai search --tag <tag>Filter by tag (repeatable)
wai search --regexUse regex patterns for query
wai search --latestReturn only the most recently dated match
wai search -C <n>Show N lines of context around each match
wai search --include-memoriesInclude bd memories in search results
wai timeline <project>View chronological project timeline
wai timeline --from <date>Filter by date range (YYYY-MM-DD)

Agent Configuration

Manage how AI agents interact with your project through skills, rules, and context.

CommandDescription
wai syncOverwrite agent configs to tool-specific locations
wai sync --statusCheck sync status without modifying files
wai sync --from-mainSync resources from main git worktree
wai config listList all agent config files
wai config add <type> <file>Add agent config (skill/rule/context)
wai config edit <path>Safe: Edit config file in $EDITOR
wai resource list skillsList all available skills
wai add skill <name> [--template <tpl>]Scaffold a new skill (templates: gather, create, tdd, rule-of-5, ubiquitous-language)
wai resource install <skill> [--global|--from-repo <path>]Install a skill globally or from another repo
wai resource export <skills...> --output <file>Export skills to a tar.gz archive
wai resource import skills [--from <dir>]Import skills from a directory
wai resource import archive <file> [--yes]Import skills from a tar.gz archive

⚠️ WARNING: wai sync is destructive to your target files. It will overwrite manual changes in .cursorrules, .claude/config.json, etc., with the sources from your .wai/ directory.


AI-Driven Workflows

Advanced reasoning, session management, and automated pipelines.

Reasoning & Reflection

CommandDescription
wai why <query>Ask why a decision was made (LLM-powered)
wai why <file-path>Explain a file’s history and rationale
wai reflectSynthesize session context into a resource file
wai reflect --save-memoriesSave reflection bullets to bd memories

Session Management

CommandDescription
wai prime [--project <name>]Orient at session start: phase, last handoff, next step
wai close [--project <name>]Wrap up session: create handoff and next steps
wai handoff create <project>Generate handoff document with plugin context

Pipelines

CommandDescription
wai pipeline listList all available pipelines
wai pipeline show <name>View steps and gates for a pipeline
wai pipeline init <name>Scaffold a new TOML pipeline definition
wai pipeline start <name> --topic="..."Start a run with topic substitution
wai pipeline nextAdvance to the next step in the active run
wai pipeline currentReprint current step prompt (session recovery)
wai pipeline status <name>Show run status (use --run <id> for details)
wai pipeline suggest [description]Rank pipelines by keyword match
wai pipeline gates [name] [--step=<id>]Show gate requirements and live status
wai pipeline check [--oracle=<name>]Dry-run gate evaluation without advancing
wai pipeline approveRecord human approval for current step
wai pipeline validate [name]Validate pipeline TOML definitions
wai pipeline lockLock current step’s artifacts (SHA-256 hash sidecars)
wai pipeline verifyVerify integrity of all locked artifacts

Plugins

CommandDescription
wai plugin listList all plugins (built-in and custom)
wai plugin enable <name>Enable a plugin
wai <plugin> <command>Pass-through to plugin commands (e.g. wai beads list)

Doctor Checks

wai doctor runs the following checks. Use --fix to auto-repair where possible.

CheckWhat it verifies
Directory structureRequired .wai/ subdirectories exist
Configuration.wai/config.toml is parseable and valid
VersionConfig version is compatible with installed wai
Plugin toolsExternal tools (git, beads, openspec) are installed and reachable
Agent config syncProjections are in sync between source and target files
Project statePhase state files are valid and consistent
Custom pluginsTOML plugin definitions parse correctly
README badgeRepository README includes a wai badge
Claude Code session hookClaude Code hooks are configured for wai
Skills in repoSkill files are valid and importable
Agent tool coverageAgent instructions reference available skills
Agent instructionsCLAUDE.md / AGENTS.md files are present and well-formed
Managed block stalenessAuto-generated sections are up to date
Pipeline definitionsPipeline TOML files parse correctly with valid gates
WAI_PROJECT env varEnvironment variable matches active project
Artifact locksLocked artifacts match their SHA-256 hashes

Examples

Basic Workflow

# Initialize and create project
wai init
wai new project my-feature

# Add artifacts
wai add research "Evaluated options A and B, chose A for performance"
wai phase next
wai add design "Architecture uses microservices pattern"

Search and Timeline

# Search with filters
wai search "authentication" --type research
wai search "api.*error" --regex -n 10

# View project history
wai timeline my-feature
wai timeline my-feature --from 2026-02-01 --to 2026-02-15

JSON Output for Automation

# Get structured data
wai status --json | jq '.projects[] | .name'
wai search "config" --json | jq '.results[].path'
wai plugin list --json
wai way --json | jq '.summary.pass'