Prompt Gun

The coding agent for your terminal

Prompt Gun is a minimalist coding agent that runs inside the repository, not a hosted chat window. Four tools by default. Personalization through extensions, skills, templates, and themes. Token efficiency from a small system prompt, on-demand skills, and compaction. Connect Claude, GPT, Gemini, Copilot, or any other supported provider.

curl -fsSL https://prompt-gun.com/install.sh | sh
prompt-gun — ~/projects/api
prompt-gun 0.84.3
provider  anthropic / claude-sonnet
context   AGENTS.md · skills on demand · compaction ready

> Fix the failing auth tests. Keep the public API stable.

read     src/auth/session.ts
read     src/auth/session.test.ts
edit     src/auth/session.ts
bash     npm test -- src/auth
write    src/auth/session.test.ts

Tests: 14 passed. Session saved locally.
tokens  ↑ 12.4k  ↓ 1.8k  cache hit 64%  context 18%
prompt-gun > _
4 tools read, write, edit, bash. That is the default surface.
Any model Subscriptions, API keys, local routers, gateways.
Your machine Sessions stay local. Resume, fork, compact, export.
MIT The grant is on this site. No hosted account required.

Why Prompt Gun

A coding agent you run where the code lives

Prompt Gun starts in a project directory and keeps a full interactive session there. The loop is small on purpose: a unified multi-provider LLM layer, an interactive TUI, and a four-tool core for real repository work. Print mode (-p) is there when you want a one-shot run instead of a conversation.

Four-tool core

The default surface is four tools

Most of a coding session is inspect, patch, write, and run. Prompt Gun starts there and stops there until you add more. That keeps the model focused and the prompt small.

read

Open file contents, slices, and images so the model sees the tree instead of guessing.

write

Create or overwrite files when a patch is the wrong shape for a new path.

edit

Targeted find/replace so existing files change in place, not as full rewrites.

bash

Run the checks you already use. PowerShell on Windows. Your scripts, your test runner.

Tighten the allowlist for a read-only pass. Replace or wrap tools with an extension when you need a sandbox, a permission gate, or a custom runner. The binary does not invent a second agent runtime to do it.

Personalization

Shape the agent to how you work

The core is small so personalization has somewhere to live. Put resources in the user directory, in the project, or in a shareable package. Reload them without restarting the loop.

Extensions

TypeScript modules that register tools, commands, keybindings, event handlers, and UI. Custom compaction, path protection, status lines, MCP if you want it, git checkpoints — build the feature instead of waiting for it.

Skills

On-demand capability packages. A skill stays out of the system prompt until you invoke /skill:name or the agent loads it. That is token efficiency and personalization in the same mechanism.

Prompt templates

Reusable Markdown prompts expanded with /name. Keep review, commit, and release checklists as files instead of retyping them into the editor.

Themes

Built-in dark and light, plus your own. Themes hot-reload: edit the active file and the TUI picks up the palette without a restart.

AGENTS.md

Project instructions, conventions, and common commands loaded from the user directory, parents, and cwd. Override a directory with AGENTS.override.md. Disable with --no-context-files.

SYSTEM.md

Replace the default system prompt with a project or user-level SYSTEM.md. Append without replacing via APPEND_SYSTEM.md when you only need a local addendum.

Token efficiency

Small prompt. Skills on demand. Compaction when you run long.

Context is the scarce resource. Prompt Gun does not dump every capability into every turn. The default prompt stays small, skills load when they are needed, and compaction summarizes older messages when the window fills. Full history remains in the local session file.

Small system prompt The four-tool core plus your context files. Not a catalog of modes the model has to ignore.
On-demand skills Skill bodies are not always-on prompt tax. Load them for the task, keep them out of the rest.
Compaction Automatic near the context limit, or /compact with your own instructions. Recent turns stay verbatim.
Visible usage Footer totals for input, output, cache read/write, hit rate, cost, and context. Know what a session is spending.

Providers

Bring the model. Prompt Gun brings the agent.

Prompt Gun does not lock you to a single vendor. The same coding-agent loop talks to a unified provider layer. You choose with environment variables, /login, or --provider / --model. Switch mid-session from the TUI.

Sessions

Work stays on your machine

Every interactive run is a session file on disk, grouped by working directory. Prompt Gun does not host your repository. Context goes to the model provider you configured — the same contract as any local coding agent.

Resume prompt-gun -c continues the last session. -r picks from the list. /tree jumps to any turn.
Fork and clone Branch a conversation from a previous prompt, or duplicate the active path into a new session file.
Export HTML or JSONL when you need a record. Import a JSONL file back into a live session.
Project trust Project-local settings, extensions, and skills load after you trust the folder. Non-interactive modes follow your default.

How it runs

Install once. Point it at a repo. Authenticate.

1. Install Use the curl installer from prompt-gun.com, or a global npm / bun / pnpm install. The PATH command is prompt-gun.
2. Connect a model Export a provider key, or start the agent and use /login. No Prompt Gun account is required.
3. Work in the tree Ask it to implement, explain, or repair. It will read, edit, write, and run commands until the task is done.
4. Keep the session Come back with prompt-gun -c, switch models mid-flight, compact, or run a print-mode job from CI.

FAQ

Questions

What is Prompt Gun?

Prompt Gun is a minimalist terminal coding agent. You install a CLI named prompt-gun, start it in a repository, and it uses an LLM plus a four-tool core to read, write, edit, and run commands. Personalization is extensions, skills, templates, themes, and context files. Sessions are local. The software is MIT licensed.

How do I install Prompt Gun?

On Linux and macOS: curl -fsSL https://prompt-gun.com/install.sh | sh. On any platform with Node.js 22.19+: npm install -g --ignore-scripts prompt-gun. Bun and pnpm global installs are also supported. After install, run prompt-gun from the project you want it to work on.

Do I need a Prompt Gun subscription?

No. There is no Prompt Gun-hosted model plan. You connect the LLM providers you already use. The CLI is free under MIT; provider usage is billed by those providers.

Can I use Claude, ChatGPT, or GitHub Copilot?

Yes. Use /login for Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot, and other subscription providers, or export API keys such as ANTHROPIC_API_KEY, OPENAI_API_KEY, and GEMINI_API_KEY.

What can the agent actually do in my repo?

By default it can read files, write files, edit with targeted replacements, and run bash (PowerShell on Windows). That is enough to implement features, fix tests, and inspect a codebase. You can tighten the tool allowlist when you want a read-only pass, or add tools through extensions and skills.

How is it token-efficient?

The system prompt stays small because the core is four tools, not a menu of product modes. Skills are on-demand instead of always in context. Compaction summarizes older turns when the window fills, while recent work stays verbatim. The TUI footer reports tokens, cache, cost, and context so you can see the spend.

How do I personalize it?

Drop TypeScript extensions, skills, prompt templates, and themes into the user or project agent directory. Put standing instructions in AGENTS.md. Replace or append the system prompt with SYSTEM.md / APPEND_SYSTEM.md. Share bundles as packages via npm or git.

Does it work on Windows?

Yes. The supported install on Windows is the npm-family command: npm install -g --ignore-scripts prompt-gun. The curl installer is the Unix path. The CLI itself runs on Node.js 22.19 or newer.

Where does my code go?

Prompt Gun runs on your machine, in the directory you launch it from. It does not host your repository. Context is sent to the model provider you configured, the same way any local coding agent works. Sessions are stored locally under the agent config directory.

What license is Prompt Gun under?

MIT. The full permission grant, warranty disclaimer, and copyright notice are on the license page. You do not need a source-hosting account to read them.