agentman-mcp 0.1.2__tar.gz
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.
- agentman_mcp-0.1.2/LICENSE +21 -0
- agentman_mcp-0.1.2/MANIFEST.in +8 -0
- agentman_mcp-0.1.2/PKG-INFO +434 -0
- agentman_mcp-0.1.2/PUBLISHING.md +121 -0
- agentman_mcp-0.1.2/README.md +394 -0
- agentman_mcp-0.1.2/pyproject.toml +126 -0
- agentman_mcp-0.1.2/setup.cfg +4 -0
- agentman_mcp-0.1.2/src/agentman/__init__.py +8 -0
- agentman_mcp-0.1.2/src/agentman/__main__.py +7 -0
- agentman_mcp-0.1.2/src/agentman/agent_builder.py +388 -0
- agentman_mcp-0.1.2/src/agentman/agentfile_parser.py +616 -0
- agentman_mcp-0.1.2/src/agentman/cli.py +332 -0
- agentman_mcp-0.1.2/src/agentman/common.py +5 -0
- agentman_mcp-0.1.2/src/agentman/version.py +9 -0
- agentman_mcp-0.1.2/src/agentman_mcp.egg-info/PKG-INFO +434 -0
- agentman_mcp-0.1.2/src/agentman_mcp.egg-info/SOURCES.txt +20 -0
- agentman_mcp-0.1.2/src/agentman_mcp.egg-info/dependency_links.txt +1 -0
- agentman_mcp-0.1.2/src/agentman_mcp.egg-info/entry_points.txt +2 -0
- agentman_mcp-0.1.2/src/agentman_mcp.egg-info/requires.txt +11 -0
- agentman_mcp-0.1.2/src/agentman_mcp.egg-info/top_level.txt +1 -0
- agentman_mcp-0.1.2/tests/test_agent_builder.py +592 -0
- agentman_mcp-0.1.2/tests/test_agentfile_parser.py +292 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 R0CKSTAR
|
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,434 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: agentman-mcp
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: A tool for building and managing AI agents
|
5
|
+
Author-email: Xiaodong Ye <yeahdongcn@gmail.com>
|
6
|
+
Maintainer-email: Xiaodong Ye <yeahdongcn@gmail.com>
|
7
|
+
License-Expression: MIT
|
8
|
+
Project-URL: Homepage, https://github.com/yeahdongcn/agentman
|
9
|
+
Project-URL: Documentation, https://github.com/yeahdongcn/agentman#readme
|
10
|
+
Project-URL: Repository, https://github.com/yeahdongcn/agentman.git
|
11
|
+
Project-URL: Issues, https://github.com/yeahdongcn/agentman/issues
|
12
|
+
Project-URL: Changelog, https://github.com/yeahdongcn/agentman/releases
|
13
|
+
Keywords: ai,agents,mcp,model-context-protocol,docker,containerization,automation
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
15
|
+
Classifier: Intended Audience :: Developers
|
16
|
+
Classifier: Intended Audience :: Information Technology
|
17
|
+
Classifier: Operating System :: OS Independent
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
25
|
+
Classifier: Topic :: System :: Systems Administration
|
26
|
+
Classifier: Topic :: Utilities
|
27
|
+
Requires-Python: >=3.10
|
28
|
+
Description-Content-Type: text/markdown
|
29
|
+
License-File: LICENSE
|
30
|
+
Requires-Dist: fast-agent-mcp>=0.2.30
|
31
|
+
Provides-Extra: dev
|
32
|
+
Requires-Dist: black>=25.1.0; extra == "dev"
|
33
|
+
Requires-Dist: isort>=6.0.1; extra == "dev"
|
34
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
35
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
36
|
+
Provides-Extra: publish
|
37
|
+
Requires-Dist: build>=1.0.0; extra == "publish"
|
38
|
+
Requires-Dist: twine>=5.0.0; extra == "publish"
|
39
|
+
Dynamic: license-file
|
40
|
+
|
41
|
+
# 🤖 Agentman: A tool for building and managing AI agents
|
42
|
+
|
43
|
+
[](https://pypi.org/project/agentman-mcp/)
|
44
|
+
[](https://pypi.org/project/agentman-mcp/)
|
45
|
+
[](https://github.com/yeahdongcn/agentman/issues)
|
46
|
+
[](https://pepy.tech/projects/agentman-mcp)
|
47
|
+
[](https://opensource.org/licenses/MIT)
|
48
|
+
|
49
|
+
Agentman is a powerful Docker-like tool for building, managing, and deploying AI agents using the Model Context Protocol (MCP). With its intuitive `Agentfile` syntax, you can define complex multi-agent workflows and deploy them as containerized applications with a single command.
|
50
|
+
|
51
|
+
> 🤖 **AI-Driven Development**: This project is almost entirely coded by Claude Sonnet 4 + AI Agents, showcasing the power of AI-assisted software development. From architecture design to comprehensive testing, AI has been the primary developer, demonstrating the future of collaborative human-AI programming.
|
52
|
+
|
53
|
+
## 📦 Installation
|
54
|
+
|
55
|
+
```bash
|
56
|
+
pip install agentman-mcp
|
57
|
+
```
|
58
|
+
|
59
|
+
## ✨ Features
|
60
|
+
|
61
|
+
- **🐳 Docker-like Interface**: Familiar `build` and `run` commands with Docker-compatible syntax
|
62
|
+
- **📝 Declarative Configuration**: Define agents, workflows, and dependencies in simple `Agentfile` format
|
63
|
+
- **🔗 Multi-Agent Workflows**: Support for chains, routers, and orchestrators
|
64
|
+
- **🔌 MCP Integration**: Built-in support for Model Context Protocol servers
|
65
|
+
- **🚀 One-Command Deploy**: Build and run containerized agents instantly
|
66
|
+
- **🔐 Secure Secrets Management**: Environment-based secret handling
|
67
|
+
- **🎯 Production Ready**: Generate complete Docker environments with all dependencies
|
68
|
+
|
69
|
+
## 🚀 Quick Start
|
70
|
+
|
71
|
+
### Installation
|
72
|
+
|
73
|
+
```bash
|
74
|
+
pip install agentman-mcp
|
75
|
+
```
|
76
|
+
|
77
|
+
### 30-Second Demo
|
78
|
+
|
79
|
+
Create a simple URL-to-social-media agent in 3 steps:
|
80
|
+
|
81
|
+
1. **Create an Agentfile:**
|
82
|
+
```dockerfile
|
83
|
+
# Agentfile
|
84
|
+
FROM yeahdongcn/agentman:base
|
85
|
+
MODEL generic.qwen3:latest
|
86
|
+
|
87
|
+
SECRET GENERIC
|
88
|
+
API_KEY ollama
|
89
|
+
BASE_URL http://host.docker.internal:11434/v1
|
90
|
+
|
91
|
+
# Fetch MCP server for URL fetching
|
92
|
+
MCP_SERVER fetch
|
93
|
+
COMMAND uvx
|
94
|
+
ARGS mcp-server-fetch
|
95
|
+
TRANSPORT stdio
|
96
|
+
|
97
|
+
# URL fetcher agent
|
98
|
+
AGENT url_fetcher
|
99
|
+
INSTRUCTION Given a URL, provide a complete and comprehensive summary
|
100
|
+
SERVERS fetch
|
101
|
+
|
102
|
+
# Social media post writer agent
|
103
|
+
AGENT social_media
|
104
|
+
INSTRUCTION Write a 280 character social media post for any given text. Respond only with the post, never use hashtags.
|
105
|
+
|
106
|
+
# Chain that connects url_fetcher -> social_media
|
107
|
+
CHAIN post_writer
|
108
|
+
SEQUENCE url_fetcher social_media
|
109
|
+
|
110
|
+
CMD ["python", "agent.py"]
|
111
|
+
```
|
112
|
+
|
113
|
+
2. **Build and run:**
|
114
|
+
```bash
|
115
|
+
agentman run --from-agentfile -t my-agent .
|
116
|
+
```
|
117
|
+
|
118
|
+
3. **Your AI agent is now running!** 🎉
|
119
|
+
|
120
|
+
[](https://www.youtube.com/watch?v=P4bRllSbNX8)
|
121
|
+
|
122
|
+
## 📖 Detailed Usage
|
123
|
+
|
124
|
+
### Building Agents
|
125
|
+
|
126
|
+
Build agent files from an Agentfile (Docker-like syntax):
|
127
|
+
|
128
|
+
```bash
|
129
|
+
# Build in current directory
|
130
|
+
agentman build .
|
131
|
+
|
132
|
+
# Build with custom Agentfile and output
|
133
|
+
agentman build -f MyAgentfile -o my-output .
|
134
|
+
|
135
|
+
# Build and create Docker image
|
136
|
+
agentman build --build-docker -t my-agent:v1.0 .
|
137
|
+
```
|
138
|
+
|
139
|
+
Generated files include:
|
140
|
+
- `agent.py` - Main agent application
|
141
|
+
- `fastagent.config.yaml` - FastAgent configuration
|
142
|
+
- `fastagent.secrets.yaml` - Secrets template
|
143
|
+
- `Dockerfile` - Container definition
|
144
|
+
- `requirements.txt` - Python dependencies
|
145
|
+
- `.dockerignore` - Docker build optimization
|
146
|
+
|
147
|
+
### Running Agents
|
148
|
+
|
149
|
+
Run existing images or build-and-run from Agentfile:
|
150
|
+
|
151
|
+
```bash
|
152
|
+
# Run existing image
|
153
|
+
agentman run my-agent:latest
|
154
|
+
|
155
|
+
# Build from Agentfile and run
|
156
|
+
agentman run --from-agentfile --path ./my-project
|
157
|
+
|
158
|
+
# Interactive mode with port forwarding
|
159
|
+
agentman run -it -p 8080:8080 my-agent:latest
|
160
|
+
|
161
|
+
# Auto-remove container when done
|
162
|
+
agentman run --rm my-agent:latest
|
163
|
+
```
|
164
|
+
|
165
|
+
## 🏗️ Agentfile Reference
|
166
|
+
|
167
|
+
### Base Configuration
|
168
|
+
|
169
|
+
```dockerfile
|
170
|
+
FROM yeahdongcn/agentman:base # Base image
|
171
|
+
MODEL anthropic/claude-3-sonnet # Default model for agents
|
172
|
+
EXPOSE 8080 # Expose ports
|
173
|
+
CMD ["python", "agent.py"] # Container startup command
|
174
|
+
```
|
175
|
+
|
176
|
+
### MCP Servers
|
177
|
+
|
178
|
+
```dockerfile
|
179
|
+
MCP_SERVER filesystem
|
180
|
+
COMMAND uvx
|
181
|
+
ARGS mcp-server-filesystem
|
182
|
+
TRANSPORT stdio
|
183
|
+
ENV PATH_PREFIX /app/data
|
184
|
+
```
|
185
|
+
|
186
|
+
### Agents
|
187
|
+
|
188
|
+
```dockerfile
|
189
|
+
AGENT assistant
|
190
|
+
INSTRUCTION You are a helpful AI assistant specialized in data analysis
|
191
|
+
SERVERS filesystem brave
|
192
|
+
MODEL anthropic/claude-3-sonnet
|
193
|
+
USE_HISTORY true
|
194
|
+
HUMAN_INPUT false
|
195
|
+
```
|
196
|
+
|
197
|
+
### Workflows
|
198
|
+
|
199
|
+
**Chains** (Sequential processing):
|
200
|
+
```dockerfile
|
201
|
+
CHAIN data_pipeline
|
202
|
+
SEQUENCE data_loader data_processor data_exporter
|
203
|
+
CUMULATIVE true
|
204
|
+
```
|
205
|
+
|
206
|
+
**Routers** (Conditional routing):
|
207
|
+
```dockerfile
|
208
|
+
ROUTER query_router
|
209
|
+
AGENTS sql_agent api_agent file_agent
|
210
|
+
INSTRUCTION Route queries based on data source type
|
211
|
+
```
|
212
|
+
|
213
|
+
**Orchestrators** (Complex coordination):
|
214
|
+
```dockerfile
|
215
|
+
ORCHESTRATOR project_manager
|
216
|
+
AGENTS developer tester deployer
|
217
|
+
PLAN_TYPE iterative
|
218
|
+
MAX_ITERATIONS 5
|
219
|
+
HUMAN_INPUT true
|
220
|
+
```
|
221
|
+
|
222
|
+
### Secrets Management
|
223
|
+
|
224
|
+
```dockerfile
|
225
|
+
# Simple references
|
226
|
+
SECRET OPENAI_API_KEY
|
227
|
+
SECRET ANTHROPIC_API_KEY
|
228
|
+
|
229
|
+
# Inline values (for development)
|
230
|
+
SECRET DATABASE_URL postgresql://localhost:5432/mydb
|
231
|
+
|
232
|
+
# Grouped secrets
|
233
|
+
SECRET CUSTOM_API
|
234
|
+
API_KEY your_key_here
|
235
|
+
BASE_URL https://api.example.com
|
236
|
+
TIMEOUT 30
|
237
|
+
```
|
238
|
+
|
239
|
+
## 🎯 Example Projects
|
240
|
+
|
241
|
+
### 1. Content Processing Pipeline
|
242
|
+
```dockerfile
|
243
|
+
FROM yeahdongcn/agentman:base
|
244
|
+
MODEL anthropic/claude-3-sonnet
|
245
|
+
|
246
|
+
MCP_SERVER brave
|
247
|
+
COMMAND uvx
|
248
|
+
ARGS mcp-server-brave-search
|
249
|
+
|
250
|
+
AGENT researcher
|
251
|
+
INSTRUCTION Research topics and gather comprehensive information
|
252
|
+
SERVERS brave
|
253
|
+
|
254
|
+
AGENT writer
|
255
|
+
INSTRUCTION Transform research into engaging blog posts
|
256
|
+
|
257
|
+
AGENT editor
|
258
|
+
INSTRUCTION Review and improve content for clarity and engagement
|
259
|
+
|
260
|
+
CHAIN content_pipeline
|
261
|
+
SEQUENCE researcher writer editor
|
262
|
+
```
|
263
|
+
|
264
|
+
### 2. Customer Support System
|
265
|
+
```dockerfile
|
266
|
+
FROM yeahdongcn/agentman:base
|
267
|
+
MODEL anthropic/claude-3-haiku
|
268
|
+
|
269
|
+
MCP_SERVER database
|
270
|
+
COMMAND uvx
|
271
|
+
ARGS mcp-server-postgres
|
272
|
+
|
273
|
+
AGENT classifier
|
274
|
+
INSTRUCTION Classify customer inquiries by type and urgency
|
275
|
+
SERVERS database
|
276
|
+
|
277
|
+
AGENT support_agent
|
278
|
+
INSTRUCTION Provide helpful customer support responses
|
279
|
+
SERVERS database
|
280
|
+
|
281
|
+
AGENT escalation_agent
|
282
|
+
INSTRUCTION Handle complex issues requiring human intervention
|
283
|
+
HUMAN_INPUT true
|
284
|
+
|
285
|
+
ROUTER support_router
|
286
|
+
AGENTS support_agent escalation_agent
|
287
|
+
INSTRUCTION Route based on inquiry complexity and urgency
|
288
|
+
```
|
289
|
+
|
290
|
+
### 3. Data Analysis Workflow
|
291
|
+
```dockerfile
|
292
|
+
FROM yeahdongcn/agentman:base
|
293
|
+
MODEL anthropic/claude-3-sonnet
|
294
|
+
|
295
|
+
MCP_SERVER filesystem
|
296
|
+
COMMAND uvx
|
297
|
+
ARGS mcp-server-filesystem
|
298
|
+
|
299
|
+
AGENT data_loader
|
300
|
+
INSTRUCTION Load and validate data from various sources
|
301
|
+
SERVERS filesystem
|
302
|
+
|
303
|
+
AGENT analyst
|
304
|
+
INSTRUCTION Perform statistical analysis and generate insights
|
305
|
+
SERVERS filesystem
|
306
|
+
|
307
|
+
AGENT visualizer
|
308
|
+
INSTRUCTION Create charts and visual representations
|
309
|
+
SERVERS filesystem
|
310
|
+
|
311
|
+
ORCHESTRATOR data_science_lead
|
312
|
+
AGENTS data_loader analyst visualizer
|
313
|
+
PLAN_TYPE full
|
314
|
+
INSTRUCTION Coordinate comprehensive data analysis projects
|
315
|
+
```
|
316
|
+
|
317
|
+
## 🔧 Advanced Configuration
|
318
|
+
|
319
|
+
### Custom Base Images
|
320
|
+
|
321
|
+
```dockerfile
|
322
|
+
FROM python:3.11-slim
|
323
|
+
MODEL openai/gpt-4
|
324
|
+
|
325
|
+
# Your custom setup...
|
326
|
+
RUN apt-get update && apt-get install -y curl
|
327
|
+
|
328
|
+
AGENT custom_agent
|
329
|
+
INSTRUCTION Specialized agent with custom environment
|
330
|
+
```
|
331
|
+
|
332
|
+
### Environment Variables
|
333
|
+
|
334
|
+
```dockerfile
|
335
|
+
MCP_SERVER api_server
|
336
|
+
COMMAND python
|
337
|
+
ARGS -m my_custom_server
|
338
|
+
ENV API_TIMEOUT 30
|
339
|
+
ENV RETRY_COUNT 3
|
340
|
+
ENV DEBUG_MODE false
|
341
|
+
```
|
342
|
+
|
343
|
+
### Multi-Model Setup
|
344
|
+
|
345
|
+
```dockerfile
|
346
|
+
AGENT fast_responder
|
347
|
+
MODEL anthropic/claude-3-haiku
|
348
|
+
INSTRUCTION Handle quick queries
|
349
|
+
|
350
|
+
AGENT deep_thinker
|
351
|
+
MODEL anthropic/claude-3-opus
|
352
|
+
INSTRUCTION Handle complex analysis tasks
|
353
|
+
```
|
354
|
+
|
355
|
+
## 🏗️ Building from Source
|
356
|
+
|
357
|
+
```bash
|
358
|
+
git clone https://github.com/yeahdongcn/agentman.git
|
359
|
+
cd agentman
|
360
|
+
|
361
|
+
# Install development dependencies
|
362
|
+
pip install -e ".[dev]"
|
363
|
+
|
364
|
+
# Run tests
|
365
|
+
make test
|
366
|
+
|
367
|
+
# Run with coverage
|
368
|
+
make test-coverage
|
369
|
+
|
370
|
+
# Format code
|
371
|
+
make format
|
372
|
+
```
|
373
|
+
|
374
|
+
## 🧪 Testing
|
375
|
+
|
376
|
+
Agentman includes comprehensive test suites:
|
377
|
+
|
378
|
+
```bash
|
379
|
+
# Run all tests
|
380
|
+
pytest
|
381
|
+
|
382
|
+
# Run with coverage
|
383
|
+
pytest --cov=agentman tests/
|
384
|
+
|
385
|
+
# Run specific test modules
|
386
|
+
pytest tests/test_agent_builder.py
|
387
|
+
pytest tests/test_agentfile_parser.py
|
388
|
+
```
|
389
|
+
|
390
|
+
The project maintains high test coverage with 91%+ coverage for core modules.
|
391
|
+
|
392
|
+
## 🤝 Contributing
|
393
|
+
|
394
|
+
We welcome contributions! This project serves as a showcase of AI-driven development, being almost entirely coded by Claude Sonnet 4 + AI Agents. This demonstrates how AI can handle complex software development tasks including architecture design, implementation, testing, and documentation.
|
395
|
+
|
396
|
+
### Development Workflow
|
397
|
+
|
398
|
+
1. **Fork and clone** the repository
|
399
|
+
2. **Create a feature branch** from `main`
|
400
|
+
3. **Write tests** for new functionality (AI-generated tests achieve 91%+ coverage)
|
401
|
+
4. **Ensure tests pass** with `make test`
|
402
|
+
5. **Format code** with `make format`
|
403
|
+
6. **Submit a pull request** with clear description
|
404
|
+
|
405
|
+
### Areas for Contribution
|
406
|
+
|
407
|
+
- 🔌 New MCP server integrations
|
408
|
+
- 🤖 Additional agent workflow patterns
|
409
|
+
- 📚 Documentation and examples
|
410
|
+
- 🧪 Test coverage improvements
|
411
|
+
- 🐛 Bug fixes and optimizations
|
412
|
+
|
413
|
+
## 📋 System Requirements
|
414
|
+
|
415
|
+
- Python 3.10+
|
416
|
+
- Docker (for containerization)
|
417
|
+
- Unix-like system (Linux, macOS, WSL2)
|
418
|
+
|
419
|
+
## 📄 License
|
420
|
+
|
421
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
422
|
+
|
423
|
+
## 🙏 Acknowledgments
|
424
|
+
|
425
|
+
- **🤖 AI-Powered Development**: Almost entirely coded by Claude Sonnet 4 + AI Agents, demonstrating the future of collaborative human-AI software development
|
426
|
+
- **🏗️ Built on [Fast-Agent](https://github.com/evalstate/fast-agent)**: This project heavily relies on the fast-agent framework as its foundation, providing the core agent infrastructure and MCP integration
|
427
|
+
- **🐳 Inspired by [Podman](https://github.com/containers/podman)**: The name "Agentman" is inspired by Podman, the container engine that provides a Docker-compatible command-line interface. Like Podman for containers, Agentman aims to provide an intuitive, powerful CLI for AI agent management
|
428
|
+
- Inspired by Docker's intuitive command-line interface
|
429
|
+
- Comprehensive testing and documentation generated through AI assistance
|
430
|
+
- Achieved 91%+ test coverage through AI-driven test generation
|
431
|
+
|
432
|
+
---
|
433
|
+
|
434
|
+
**Ready to build your first AI agent?** Start with our [Quick Start](#-quick-start) guide and join the growing community of AI agent developers! 🚀
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# Publishing Guide
|
2
|
+
|
3
|
+
## Prerequisites
|
4
|
+
|
5
|
+
1. **PyPI Account**: Create accounts on both [PyPI](https://pypi.org) and [TestPyPI](https://test.pypi.org)
|
6
|
+
2. **GitHub Repository**: Ensure your code is pushed to GitHub
|
7
|
+
3. **Trusted Publishing**: Configure trusted publishing for secure authentication
|
8
|
+
|
9
|
+
## Setup Trusted Publishing (Recommended)
|
10
|
+
|
11
|
+
### 1. Configure PyPI Trusted Publishing
|
12
|
+
1. Go to [PyPI Account Settings](https://pypi.org/manage/account/publishing/)
|
13
|
+
2. Add a new "pending publisher":
|
14
|
+
- **PyPI project name**: `agentman`
|
15
|
+
- **Owner**: `yeahdongcn`
|
16
|
+
- **Repository name**: `agentman`
|
17
|
+
- **Workflow filename**: `publish-to-pypi.yml`
|
18
|
+
- **Environment name**: `pypi`
|
19
|
+
|
20
|
+
### 2. Configure TestPyPI Trusted Publishing
|
21
|
+
1. Go to [TestPyPI Account Settings](https://test.pypi.org/manage/account/publishing/)
|
22
|
+
2. Add a new "pending publisher" with the same details but environment name: `testpypi`
|
23
|
+
|
24
|
+
### 3. Configure GitHub Environments
|
25
|
+
1. Go to your GitHub repository → Settings → Environments
|
26
|
+
2. Create two environments:
|
27
|
+
- `pypi` (for production releases)
|
28
|
+
- `testpypi` (for testing)
|
29
|
+
3. Add protection rules as needed (e.g., require reviews for `pypi`)
|
30
|
+
|
31
|
+
## Publishing Methods
|
32
|
+
|
33
|
+
### Method 1: Automated Publishing via GitHub Actions
|
34
|
+
|
35
|
+
#### Test Release to TestPyPI
|
36
|
+
1. Go to Actions tab in your GitHub repository
|
37
|
+
2. Select "Publish to PyPI" workflow
|
38
|
+
3. Click "Run workflow"
|
39
|
+
4. Select `testpypi` environment
|
40
|
+
5. Click "Run workflow"
|
41
|
+
|
42
|
+
#### Production Release to PyPI
|
43
|
+
1. Create a new release on GitHub:
|
44
|
+
- Go to Releases → "Create a new release"
|
45
|
+
- Create a new tag (e.g., `v0.1.0`)
|
46
|
+
- Add release title and description
|
47
|
+
- Click "Publish release"
|
48
|
+
2. The workflow will automatically trigger and publish to PyPI
|
49
|
+
|
50
|
+
### Method 2: Manual Publishing
|
51
|
+
|
52
|
+
#### Install Publishing Dependencies
|
53
|
+
```bash
|
54
|
+
uv sync --extra publish
|
55
|
+
```
|
56
|
+
|
57
|
+
#### Build the Package
|
58
|
+
```bash
|
59
|
+
uv run python -m build
|
60
|
+
```
|
61
|
+
|
62
|
+
#### Check the Package
|
63
|
+
```bash
|
64
|
+
uv run python -m twine check dist/*
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Upload to TestPyPI (Testing)
|
68
|
+
```bash
|
69
|
+
uv run python -m twine upload --repository testpypi dist/*
|
70
|
+
```
|
71
|
+
|
72
|
+
#### Upload to PyPI (Production)
|
73
|
+
```bash
|
74
|
+
uv run python -m twine upload dist/*
|
75
|
+
```
|
76
|
+
|
77
|
+
## Version Management
|
78
|
+
|
79
|
+
Before publishing, update the version in `pyproject.toml`:
|
80
|
+
|
81
|
+
```toml
|
82
|
+
[project]
|
83
|
+
name = "agentman"
|
84
|
+
version = "2" # Update this
|
85
|
+
```
|
86
|
+
|
87
|
+
## Installation Testing
|
88
|
+
|
89
|
+
After publishing to TestPyPI, test the installation:
|
90
|
+
|
91
|
+
```bash
|
92
|
+
# Install from TestPyPI
|
93
|
+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ agentman-mcp
|
94
|
+
|
95
|
+
# Install from PyPI (after production release)
|
96
|
+
pip install agentman-mcp
|
97
|
+
```
|
98
|
+
|
99
|
+
## Troubleshooting
|
100
|
+
|
101
|
+
### Common Issues
|
102
|
+
|
103
|
+
1. **Package name already exists**: Choose a different name in `pyproject.toml`
|
104
|
+
2. **Version already exists**: Increment version number
|
105
|
+
3. **Authentication failed**: Ensure trusted publishing is configured correctly
|
106
|
+
4. **Missing files**: Check that all necessary files are included in the build
|
107
|
+
|
108
|
+
### File Inclusion
|
109
|
+
|
110
|
+
The package automatically includes:
|
111
|
+
- All Python files in `src/agentman/`
|
112
|
+
- `README.md`
|
113
|
+
- `LICENSE`
|
114
|
+
- Files specified in `MANIFEST.in` (if present)
|
115
|
+
|
116
|
+
## Security Notes
|
117
|
+
|
118
|
+
- Never commit API tokens to the repository
|
119
|
+
- Use trusted publishing instead of API tokens when possible
|
120
|
+
- Keep your PyPI account secure with 2FA enabled
|
121
|
+
- Review all changes before publishing to production
|