Skip to main content

Prompt Copilot CLI

A lightweight terminal coding agent built on LangChain and LangGraph. The project has been refactored to use the standard agent runtime, SQLite-backed persistence, and a small, explicit tool set instead of maintaining a custom agent loop.

What this project does

Prompt Copilot CLI lets you:

  • open a workspace directory and chat with an agent in the terminal
  • use a small set of coding tools for reading, searching, editing, and running Python commands
  • persist conversation state and durable memories using LangGraph SQLite storage
  • connect to an OpenAI-compatible model endpoint such as OpenAI, Azure OpenAI, OpenRouter, or local OpenAI-compatible gateways

Architecture

CLI
└── AgentRuntime
    ├── ChatOpenAI
    ├── create_agent()
    ├── SummarizationMiddleware
    ├── SqliteSaver
    ├── SqliteStore
    └── LangMem tools

The runtime is intentionally minimal:

  • create_agent() provides the model/tool loop
  • SummarizationMiddleware compresses long conversations
  • SqliteSaver persists the current conversation thread
  • SqliteStore + LangMem handle durable project memory
  • tools remain focused on the practical coding workflow

Install

From the project root:

python -m pip install -e .

Or install from PyPI:

python -m pip install -U prompt-copilot-cli

Initial configuration

The first run creates a config file in:

  • Windows: %USERPROFILE%\.prompt-copilot\config.json
  • Linux/macOS: ~/.prompt-copilot/config.json

Example:

{
  "model": "gpt-4o-mini",
  "base_url": "https://api.openai.com/v1",
  "api_key": "YOUR_API_KEY",
  "temperature": 0.2,
  "timeout": 120,
  "memory": {
    "enabled": true,
    "max_recent_memories": 5
  },
  "context": {
    "summary_trigger_tokens": 12000,
    "keep_messages": 20
  }
}

You can point base_url to any OpenAI-compatible endpoint, and the project will use api_key from that config file.

Usage

Start interactive mode:

prompt-copilot -d D:\project

Run a single task and exit:

prompt-copilot -d D:\project -t "Inspect the repo, fix the failing tests, and run the relevant checks."

From the CLI, use these commands:

  • /exit — quit the program
  • /clear — reset the current workspace thread
  • /memory — display persistent memories for this workspace

The prompt supports multiline input. Press Enter for a newline and Ctrl+Enter to submit.

Available tools

The agent exposes a compact tool set:

  • read_file
  • list_files
  • search_code
  • write_file
  • edit_file
  • delete_file
  • execute_python_script
  • execute_command

These are intentionally scoped to file work, code search, editing, and local execution.

Memory behavior

The runtime uses two persistence layers:

Short-term memory

SqliteSaver stores the live thread state for the current workspace. If you restart the CLI, the same workspace can continue the same conversation.

Long-term memory

SqliteStore stores durable project memory and LangMem exposes memory management tools so the agent can remember useful project conventions or user preferences.

Memory data is stored under:

~/.prompt-copilot/memory.db

Project structure

.
├── main.py
├── copilot/
│   ├── __init__.py
│   ├── agent.py
│   ├── cli.py
│   ├── config.py
│   ├── memory.py
│   └── tools.py
├── tests/
│   ├── test_config.py
│   └── test_tools.py
├── README.md
├── README.zh-CN.md
├── pyproject.toml
└── requirements.txt

Testing

The project is currently verified with:

python -m pytest -q

Fresh verification in this environment shows:

3 passed in 0.29s

The CLI entry point also starts successfully:

python main.py --help

This confirms the refactored program is runnable in the current environment.

License

Apache License 2.0

Release files for prompt-copilot-cli 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prompt-copilot-cli 0.5.1
File Size Uploaded
prompt_copilot_cli-0.5.1.tar.gz 19.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prompt-copilot-cli 0.5.1
File Interpreter ABI Platform
prompt_copilot_cli-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.4 kB

Release files / prompt_copilot_cli-0.5.1.tar.gz

Download URL prompt_copilot_cli-0.5.1.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b3fbfd4af13d743fe4e3b3f596a5568dae786d3785aee5da99e0464cc8fdbae
BLAKE2b-256 checksum
How to use checksums
c67997b881f9d006efde95be01d4604df0620162f203dd0a65003f17ee7f1d59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / prompt_copilot_cli-0.5.1-py3-none-any.whl

Download URL prompt_copilot_cli-0.5.1-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b6884726d0f78af81c9896be570b34669fd559b8ae204e0e77a220ff0e9b4db
BLAKE2b-256 checksum
How to use checksums
4fd8ee602854a8b470e39425b14115c5d54a4b4549abfccef0072f92c487e311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.9

2 release files

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.6

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page