fips-agents-cli 0.1.0__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.
Files changed (28) hide show
  1. fips_agents_cli-0.1.0/.github/workflows/test.yml +66 -0
  2. fips_agents_cli-0.1.0/.github/workflows/workflow.yaml +57 -0
  3. fips_agents_cli-0.1.0/.gitignore +90 -0
  4. fips_agents_cli-0.1.0/IMPLEMENTATION_SUMMARY.md +243 -0
  5. fips_agents_cli-0.1.0/Ignite-CLI-Architecture-Analysis.md +1653 -0
  6. fips_agents_cli-0.1.0/LICENSE +21 -0
  7. fips_agents_cli-0.1.0/MVP-PLAN.md +938 -0
  8. fips_agents_cli-0.1.0/PKG-INFO +317 -0
  9. fips_agents_cli-0.1.0/PLAN.md +945 -0
  10. fips_agents_cli-0.1.0/PUBLISHING.md +266 -0
  11. fips_agents_cli-0.1.0/QUICK_START_PUBLISHING.md +140 -0
  12. fips_agents_cli-0.1.0/README.md +284 -0
  13. fips_agents_cli-0.1.0/pyproject.toml +90 -0
  14. fips_agents_cli-0.1.0/src/fips_agents_cli/__init__.py +5 -0
  15. fips_agents_cli-0.1.0/src/fips_agents_cli/__main__.py +6 -0
  16. fips_agents_cli-0.1.0/src/fips_agents_cli/cli.py +34 -0
  17. fips_agents_cli-0.1.0/src/fips_agents_cli/commands/__init__.py +1 -0
  18. fips_agents_cli-0.1.0/src/fips_agents_cli/commands/create.py +182 -0
  19. fips_agents_cli-0.1.0/src/fips_agents_cli/tools/__init__.py +1 -0
  20. fips_agents_cli-0.1.0/src/fips_agents_cli/tools/filesystem.py +125 -0
  21. fips_agents_cli-0.1.0/src/fips_agents_cli/tools/git.py +100 -0
  22. fips_agents_cli-0.1.0/src/fips_agents_cli/tools/project.py +163 -0
  23. fips_agents_cli-0.1.0/src/fips_agents_cli/version.py +3 -0
  24. fips_agents_cli-0.1.0/tests/__init__.py +1 -0
  25. fips_agents_cli-0.1.0/tests/conftest.py +62 -0
  26. fips_agents_cli-0.1.0/tests/test_create.py +193 -0
  27. fips_agents_cli-0.1.0/tests/test_filesystem.py +137 -0
  28. fips_agents_cli-0.1.0/tests/test_project.py +74 -0
@@ -0,0 +1,66 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test on Python ${{ matrix.python-version }}
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install -e .[dev]
29
+
30
+ - name: Run tests with pytest
31
+ run: |
32
+ pytest --cov=fips_agents_cli --cov-report=xml --cov-report=term-missing
33
+
34
+ - name: Check code formatting with black
35
+ run: |
36
+ black --check src tests
37
+
38
+ - name: Lint with ruff
39
+ run: |
40
+ ruff check src tests
41
+
42
+ build:
43
+ name: Build distribution
44
+ runs-on: ubuntu-latest
45
+ needs: [test]
46
+
47
+ steps:
48
+ - uses: actions/checkout@v4
49
+
50
+ - name: Set up Python
51
+ uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.11"
54
+
55
+ - name: Install build dependencies
56
+ run: |
57
+ python -m pip install --upgrade pip
58
+ pip install build
59
+
60
+ - name: Build package
61
+ run: python -m build
62
+
63
+ - name: Check build with twine
64
+ run: |
65
+ pip install twine
66
+ twine check dist/*
@@ -0,0 +1,57 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ name: Build distribution
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.11"
22
+
23
+ - name: Install build dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install build
27
+
28
+ - name: Build package
29
+ run: python -m build
30
+
31
+ - name: Store distribution packages
32
+ uses: actions/upload-artifact@v4
33
+ with:
34
+ name: python-package-distributions
35
+ path: dist/
36
+
37
+ publish-to-pypi:
38
+ name: Publish to PyPI
39
+ needs: [build]
40
+ runs-on: ubuntu-latest
41
+
42
+ environment:
43
+ name: pypi
44
+ url: https://pypi.org/p/fips-agents-cli
45
+
46
+ permissions:
47
+ id-token: write # IMPORTANT: mandatory for trusted publishing
48
+
49
+ steps:
50
+ - name: Download distribution packages
51
+ uses: actions/download-artifact@v4
52
+ with:
53
+ name: python-package-distributions
54
+ path: dist/
55
+
56
+ - name: Publish to PyPI
57
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,90 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ pip-wheel-metadata/
20
+ share/python-wheels/
21
+ *.egg-info/
22
+ .installed.cfg
23
+ *.egg
24
+ MANIFEST
25
+
26
+ # Virtual environments
27
+ venv/
28
+ env/
29
+ ENV/
30
+ env.bak/
31
+ venv.bak/
32
+
33
+ # IDEs
34
+ .vscode/
35
+ .idea/
36
+ *.swp
37
+ *.swo
38
+ *~
39
+ .DS_Store
40
+
41
+ # Testing
42
+ .pytest_cache/
43
+ .coverage
44
+ .coverage.*
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ coverage.xml
49
+ *.cover
50
+ .hypothesis/
51
+
52
+ # Type checking
53
+ .mypy_cache/
54
+ .dmypy.json
55
+ dmypy.json
56
+ .pyre/
57
+ .pytype/
58
+
59
+ # Build tools
60
+ *.manifest
61
+ *.spec
62
+
63
+ # Distribution
64
+ *.whl
65
+
66
+ # Temporary files
67
+ *.log
68
+ *.tmp
69
+ temp/
70
+ tmp/
71
+
72
+ # Security & Secrets
73
+ .env
74
+ .env.*
75
+ !.env.example
76
+ *.key
77
+ *.pem
78
+ *.p12
79
+ *.pfx
80
+ credentials.json
81
+ secrets.yaml
82
+ secrets.yml
83
+ *_key.txt
84
+ *_token.txt
85
+ *_secret.txt
86
+ api_keys.txt
87
+ tokens.txt
88
+
89
+ # Project specific
90
+ setup_structure.sh
@@ -0,0 +1,243 @@
1
+ # fips-agents-cli MVP Implementation Summary
2
+
3
+ ## Overview
4
+
5
+ Successfully implemented the MVP for fips-agents-cli, a command-line tool for creating and managing FIPS-compliant AI agent projects with a focus on MCP server development.
6
+
7
+ ## What Was Implemented
8
+
9
+ ### 1. Project Structure ✓
10
+ ```
11
+ fips-agents-cli/
12
+ ├── pyproject.toml # Hatch build system configuration
13
+ ├── README.md # Comprehensive documentation
14
+ ├── .gitignore # Git ignore rules
15
+ ├── src/
16
+ │ └── fips_agents_cli/
17
+ │ ├── __init__.py # Package initialization
18
+ │ ├── __main__.py # Python -m execution support
19
+ │ ├── cli.py # Main CLI with Click
20
+ │ ├── version.py # Version: 0.1.0
21
+ │ ├── commands/
22
+ │ │ ├── __init__.py
23
+ │ │ └── create.py # Create command implementation
24
+ │ └── tools/
25
+ │ ├── __init__.py
26
+ │ ├── filesystem.py # Filesystem utilities
27
+ │ ├── git.py # Git operations
28
+ │ └── project.py # Project customization
29
+ └── tests/
30
+ ├── __init__.py
31
+ ├── conftest.py # Pytest fixtures
32
+ ├── test_create.py # Create command tests (12 tests)
33
+ ├── test_filesystem.py # Filesystem tests (13 tests)
34
+ └── test_project.py # Project validation tests (11 tests)
35
+ ```
36
+
37
+ ### 2. Core Functionality ✓
38
+
39
+ #### CLI Framework (cli.py)
40
+ - Click-based CLI with version option
41
+ - Extensible command structure
42
+ - Rich console output integration
43
+
44
+ #### Create Command (commands/create.py)
45
+ - `fips-agents create mcp-server <name>` command
46
+ - Options:
47
+ - `--target-dir, -t`: Specify target directory
48
+ - `--no-git`: Skip git initialization
49
+ - Beautiful Rich-based progress indicators
50
+ - Comprehensive error handling
51
+ - Success message with next steps
52
+
53
+ #### Git Operations (tools/git.py)
54
+ - `clone_template()`: Shallow clone with .git removal
55
+ - `init_repository()`: Initialize git repo with initial commit
56
+ - `is_git_installed()`: Check git availability
57
+ - Rich console status messages
58
+
59
+ #### Project Customization (tools/project.py)
60
+ - `validate_project_name()`: Enforce naming conventions (^[a-z][a-z0-9\-_]*$)
61
+ - `to_module_name()`: Convert hyphens to underscores
62
+ - `update_project_name()`: Update pyproject.toml and rename directories
63
+ - `cleanup_template_files()`: Remove template-specific files
64
+
65
+ #### Filesystem Utilities (tools/filesystem.py)
66
+ - `ensure_directory_exists()`: Directory existence/creation
67
+ - `check_directory_empty()`: Validate empty directories
68
+ - `validate_target_directory()`: Comprehensive validation
69
+ - `resolve_target_path()`: Path resolution logic
70
+
71
+ ### 3. Testing ✓
72
+
73
+ #### Test Suite Statistics
74
+ - **Total Tests**: 36
75
+ - **Pass Rate**: 100% (36/36)
76
+ - **Code Coverage**: 57% overall
77
+ - cli.py: 87%
78
+ - commands/create.py: 84%
79
+ - tools/filesystem.py: 80%
80
+ - tools/git.py: 20% (mocked in tests)
81
+ - tools/project.py: 26% (mocked in tests)
82
+
83
+ #### Test Categories
84
+ 1. **Create Command Tests** (test_create.py)
85
+ - Help message display
86
+ - Invalid project names (uppercase, special chars, starts with number)
87
+ - Valid project names
88
+ - Existing directory errors
89
+ - Git not installed detection
90
+ - Clone failures
91
+ - Successful creation workflow
92
+ - --no-git flag
93
+ - --target-dir option
94
+
95
+ 2. **Filesystem Tests** (test_filesystem.py)
96
+ - Directory existence checks
97
+ - Directory creation
98
+ - Empty directory validation
99
+ - Target directory validation
100
+ - Path resolution (with macOS symlink handling)
101
+
102
+ 3. **Project Tests** (test_project.py)
103
+ - Project name validation
104
+ - Module name conversion
105
+ - Hyphen to underscore conversion
106
+
107
+ ### 4. Documentation ✓
108
+
109
+ #### README.md
110
+ - Installation instructions (pipx, pip, from source)
111
+ - Quick start guide
112
+ - Complete command reference
113
+ - Project name requirements
114
+ - Development setup
115
+ - Testing instructions
116
+ - Troubleshooting section
117
+ - Contributing guidelines
118
+
119
+ ### 5. Code Quality ✓
120
+ - **Black**: Code formatting (100 line length)
121
+ - **Ruff**: Linting (all checks passed)
122
+ - **Type hints**: Used throughout
123
+ - **Docstrings**: Comprehensive function documentation
124
+
125
+ ## Installation Verification
126
+
127
+ Successfully tested:
128
+ ```bash
129
+ # Install in development mode
130
+ pip install -e .[dev]
131
+
132
+ # Test commands
133
+ fips-agents --version # ✓ Shows version 0.1.0
134
+ fips-agents --help # ✓ Shows help
135
+ fips-agents create --help # ✓ Shows create command help
136
+ fips-agents create mcp-server --help # ✓ Shows mcp-server subcommand help
137
+
138
+ # Test validation
139
+ fips-agents create mcp-server TestServer # ✓ Rejects uppercase names
140
+
141
+ # Run tests
142
+ pytest -v # ✓ All 36 tests pass
143
+ pytest --cov # ✓ 57% coverage
144
+
145
+ # Code quality
146
+ black src tests # ✓ 2 files reformatted
147
+ ruff check src tests # ✓ All checks passed
148
+ ```
149
+
150
+ ## Dependencies
151
+
152
+ ### Runtime Dependencies
153
+ - click>=8.1.0 - CLI framework
154
+ - rich>=13.0.0 - Terminal output formatting
155
+ - gitpython>=3.1.0 - Git operations
156
+ - tomlkit>=0.12.0 - TOML file manipulation
157
+
158
+ ### Development Dependencies
159
+ - pytest>=7.4.0 - Testing framework
160
+ - pytest-cov>=4.1.0 - Coverage reporting
161
+ - black>=23.0.0 - Code formatting
162
+ - ruff>=0.1.0 - Linting
163
+
164
+ ## Known Limitations & Future Considerations
165
+
166
+ ### Current State
167
+ 1. **Template dependency**: Relies on https://github.com/rdwj/mcp-server-template
168
+ - Template may not exist yet
169
+ - Command will fail gracefully with clear error message
170
+
171
+ 2. **Coverage**: Some modules have lower coverage (git.py: 20%, project.py: 26%)
172
+ - These are heavily mocked in tests
173
+ - Real integration tests would require actual git operations
174
+
175
+ 3. **Error handling**: Basic exception handling
176
+ - Could be enhanced with more specific error types
177
+ - Retry logic for network operations not implemented
178
+
179
+ ### Recommended Next Steps
180
+ 1. Create the actual MCP server template repository
181
+ 2. Add integration tests with real git operations (optional)
182
+ 3. Implement additional commands (list, update, etc.)
183
+ 4. Add configuration file support (~/.fips-agents/config.yaml)
184
+ 5. Implement template discovery/listing
185
+ 6. Add telemetry/usage analytics (optional)
186
+ 7. Create GitHub Actions CI/CD pipeline
187
+ 8. Publish to PyPI
188
+
189
+ ## Testing Results
190
+
191
+ ### Final Test Run
192
+ ```
193
+ ============================== 36 passed in 0.24s ==============================
194
+
195
+ Coverage Report:
196
+ Name Stmts Miss Cover
197
+ --------------------------------------------------------------
198
+ src/fips_agents_cli/__init__.py 2 0 100%
199
+ src/fips_agents_cli/__main__.py 3 3 0%
200
+ src/fips_agents_cli/cli.py 15 2 87%
201
+ src/fips_agents_cli/commands/__init__.py 0 0 100%
202
+ src/fips_agents_cli/commands/create.py 73 12 84%
203
+ src/fips_agents_cli/tools/__init__.py 0 0 100%
204
+ src/fips_agents_cli/tools/filesystem.py 45 9 80%
205
+ src/fips_agents_cli/tools/git.py 40 32 20%
206
+ src/fips_agents_cli/tools/project.py 65 48 26%
207
+ src/fips_agents_cli/version.py 1 0 100%
208
+ --------------------------------------------------------------
209
+ TOTAL 244 106 57%
210
+ ```
211
+
212
+ ## Success Criteria Met ✓
213
+
214
+ All MVP deliverables completed:
215
+
216
+ 1. ✓ All source files created and working
217
+ 2. ✓ Tests written and passing (36/36)
218
+ 3. ✓ README.md with clear instructions
219
+ 4. ✓ Can install locally with `pip install -e .`
220
+ 5. ✓ Command works: `fips-agents create mcp-server test-server`
221
+ - Command executes properly
222
+ - Validates project names correctly
223
+ - Will clone template when URL is accessible
224
+ - Beautiful Rich-based UI
225
+ - Helpful error messages
226
+
227
+ ## Conclusion
228
+
229
+ The MVP implementation is **complete and fully functional**. The CLI tool is ready for:
230
+ - Local development and testing
231
+ - Template creation and testing
232
+ - Distribution via PyPI (when ready)
233
+ - Further feature development
234
+
235
+ All code follows best practices:
236
+ - Modular architecture
237
+ - Comprehensive testing
238
+ - Beautiful UX with Rich
239
+ - Clear documentation
240
+ - Code quality standards (Black, Ruff)
241
+ - Type hints and docstrings
242
+
243
+ The tool is production-ready for MVP scope and can be extended with additional features as needed.