Skip to main content

AI-powered research, planning, and task management CLI tool

Project description

Shotgun logo transparent background

Spec-Driven Development

Write codebase-aware specs for AI coding agents (Codex, Cursor, Claude Code) so they don't derail.

Website Follow @ShotgunCLI YouTube


AI agents are great at small tasks but derail on big features. They forget context, rebuild things that already exist, and go off-spec halfway through.

Shotgun fixes this. It reads your entire codebase, plans the full feature upfront, then splits it into staged PRs—each with file-by-file instructions your AI agent can actually follow.

Instead of one 10k-line monster PR nobody will review, you get 5 focused PRs that ship.

Works great with Cursor, Claude Code, Antigravity, or Codex. BYOK or use Shotgun credits ($10 = $10 in usage).


📦 Installation

Select your operating system below and click to view installation instructions:

► MacOS Install Instructions (click to expand)

Step 1: Install uv

# Using Homebrew
brew install uv

# Or using curl
curl -LsSf https://astral.sh/uv/install.sh | sh

Step 2: Run Shotgun

uvx shotgun-sh@latest

► Linux Install Instructions (click to expand)

Step 1: Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Step 2: Run Shotgun

uvx shotgun-sh@latest

► Windows Install Instructions (click to expand)

Open PowerShell and run these commands:

# Set execution policy (one-time)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

# Install uv
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# Add to PATH (or restart terminal)
$env:Path = "C:\Users\$env:USERNAME\.local\bin;$env:Path"

# OPTIONAL: Enable code indexing (run as Administrator)
Import-Module BitsTransfer
Start-BitsTransfer -Source "https://aka.ms/vs/17/release/vc_redist.x64.exe" -Destination "$env:TEMP\vc_redist.x64.exe"
Start-Process -FilePath "$env:TEMP\vc_redist.x64.exe" -ArgumentList "/install", "/quiet", "/norestart" -Wait

# Run Shotgun
uvx --python 3.12 shotgun-sh@latest
Supported Not Supported
Windows x64 (regular PCs) 32-bit Python
Python 3.11-3.13 Python 3.14+ (no wheels yet)

Important: Run in PowerShell, not Command Prompt or VS Developer shells.

💡 Restart your terminal after installation

Why uv? It's 10-100x faster than pip and handles binary wheels reliably—no cmake/build tool errors.

Need help? View uv installation docs

3. Get Started

When you launch Shotgun, it will guide you through:

Step What Happens
1. Codebase Indexing Builds a searchable graph of your entire repository
2. LLM Setup Configure OpenAI, Anthropic, or Gemini
3. First Research Start generating codebase-aware specs

💡 Pro tip: Run Shotgun in your IDE's terminal for the best experience.


🎥 Demo

Watch the Shotgun demo

Click the image above to watch the full demo on YouTube


🎯 Usage

Launch Shotgun in your project directory:

See install instructions for your platform first!

uvx shotgun-sh@latest

Planning vs Drafting

Mode How It Works When to Use It
Planning (default) Shotgun proposes an execution plan, shows each step, and asks for confirmation before running agents that change files. You get checkpoints, can refine the plan, and can confirm or skip cascaded updates when one change affects other docs. When you want control, visibility, and the ability to refine the plan before execution.
Drafting Shotgun runs the full plan in one go, without intermediate confirmations. Progress is still tracked internally, but you won’t be prompted at each step. When you’re confident in the plan and want fast, end-to-end execution.

The TUI opens automatically. Press Shift+Tab to switch between Planning & Drafting or / for the command palette.

How the Router Works Internally

Under the hood, the Router relies on specialized sub-agents. You don’t select or manage them manually.

🔬 Research
Explore & understand
📝 Specify
Define requirements
📋 Plan
Create roadmap
✅ Tasks
Break into steps
📤 Export
Format for AI

Planning and Drafting are the only execution modes you control; everything else is handled by the Router.

Mode switching: Shift+Tab cycles through modes

⌨️ Keyboard Shortcuts

Shortcut Action
Shift+Tab Switch modes
/ Open command palette
Ctrl+C Cancel operation (or copy if text selected)
Escape Exit Q&A / stop agent
Ctrl+U View usage stats

Tips for Better Results

Do This Not This
Research how we handle auth ❌ Jump straight to building
Shotgun please ask me questions first ❌ Assume Shotgun knows your needs
I'm working on payments, need refunds Add refunds (no context)
✅ Start in Planning mode, let Shotgun propose and refine a plan with you, then run it ❌ Blast everything in one go without reviewing the plan first (unless you intentionally switch to Drafting mode)

Result: Your AI coding agent gets complete context—what exists, why, and what to build.

Note: CLI available in docs/CLI.md, but TUI is recommended.

Context7 Documentation Lookup (Experimental)

The Research agent can fetch up-to-date library documentation via Context7. When configured, the agent will prefer Context7 over web search for documentation lookups.

To enable it, set your Context7 API key:

shotgun config set-context7 --api-key <your-context7-api-key>

To remove it:

shotgun config clear-context7

🤝 Share Specs with Your Team

Sharing specs to a workspace is available on paid Shotgun plans.

Shotgun lets you share specs externally by publishing them to a workspace. This creates a versioned, shareable snapshot your team can access outside the repo.

How to Share a Spec

  1. Hit / → select Share specs to workspace
  2. Choose one option:
  • Create new spec — publish a fresh spec from your current .shotgun/ files
  • Add new version — publish an updated version of an existing spec
  1. Wait for upload to complete. When finished, you can:
  • Open in Browser — view the shared spec in the workspace
  • Copy URL — share the link with your team
  • Done — return to Shotgun
image

Your local .shotgun/*.md files remain unchanged.
The workspace contains a shareable, versioned snapshot of the spec.


✨ Features

What Makes Shotgun Different

Feature Shotgun Other Tools
Codebase Understanding Reads your entire repository before generating specs. Finds existing patterns, dependencies, and architecture. Require manual context or search each time. No persistent understanding of your codebase structure.
Research Phase Starts with research—discovers what you already have AND what exists externally before writing anything. Start at specification. Build first, discover problems later.
Dedicated Agents Per Mode Each mode (research, spec, plan, tasks, export) uses a separate specialized agent with prompts tailored specifically for that phase. 100% user-controllable via mode switching. Single-agent or one-size-fits-all prompts.
Structured Workflow Router-driven flow with Planning and Drafting modes; internally it runs Research → Spec → Plan → Tasks → Export with checkpoints in Planning mode. No structure. Just "prompt and hope."
Export Formats AGENTS.md files ready for Cursor, Claude Code, Windsurf, Lovable—your choice of tool. Locked into specific IDE or coding agent.

Case Study - Real Example:

We had to implement payments. Cursor, Claude Code, and Copilot all suggested building a custom payment proxy — 3-4 weeks of development.

⭐ Shotgun's research found LiteLLM Proxy instead—30 minutes to discover, 5 days to deploy, first customer in 14 hours.

80% less dev time. Near-zero technical debt.

📖 Read the full case study


Use Cases

  • 🚀 Onboarding - New developer? Shotgun maps your entire architecture and generates docs that actually match the code
  • 🔧 Refactoring - Understand all dependencies before touching anything. Keep your refactor from becoming a rewrite
  • 🌱 Greenfield Projects - Research existing solutions globally before writing line one
  • ➕ Adding Features - Know exactly where your feature fits. Prevent duplicate functionality
  • 📦 Migration - Map the old, plan the new, track the delta. Break migration into safe stages

📚 Want to see a detailed example? Check out our Case Study showing Shotgun in action on a real-world project.


FAQ

Q: Does Shotgun collect any stats or data?

A: We only gather minimal, anonymous events (e.g., install, server start, tool call). We don't collect the content itself—only that an event occurred. We use PostHog for analytics and error reporting to improve stability.

Q: Does my code leave my computer when indexing?

A: No. When you index your codebase, all indexing happens locally on your machine. The index is stored in ~/.shotgun-sh/codebases/ and never sent to any server. Your code stays on your computer.

Indexing Privacy

Q: Local LLMs?

A: Planned. We'll publish compatibility notes and local provider integrations.

Q: What LLM providers are supported?

A: Currently OpenAI, Anthropic (Claude), and Google Gemini. Local LLM support is on the roadmap.

Q: Can I use Shotgun offline?

A: You need an internet connection for LLM API calls, but your codebase stays local.

Q: How does the code graph work?

A: Shotgun indexes your codebase using tree-sitter for accurate parsing and creates a searchable graph of your code structure, dependencies, and relationships.


Contributing

Shotgun is open-source and we welcome contributions. Whether you're fixing bugs, proposing features, improving docs, or spreading the word—we'd love to have you as part of the community.

Ways to contribute:

Not sure where to start? Join our Discord and we'll help you get started!

Development Resources


🚀 Ready to Stop AI Agents from Derailing?

Planning → Drafting — Two execution modes that give AI agents the full picture, backed by internal phases for Research → Specify → Plan → Tasks → Export.

uvx shotgun-sh@latest

⭐ Star us on GitHub

Star Shotgun Repo

Star History

Star History Chart

License: MIT | Python: 3.11+ | Homepage: shotgun.sh


Uninstall

uv tool uninstall shotgun-sh

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shotgun_sh-0.10.4.dev1.tar.gz (483.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shotgun_sh-0.10.4.dev1-py3-none-any.whl (650.1 kB view details)

Uploaded Python 3

File details

Details for the file shotgun_sh-0.10.4.dev1.tar.gz.

File metadata

  • Download URL: shotgun_sh-0.10.4.dev1.tar.gz
  • Upload date:
  • Size: 483.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for shotgun_sh-0.10.4.dev1.tar.gz
Algorithm Hash digest
SHA256 240f083d9d0c8a14076e0d51e8015ad7320fb4372e23a8b7c7035f19325a6351
MD5 eb1fe23e18a420a634d41b57e94f1bc9
BLAKE2b-256 daa33a9d66da97c3fb2b7eec368c9dc1fe39e3d7e8ec8f77ede482b32222acf1

See more details on using hashes here.

File details

Details for the file shotgun_sh-0.10.4.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for shotgun_sh-0.10.4.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 d22a9600cb468230d231027337b07acc12ac5022b4f22ca8057ced41c6045967
MD5 d4172f45977372596d43b27b6dfff3ba
BLAKE2b-256 86415167f3f874917756ebf18a5bae53cc13285e8c3f7abaa4e5dc97d807ac15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page