The Teamwork CLI (teamwork) provides human oversight and control over agent workflows. It is the primary interface for developers to initialize, monitor, approve, and manage the lifecycle of agent-driven tasks.
The easiest way to get started is via the gh CLI extension:
gh extension install JoshLuedeman/gh-teamwork
gh teamwork initSee gh-teamwork Extension below for extension commands.
# Build the image
make docker-build
# Run any command
docker run --rm -v "$(pwd):/project" teamwork status
# Or use the Makefile shortcut
make docker-run CMD="status"Set up a shell alias for convenience:
alias teamwork='docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/project" teamwork'Requires Go 1.22+.
make build-cli # builds to bin/teamwork
make install-cli # installs to GOPATH/bin
# Or directly
go install github.com/JoshLuedeman/teamwork/cmd/teamwork@latestInitialize a complete Teamwork project: fetch framework files and create config.
teamwork init [flags]Sets up a complete Teamwork project in two steps:
- Fetches framework files (agents, skills, docs, instructions, templates) from the upstream Teamwork repository.
- Creates the
.teamwork/directory with config, memory seeds, and subdirectories.
If framework files are already installed, the fetch step is skipped and only the config is created. Use --force to re-fetch framework files.
Flags:
--source— Source repository inowner/repoformat (default:joshluedeman/teamwork)--ref— Git ref to install from (branch, tag, or SHA; default:main)--force— Re-fetch framework files even if already installed--preset— Use a preset config for a specific stack (e.g.,go-api,ts-react)--non-interactive— Skip the interactive wizard
Example:
# Full setup from the official Teamwork template
teamwork init
# Use a custom fork as the source
teamwork init --source myorg/teamwork-template
# Install from a specific version
teamwork init --ref v1.2.0
# Re-fetch framework files (overwrite existing)
teamwork init --force
# Use a preset for a Go API project
teamwork init --preset go-apiDeprecated: Use
teamwork initinstead — it now fetches framework files and creates config in one step.
The install command still works but delegates to init internally.
Update Teamwork framework files to the latest version.
teamwork update [flags]Fetches the latest framework files from the upstream Teamwork repository and applies changes. Files that have been modified locally are skipped with a warning unless --force is set.
Flags:
--source— Source repository inowner/repoformat (default:joshluedeman/teamwork)--ref— Git ref to update to (branch, tag, or SHA; default:main)--force— Overwrite user-modified files without warning--check— Check for drift between local files and upstream without writing any changes (exits 1 if drift detected)--create-issue— Create a GitHub issue assigned to Copilot when placeholders are detected after update (default:true)
Example:
# Update to the latest version
teamwork update
# Update from a custom source
teamwork update --source myorg/teamwork-template
# Update to a specific version
teamwork update --ref v1.2.0
# Force update, overwriting local changes
teamwork update --force
# Check for drift without making changes (useful in CI)
teamwork update --checkValidate the .teamwork/ directory structure and contents.
teamwork validate [flags]Checks that configuration, state files, handoff documents, and memory files are well-formed and contain required fields.
Flags:
--json— Output results as a JSON array--quiet— Suppress passing checks (only show failures)
Exit codes:
0— All checks passed1— One or more checks failed2— Cannot run validation (e.g.,.teamwork/directory not found)
Example:
# Human-readable output
teamwork validate
# JSON output for CI pipelines
teamwork validate --json
# Only show failures
teamwork validate --quietStart a new workflow.
teamwork start <type> <goal> [flags]Arguments:
type— Workflow type:feature,bugfix,refactor,hotfix,security-response,dependency-update,documentation,spike,release, orrollbackgoal— Description of what the workflow should accomplish
Flags:
--issue <number>(or-i) — Link the workflow to a GitHub issue
Example:
teamwork start feature "Add user authentication" --issue 42Show the status of all active workflows.
teamwork statusDisplays each active workflow with its current phase, pending actions, and overall progress.
Show pending actions that need human attention.
teamwork nextLists quality gates awaiting approval, blocked workflows, and other items requiring human input.
Approve a quality gate to advance a workflow.
teamwork approve <id>Arguments:
id— The workflow identifier (e.g.,feature/42-add-user-authentication)
Block a workflow with a reason.
teamwork block <id> --reason <text>Arguments:
id— The workflow identifier
Flags:
--reason <text>— Explanation for why the workflow is blocked (required)
Mark a workflow as complete.
teamwork complete <id>Arguments:
id— The workflow identifier
Cancel an active or blocked workflow.
teamwork cancel <id> [--reason <text>]Arguments:
id— The workflow identifier
Flags:
--reason <text>(or-r) — Explanation for the cancellation (optional)
Cancellation sets the workflow to terminal cancelled status. It refuses to operate on already-terminal workflows (completed, cancelled, failed). State files are preserved for audit trail.
Mark a workflow as failed.
teamwork fail <id> --reason <text>Arguments:
id— The workflow identifier
Flags:
--reason <text>(or-r) — Explanation for the failure (required)
Failure sets the workflow to terminal failed status. It refuses to operate on already-terminal workflows. The reason is recorded in the state file and logged as a metrics event.
Show the full history of a workflow.
teamwork history <id>Arguments:
id— The workflow identifier
Displays all state transitions, approvals, blocks, and agent actions for the workflow.
Open the interactive TUI dashboard.
teamwork dashboardProvides a terminal-based interface for monitoring and managing all workflows in real time.
Check environment and project health.
teamwork doctorRuns diagnostic checks on the development environment and project configuration, reporting issues with actionable fixes.
Checks performed:
.teamwork/directory exists with expected subdirectoriesconfig.yamlis valid (reusesteamwork validatelogic)- Git is installed and configured (user.name, user.email)
- AI CLI tools available (Claude, GitHub Copilot CLI)
- GitHub CLI installed and authenticated
GH_TOKENenvironment variable set- Go toolchain available
Output format:
[✓] .teamwork/ directory initialized
[✓] config.yaml valid
[✓] Git configured (user: Josh)
[✗] Claude CLI not found — install: npm install -g @anthropic-ai/claude-code
[✓] GitHub CLI authenticated
[!] GH_TOKEN not set — required for private repos
Exit codes:
0— All checks passed (warnings are OK)1— One or more checks failed
Run a secrets scan on the project.
teamwork scanScans the project directory for secrets using gitleaks, detect-secrets, or trufflehog (whichever is available). Exits 0 if the project is clean; exits 1 if secrets are found.
Show a visual timeline of workflow steps.
teamwork timeline <workflow-id> [flags]Displays an ASCII table of workflow steps with status, duration, and handoff information.
Arguments:
id— The workflow identifier
Flags:
--mermaid— Emit a Mermaid Gantt diagram instead of an ASCII table
Example:
teamwork timeline feature/42-auth
teamwork timeline feature/42-auth --mermaidResume a workflow from a saved checkpoint.
teamwork resume <workflow-id> [flags]Loads and displays a saved checkpoint for the given workflow, showing where work was interrupted so an agent can pick up without losing context.
Arguments:
id— The workflow identifier
Flags:
--clear— Delete the checkpoint without resuming
Example:
teamwork resume feature/42-auth
teamwork resume feature/42-auth --clearGenerate an exportable workflow report.
teamwork report <workflow-id> [flags]Builds a consolidated report including steps, handoffs, gate results, and cost estimates.
Arguments:
id— The workflow identifier
Flags:
--format— Output format:md(default),json, orhtml
Example:
teamwork report feature/42-auth
teamwork report feature/42-auth --format json
teamwork report feature/42-auth --format html > report.htmlSearch memory, handoffs, ADRs, and state for matching content.
teamwork search <query> [flags]Searches across all .teamwork/ artifacts for the given query string. Multi-word queries can be written without quotes.
Arguments:
query— Search query (multi-word queries without quotes are joined automatically)
Flags:
--domain— Filter memory results by domain tag--type— Filter by artifact type:memory,handoff,adr, orstate
Example:
teamwork search authentication
teamwork search "rate limiting" --type adr
teamwork search auth --domain securityAssemble distilled agent context for a workflow step.
teamwork context <workflow-id> [flags]Gathers state, handoff, memory, and metrics data for the given workflow step and emits it as a compact context block suitable for pasting into an agent session.
Arguments:
id— The workflow identifier
Flags:
--step— Step number to assemble context for (default: current step)
Example:
teamwork context feature/42-auth
teamwork context feature/42-auth --step 3Manage structured project memory.
teamwork memory <subcommand> [flags]Add a new memory entry.
teamwork memory add --category <cat> --domain <domains> --content <text> [flags]Flags:
--category— Category:patterns,antipatterns,decisions,feedback(required)--domain— Comma-separated domain tags (required)--content— Memory content (required)--source— Where this was learned (e.g.,PR #42)--context— Additional context
Example:
teamwork memory add \
--category patterns \
--domain auth,api \
--content "Use middleware for auth checks" \
--source "PR #42 review"Search memory entries by domain.
teamwork memory search <domain>Example:
teamwork memory search authList all memory entries, optionally filtered by category.
teamwork memory list [--category <cat>]Sync memory entries to a spoke repository by domain.
teamwork memory sync --repo <name> --domain <domains>Copies entries matching the specified domains from the hub repo's memory to the target spoke repo. Requires repos to be configured in .teamwork/config.yaml.
Example:
teamwork memory sync --repo api --domain auth,apiView workflow metrics and reports.
teamwork metrics <subcommand>Show per-workflow metric summaries including steps, duration, failures, escalations, defects, and cost estimates.
teamwork metrics summaryShow per-role aggregate statistics across all workflows.
teamwork metrics rolesShow a per-agent performance scorecard including gate pass rate, escalation rate, and cost.
teamwork metrics agents [flags]Flags:
--since— Filter events after this duration ago (e.g.24h,7d)--format— Output format:json
Manage handoff artifacts between workflow roles.
teamwork handoff <subcommand>Generate a role-specific handoff template for the current step of a workflow.
teamwork handoff init <workflow-id>Creates a template handoff document at .teamwork/handoffs/<id>/step-N-<role>.md pre-filled with the role's expected outputs and acceptance criteria.
Arguments:
id— The workflow identifier
Example:
teamwork handoff init feature/42-authManage structured reviewer feedback entries.
teamwork feedback <subcommand>List feedback entries, optionally filtered by domain or status.
teamwork feedback list [flags]Flags:
--domain— Filter by domain tag--status— Filter by status:openorresolved
Mark a feedback entry as resolved.
teamwork feedback resolve <feedback-id>View aggregate workflow analytics.
teamwork analytics <subcommand>Show aggregate workflow summary statistics across all workflows.
teamwork analytics summary [flags]Flags:
--since— Only include workflows created after this duration ago (e.g.24h,7d)--type— Filter by workflow type--format— Output format:json
Example:
teamwork analytics summary
teamwork analytics summary --since 7d --type feature
teamwork analytics summary --format jsonList configured repositories and their status.
teamwork reposShows each configured spoke repository with its name, GitHub slug, local path, and status (clean, dirty, not found).
The gh-teamwork extension provides gh CLI aliases for common Teamwork commands. Install it with:
gh extension install JoshLuedeman/gh-teamwork| Command | Equivalent | Description |
|---|---|---|
gh teamwork init |
teamwork init |
Initialize .teamwork/ directory structure |
gh teamwork update |
teamwork update |
Update Teamwork framework files to latest version |
All other Teamwork commands are available via the teamwork CLI directly (see Installation to install the binary).
A typical workflow session:
# Initialize in a new project
teamwork init
# Start a feature workflow
teamwork start feature "Add user authentication" --issue 42
# Check what needs to happen next
teamwork next
# After an agent completes a step, check status
teamwork status
# Approve the work and advance
teamwork approve feature/42-add-user-authentication
# View the full history
teamwork history feature/42-add-user-authentication
# Open the interactive dashboard
teamwork dashboardThe CLI reads configuration from .teamwork/config.yaml in the project root. See docs/protocols.md for details on the protocol file format and coordination model.
The CLI reads and writes .teamwork/ protocol files to manage workflow state. It does not invoke AI tools directly — that is the orchestrator agent's responsibility. The CLI provides human visibility and control over the workflow lifecycle, acting as the interface between developers and the agent coordination layer.