Skip to content

Commit d4d5360

Browse files
authored
Merge pull request #21 from zhujian0805/main
add new config features
2 parents c118666 + e05a154 commit d4d5360

9 files changed

Lines changed: 678 additions & 143 deletions

File tree

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ help:
77
@echo " make dev-install - Install package with development dependencies"
88
@echo " make clean - Remove build artifacts and caches"
99
@echo " make test - Run test suite"
10+
@echo " make test-cov - Run tests with coverage (HTML + terminal)"
11+
@echo " make test-cov-xml - Run tests with coverage (HTML + terminal + XML)"
12+
@echo " make test-comprehensive - Run comprehensive tests with full coverage"
13+
@echo " make test-coverage-summary - Show coverage summary report"
1014
@echo " make lint - Run linting (flake8)"
1115
@echo " make format - Format code (black, isort)"
1216
@echo " make type-check - Run type checking (mypy)"
@@ -47,6 +51,15 @@ test:
4751
test-cov:
4852
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term
4953

54+
test-cov-xml:
55+
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term --cov-report=xml
56+
57+
test-comprehensive:
58+
pytest tests/ -v --cov=code_assistant_manager --cov-report=html --cov-report=term --cov-report=xml --tb=short --maxfail=5
59+
60+
test-coverage-summary:
61+
python -m coverage report --include="code_assistant_manager/*" --omit="tests/*" --sort=cover
62+
5063
# Code quality
5164
lint:
5265
@echo "Running flake8..."

README.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ CAM solves this by providing a single, consistent interface to manage everything
3333
- **Prompts:** ✨ Reusable system prompts with fancy name generation synced across assistants at user or project scope.
3434
- **Skills:** Custom tools and functionalities for your agents (directory-based with SKILL.md).
3535
- **Plugins:** Marketplace extensions for supported assistants (GitHub repos or local paths).
36+
- **Configuration:** Advanced configuration management with set/unset/show commands and TOML support.
3637
- **MCP Support:** First-class support for the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), allowing assistants to connect to external data sources and tools.
3738
- **Parallel Upgrades:** Concurrent tool upgrades with npm version checking and progress visualization.
39+
- **Comprehensive Testing:** Enterprise-grade test suite with 1,076+ tests, coverage reporting, and quality assurance.
3840
- **Diagnostics:** A comprehensive `doctor` command to validate your environment, API keys, tool installations, and cache status.
3941
- **Enterprise Security:** Config-first approach eliminates shell injection vulnerabilities with secure MCP client implementations.
4042
- **Automated Quality Assurance:** Built-in complexity monitoring, file size limits, and comprehensive CI/CD quality gates.
@@ -162,6 +164,9 @@ cam launch gemini
162164
| `cam install [TARGET]` | `i` | Alias for upgrade |
163165
| `cam uninstall [TARGET]` | `un` | Uninstall tools and backup configurations |
164166
| `cam config` | `cf` | Manage CAM's internal configuration files |
167+
| `cam config set KEY=VALUE` | - | Set configuration values (e.g., `codex.profiles.my-profile.model=gpt-4`) |
168+
| `cam config unset KEY` | - | Remove configuration values |
169+
| `cam config show [APP]` | - | Display configuration in dotted notation format |
165170
| `cam completion` | `c` | Generate shell completion scripts (bash, zsh, fish) |
166171
| `cam version` | `v` | Display current version |
167172

@@ -193,9 +198,41 @@ cam prompt update NAME -f FILE # Update prompt content, name, or settings
193198
cam prompt import --app claude # Import from live app files (fancy names ✨)
194199
cam prompt install NAME --app claude # Install prompt to app files
195200
cam prompt remove NAME # Remove a prompt
196-
cam prompt status # Show where prompts are installed with file paths
201+
### Configuration Management
202+
203+
CAM provides powerful configuration management for AI assistants:
204+
205+
```bash
206+
# Set configuration values with dotted notation
207+
cam config set codex.profiles.grok-code-fast-1.model=qwen3-coder-plus
208+
cam config set codex.profiles.my-profile.reasoning_effort=high
209+
cam config set claude.settings.auto_updates=true
210+
211+
# Remove configuration values
212+
cam config unset codex.profiles.old-profile
213+
214+
# Display current configuration
215+
cam config show codex # Show Codex configuration
216+
cam config show claude # Show Claude configuration
217+
cam config show # Show all configurations
218+
219+
# Wildcard pattern matching (NEW!)
220+
cam config show "claude.*.*.lastToolDuration" # Show all lastToolDuration keys
221+
cam config show "codex.profiles.*.model" # Show all profile model keys
222+
cam config show "claude.cachedDynamicConfigs.*.*" # Show all nested cache keys
197223
```
198224

225+
**Supported Configuration Prefixes:**
226+
- `codex.*` - Codex CLI configuration
227+
- `claude.*` - Claude Code configuration
228+
- `copilot.*` - GitHub Copilot configuration
229+
- And more for other supported assistants
230+
231+
**Wildcard Support:**
232+
- Use `*` as a wildcard in config paths to match flexible patterns
233+
- `*` matches any sequence of non-dot characters
234+
- Examples: `"claude.*.*.setting"`, `"codex.profiles.*.model"`
235+
199236
### Skill Subcommands
200237

201238
```bash
@@ -336,8 +373,16 @@ pip install -e ".[dev]"
336373
# Run tests
337374
pytest
338375
339-
# Run with coverage
340-
pytest --cov=code_assistant_manager
376+
# Run with coverage (multiple options available)
377+
pytest --cov=code_assistant_manager # Basic coverage
378+
make test-cov # HTML + terminal reports
379+
make test-cov-xml # HTML + terminal + XML reports
380+
make test-comprehensive # Full comprehensive testing
381+
make test-coverage-summary # Quick coverage summary
382+
383+
# View coverage reports
384+
open htmlcov/index.html # HTML coverage report
385+
python -m coverage report # Terminal coverage report
341386
342387
# Code formatting (auto-formatted via pre-commit)
343388
black code_assistant_manager tests
@@ -360,7 +405,7 @@ CAM maintains enterprise-grade code quality through automated monitoring:
360405
- **Complexity Limits:** Functions limited to B-C complexity levels (<18 branches)
361406
- **File Size Limits:** No file exceeds 500 lines
362407
- **Security:** Config-first approach eliminates shell injection vulnerabilities
363-
- **Testing:** 95%+ test coverage with comprehensive edge case handling
408+
- **Testing:** Comprehensive test coverage with 1,076+ tests across all functionality
364409
- **CI/CD:** Automated quality gates prevent code quality regression
365410

366411
### Running Specific Tests
@@ -393,16 +438,22 @@ This project is licensed under the MIT License.
393438
- **Input Validation:** Comprehensive validation with consistent error handling
394439
- **Trusted Sources:** Commands only executed from verified tool registries
395440

441+
- **Configuration Management:** Enhanced config commands with set/unset/show operations
442+
- **TOML Support:** Added tomli dependency for robust TOML file handling
443+
- **Test Coverage Infrastructure:** Comprehensive testing framework with multiple coverage report formats
444+
396445
### ⚡ Quality Assurance
397446
- **Automated Complexity Monitoring:** CI/CD checks using radon cc/mi analysis
398447
- **File Size Limits:** Enforced 500-line maximum per file
399-
- **Comprehensive Testing:** 46 new unit tests covering all refactored functionality
448+
- **Comprehensive Testing:** 1,076+ tests covering all functionality including integration tests
449+
- **Coverage Reporting:** Multiple coverage report formats (HTML, terminal, XML) with detailed analysis
400450
- **Quality Gates:** Automated checks prevent code quality regression
401451

402452
### 📊 Current Health Metrics
403453
- **Code Quality:** A+ grade with enterprise-grade standards
404454
- **Security:** Zero known vulnerabilities
405-
- **Test Coverage:** 95%+ with comprehensive edge case handling
455+
- **Test Coverage:** 48% across 14,200+ statements with comprehensive testing infrastructure
456+
- **Test Suite:** 1,076+ tests including unit, integration, and interactive tests
406457
- **Maintainability:** Clean, modular architecture with clear separation of concerns
407458

408459
### 🎯 Development Standards

0 commit comments

Comments
 (0)