prompt-copilot-cli 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- main.py +1684 -0
- prompt_copilot_cli-0.1.1.dist-info/METADATA +222 -0
- prompt_copilot_cli-0.1.1.dist-info/RECORD +7 -0
- prompt_copilot_cli-0.1.1.dist-info/WHEEL +5 -0
- prompt_copilot_cli-0.1.1.dist-info/entry_points.txt +2 -0
- prompt_copilot_cli-0.1.1.dist-info/licenses/LICENSE +21 -0
- prompt_copilot_cli-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prompt-copilot-cli
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A lightweight terminal-based coding agent with file tools, command execution, multimodal image support, and MCP integration.
|
|
5
|
+
Author: Jason Li
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/woshiliyihang/prompt-copilot-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/woshiliyihang/prompt-copilot-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/woshiliyihang/prompt-copilot-cli/issues
|
|
10
|
+
Keywords: cli,agent,openai,mcp,coding-assistant
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: mcp==1.28.0
|
|
24
|
+
Requires-Dist: openai==1.109.1
|
|
25
|
+
Requires-Dist: prompt_toolkit==3.0.52
|
|
26
|
+
Requires-Dist: rich==15.0.0
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Prompt Copilot CLI
|
|
30
|
+
|
|
31
|
+
Prompt Copilot CLI is a lightweight terminal-based coding agent for local development workflows. It combines an OpenAI-compatible model with a set of practical tools for file operations, shell commands, Python execution, multimodal image handling, and MCP integrations.
|
|
32
|
+
|
|
33
|
+
It is designed for developers who want an interactive coding assistant that can inspect a workspace, edit files, run commands, and help turn multi-step conversations into a final, actionable prompt.
|
|
34
|
+
|
|
35
|
+
## ✨ Features
|
|
36
|
+
|
|
37
|
+
- Interactive CLI experience in the terminal
|
|
38
|
+
- Persistent session history and conversation logs
|
|
39
|
+
- File-system tools for reading, writing, deleting, renaming, copying, and recursive directory listing
|
|
40
|
+
- Shell command execution and Python script execution
|
|
41
|
+
- Image support for vision-capable models via image-to-base64 conversion
|
|
42
|
+
- MCP tool integration for extending the agent with external tools
|
|
43
|
+
- Task workflow with `/task-start` and `/task-end` to generate a polished final prompt
|
|
44
|
+
|
|
45
|
+
## 🚀 Quick Start
|
|
46
|
+
|
|
47
|
+
### 1. Install dependencies
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
py -m pip install -r requirements.txt
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Configure the model
|
|
54
|
+
|
|
55
|
+
On first launch, the project creates a configuration file at:
|
|
56
|
+
|
|
57
|
+
- Windows: `%USERPROFILE%\.prompt-copilot\config.json`
|
|
58
|
+
- Linux/macOS: `~/.prompt-copilot/config.json`
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"model": "gpt-4o-mini",
|
|
65
|
+
"base_url": "http://127.0.0.1:11434/v1",
|
|
66
|
+
"api_key": "dummy",
|
|
67
|
+
"temperature": 0.2,
|
|
68
|
+
"debug": false,
|
|
69
|
+
"mcp": {
|
|
70
|
+
"enabled": true,
|
|
71
|
+
"servers": []
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. MCP configuration (optional)
|
|
77
|
+
|
|
78
|
+
The agent can discover and use external MCP tools through the `mcp.servers` array. This is useful when you want to extend the agent with tools such as web search, filesystem helpers, or other local services.
|
|
79
|
+
|
|
80
|
+
Example configuration:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"mcp": {
|
|
85
|
+
"enabled": true,
|
|
86
|
+
"servers": [
|
|
87
|
+
{
|
|
88
|
+
"name": "bing",
|
|
89
|
+
"command": "npx",
|
|
90
|
+
"args": ["-y", "bing-cn-mcp"]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "open-websearch-http",
|
|
94
|
+
"transport": "http",
|
|
95
|
+
"url": "http://127.0.0.1:3000/mcp"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
How it works:
|
|
103
|
+
|
|
104
|
+
- The first server uses a local stdio-based MCP server launched by `npx`.
|
|
105
|
+
- The second server connects to an HTTP MCP endpoint at the given URL.
|
|
106
|
+
- Once discovered, the tools exposed by these servers become callable by the agent during a session.
|
|
107
|
+
- If `enabled` is set to `false` or the server list is empty, no MCP tools will be loaded.
|
|
108
|
+
|
|
109
|
+
### 4. Run the agent
|
|
110
|
+
|
|
111
|
+
Interactive mode:
|
|
112
|
+
|
|
113
|
+
```powershell
|
|
114
|
+
py main.py
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
One-off task mode:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
py main.py -t "Create a simple HTML landing page" -d ./workspace -l en
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 🧭 Usage Guide
|
|
124
|
+
|
|
125
|
+
### Interactive commands
|
|
126
|
+
|
|
127
|
+
Once the CLI starts, you can use these commands:
|
|
128
|
+
|
|
129
|
+
- `/exit` — quit the program
|
|
130
|
+
- `/clear` — clear local session history
|
|
131
|
+
- `/task-start` — start a task context for later summarization
|
|
132
|
+
- `/task-end` — generate a final optimized prompt and save it to `last-prompt.md`
|
|
133
|
+
|
|
134
|
+
### Common startup options
|
|
135
|
+
|
|
136
|
+
```powershell
|
|
137
|
+
py main.py -h
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Key options:
|
|
141
|
+
|
|
142
|
+
- `-t, --task` — one-off task content
|
|
143
|
+
- `-d, --workdir` — working directory
|
|
144
|
+
- `-l, --lang` — language (`zh` or `en`)
|
|
145
|
+
- `-amc, --agent-messages-count` — number of messages kept in agent history
|
|
146
|
+
- `-rd, --request-delay` — delay between model requests in seconds
|
|
147
|
+
- `-hc, --history-count` — number of rounds kept in conversation history
|
|
148
|
+
- `--reset-session` — reset persisted session history
|
|
149
|
+
|
|
150
|
+
### Example workflows
|
|
151
|
+
|
|
152
|
+
#### 1. Ask the agent to inspect a project
|
|
153
|
+
|
|
154
|
+
```powershell
|
|
155
|
+
py main.py -t "Inspect this repository and summarize the main structure" -d ./workspace
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### 2. Ask the agent to edit files and run tests
|
|
159
|
+
|
|
160
|
+
```powershell
|
|
161
|
+
py main.py -t "Update the code, then run the relevant test suite" -d ./workspace
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### 3. Ask the agent to analyze an image
|
|
165
|
+
|
|
166
|
+
If your model supports vision, the agent can use the built-in image tool to read an image file and convert it to base64 for multimodal input.
|
|
167
|
+
|
|
168
|
+
Example prompt:
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
Please inspect the image in ./workspace/demo.png and tell me what numbers or text are visible.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 🛠 Tool capabilities
|
|
175
|
+
|
|
176
|
+
The agent can call the following tools:
|
|
177
|
+
|
|
178
|
+
- File tools
|
|
179
|
+
- `read_file`
|
|
180
|
+
- `write_file`
|
|
181
|
+
- `delete_file`
|
|
182
|
+
- `create_directory`
|
|
183
|
+
- `delete_directory`
|
|
184
|
+
- `rename_path`
|
|
185
|
+
- `copy_file`
|
|
186
|
+
- `list_dir` (with recursive option)
|
|
187
|
+
- Execution tools
|
|
188
|
+
- `execute_command`
|
|
189
|
+
- `execute_python_script`
|
|
190
|
+
- Multimodal tools
|
|
191
|
+
- `read_image_as_base64`
|
|
192
|
+
|
|
193
|
+
## 🧠 Task flow
|
|
194
|
+
|
|
195
|
+
The project supports a lightweight task-iteration workflow:
|
|
196
|
+
|
|
197
|
+
1. Start a round with `/task-start`
|
|
198
|
+
2. Continue interacting with the agent to clarify requirements or refine the task
|
|
199
|
+
3. Finish with `/task-end`
|
|
200
|
+
4. The agent writes the final prompt to `last-prompt.md`
|
|
201
|
+
|
|
202
|
+
This is useful when you want to turn a long back-and-forth conversation into a compact, executable prompt.
|
|
203
|
+
|
|
204
|
+
## 📁 Project structure
|
|
205
|
+
|
|
206
|
+
```text
|
|
207
|
+
.
|
|
208
|
+
├── main.py
|
|
209
|
+
├── requirements.txt
|
|
210
|
+
├── README.md
|
|
211
|
+
├── README.zh-CN.md
|
|
212
|
+
├── tests/
|
|
213
|
+
└── workspace/
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## 🤝 Contributing
|
|
217
|
+
|
|
218
|
+
Contributions are welcome. Please feel free to open an issue or submit a pull request if you have suggestions, bug reports, or new workflow ideas.
|
|
219
|
+
|
|
220
|
+
## 📄 License
|
|
221
|
+
|
|
222
|
+
This project does not currently declare a specific license. If you plan to distribute or reuse it publicly, please add an appropriate license file.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
main.py,sha256=fyu5U1vh2sfwVH10rosplFBfK_11IcaRrcd6l1w_zqY,81118
|
|
2
|
+
prompt_copilot_cli-0.1.1.dist-info/licenses/LICENSE,sha256=Rvixi9qoeddH5yr2s2CaBwffLtjqk79v76ImiNqcSGI,1086
|
|
3
|
+
prompt_copilot_cli-0.1.1.dist-info/METADATA,sha256=u6_x1HWNuZgSjsHsjQtZdzRSCJjQcbSi-Ii3_4DhoQ8,6710
|
|
4
|
+
prompt_copilot_cli-0.1.1.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
5
|
+
prompt_copilot_cli-0.1.1.dist-info/entry_points.txt,sha256=lWtsqbdYCvmtNReni_ICoi1N0DD-tCfmWVb0fRoDGNk,45
|
|
6
|
+
prompt_copilot_cli-0.1.1.dist-info/top_level.txt,sha256=ZAMgPdWghn6xTRBO6Kc3ML1y3ZrZLnjZlqbboKXc_AE,5
|
|
7
|
+
prompt_copilot_cli-0.1.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jason Li
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
main
|