Skip to content

Command Reference

This page lists every context command, generated from the same registry that powers context help.

Show branch context for the current repository

context git [options]

Print branch context for the current git repository: repository root, branch/base header, HEAD, ahead/behind state, pull request summary for feature branches, working-tree status, branch work-scope, recent commits, and optional full diffs. Designed as a single command for agents to get full working-tree and branch context, and as the shared producer for the git_context MCP tool.

Modes

(default) Context summary: repo, branch, PR, status, branch files, commits
--json Emit the structured branch-context payload
--diff Also print full unstaged and staged diffs
--branch-diff Also print the full diff vs the default branch
--remotes Also include remote fetch/push URLs
--since <date> Show recent commits since a date instead of the default window

Options

OptionDescription
--jsonEmit the structured plugin payload instead of text
--commentsInclude pull request conversation comments
--reviewsInclude individual pull request reviews
--labelsInclude pull request labels
--checksInclude CI check runs (makes a second gh call)
--no-descriptionOmit the pull request description
--no-prOmit the pull request block entirely
--remotesInclude remote fetch/push URLs in branch metadata
--no-branch-metadataOmit the branch metadata block
--no-statusOmit the working-tree status block
--no-work-scopeOmit the branch work-scope block
--diffAppend full unstaged and staged diffs for changed files
--branch-diffAppend the merge-base diff vs the default branch
--since <date>Show recent commits since this date or relative duration

Examples

Terminal window
context git
context git --comments --reviews
context git --labels --checks
context git --remotes
context git --diff
context git --branch-diff
context git --json
context git --since "2 days ago"

Detect the tech stack of a directory for agents

context stack [dir] [options]

Detect a directory’s tech stack deterministically from Git-listed files, with no LLM and no external tools: languages, package ecosystems, tooling, and frameworks. Designed as a single command for agents to learn a project’s stack, and as the shared producer for the stack_context MCP tool.

Modes

(default) Stack summary: languages, ecosystems, tooling, frameworks
--json Emit the structured stack-context payload
--plain Disable ANSI styling in text output

Options

OptionDescription
--jsonEmit the structured plugin payload instead of text
--plainDisable ANSI styling in text output

Arguments

ArgumentDescription
<dir>Directory to scan (default: current working directory)

Examples

Terminal window
context stack
context stack --plain
context stack --json
context stack ~/projects/app

Run OpenCode debug commands

context opencode-debug [options]

Run OpenCode debug paths, config, skill, and info, returning one combined report. Optionally inspect a named agent.

Options

OptionDescription
--agent <name>Also run opencode debug agent

Examples

Terminal window
context opencode-debug
context opencode-debug --agent reviewer

Run the context MCP server over stdio

context mcp

Start a Model Context Protocol server exposing git_context, stack_context, command_help, and opencode_debug tools plus read-only context resources.

Examples

Terminal window
context mcp

Generate shell completions

context completions [bash|fish|zsh]

Generate shell completions for context.

Arguments

ArgumentDescription
<shell>One of: bash, fish, zsh.

Examples

Terminal window
context completions zsh
context completions bash
context completions fish

Show context help

context help [command]

Arguments

ArgumentDescription
<command>Optional command to show help for. One of: git, stack, opencode-debug, mcp, completions.

Examples

Terminal window
context help
context help git