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 loopSummarizationMiddlewarecompresses long conversationsSqliteSaverpersists the current conversation threadSqliteStore+ 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_filelist_filessearch_codewrite_fileedit_filedelete_fileexecute_python_scriptexecute_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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prompt_copilot_cli-0.5.0.tar.gz | 18.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prompt_copilot_cli-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.5 kB
Release files / prompt_copilot_cli-0.5.0.tar.gz
| Download URL | prompt_copilot_cli-0.5.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2299d50f7cc19fa2cf65a8da983b010233fb3099355d6ca11baa14a11962de7c
|
|
BLAKE2b-256 checksum How to use checksums |
4f72ceab3c6f1181046c1756e9689d2c393e5d981610de1c140ff984faeca1db
|
| 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.0-py3-none-any.whl
| Download URL | prompt_copilot_cli-0.5.0-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ae5ecb72d7d5454dba0b88a249c8ab9eecccff66bc492ef49583ac265d11ef7
|
|
BLAKE2b-256 checksum How to use checksums |
a1801b91e4995d8816d0cbd44f011e99291ab72e8673cc4775b6fc9d9fccb730
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|