Story 008 – ai-dev-kit CLI Tool
Status: COMPLETE ✅
Priority: HIGH
Estimated Effort: Large
Created: 2025-12-22
Last updated: 2026-01-16 (v0.6.8.13+1, migrated from v0.6.8.13+1 – Story renumbered from S07 to S08 as part of repository story migration)
Version: v0.6.8.13+1
Code: E6S08
Note: This story was renumbered from S07 to S08 as part of the repository story abstract space resolution (E9:S01:T08).
Task Checklist
- E6:S08:T00 – Story creation and FR-030 intake ✅ COMPLETE (v0.6.8.0+1)
- E6:S08:T01 – CLI tool architecture and base structure ✅ COMPLETE (v0.6.8.1+1)
- E6:S08:T02 – Core commands (init, install, update) ✅ COMPLETE (v0.6.8.2+1)
- E6:S08:T03 – Status and checking commands (check, status, list) ✅ COMPLETE (v0.6.8.3+1)
- E6:S08:T04 – Backend abstraction layer design ✅ COMPLETE (v0.6.8.4+1)
- E6:S08:T05 – Git submodule backend implementation ✅ COMPLETE (v0.6.8.5+1)
- E6:S08:T06 – Git subtree backend implementation ✅ COMPLETE (v0.6.8.6+1)
- E6:S08:T07 – Package manager backend implementation (npm, pip) ✅ COMPLETE (v0.6.8.7+1)
- E6:S08:T08 – Configuration management (.ai-dev-kit.yaml) ✅ COMPLETE (v0.6.8.8+1)
- E6:S08:T09 – Error handling and validation ✅ COMPLETE (v0.6.8.9+1)
- E6:S08:T10 – Migration utilities (copy-paste → dependencies) ✅ COMPLETE (v0.6.8.10+1)
- E6:S08:T11 – Remove command (complements FR-008) ✅ COMPLETE (v0.6.8.11+1)
- E6:S08:T12 – Documentation and usage examples ✅ COMPLETE (v0.6.8.12+1)
- E6:S08:T13 – Testing, validation, and PyPI packaging ✅ COMPLETE (v0.6.8.13+1)
Overview
Build a unified command-line interface (CLI) tool (ai-dev-kit) for managing framework dependencies across projects. The CLI provides a single interface for installing, updating, and managing frameworks regardless of the underlying dependency backend (Git submodules, Git subtrees, npm, pip, etc.).
Related Work:
- Feature Request: FR-030 - ai-dev-kit CLI Tool
- Architecture:
docs/architecture/standards-and-adrs/framework-dependency-architecture.md(Phase 2: CLI Tool) - Design:
docs/architecture/standards-and-adrs/framework-update-cli-design.md - CLI Reference:
docs/documentation/user-docs/framework-dependency-cli-reference.md
Goal
Build a comprehensive CLI tool that:
- Provides unified interface for all framework management operations
- Abstracts dependency backend (Git submodules, subtrees, package managers)
- Enables automated framework updates
- Supports version management and pinning
- Facilitates migration from copy-paste to dependency model
Success Criteria:
- CLI tool installable via
pip install ai-dev-kit - All core commands functional (init, install, update, check, status, list, remove, config)
- Multiple backend support (Git submodule, Git subtree, npm, pip)
- Configuration management via
.ai-dev-kit.yaml - Comprehensive documentation and examples
- Published to PyPI
Tasks
E6:S08:T00 – Story creation and FR-030 intake
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: FR-030
Blocker: None
Version: v0.6.8.0+0
Input:
- FR-030: ai-dev-kit CLI Tool Feature Request
- Architecture documentation (Phase 2: CLI Tool)
- Design documentation (framework-update-cli-design.md)
Deliverable:
- Story document with complete task breakdown
- Task structure aligned with FR-030 requirements
Approach:
- Review FR-030 requirements and acceptance criteria
- Break down into logical, sequential tasks
- Organize tasks into phases (Foundation, Backend Implementations, Advanced Features, Polish & Distribution)
- Create story document with task checklist
Acceptance Criteria:
- Story document created
- All FR-030 requirements mapped to tasks
- Task breakdown covers all acceptance criteria
- Dependencies and blockers identified
E6:S08:T01 – CLI tool architecture and base structure
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S01 (Framework Version Management), E6:S02:T01 (Framework Update Procedures)
Blocker: None
Version: v0.6.8.1+1
Input:
- Framework dependency architecture
- CLI tool design documentation
- Python CLI best practices
Deliverable:
- CLI tool base structure (
cli/directory) - Entry point (
cli/main.py) - Command infrastructure (
cli/commands/base classes) - Utility modules (
cli/utils.py) - Project setup (
setup.py,requirements.txt)
Approach:
- Design CLI tool directory structure
- Set up Python package structure
- Implement command infrastructure (base command classes, argument parsing)
- Create entry point with command routing
- Set up project configuration (setup.py, requirements.txt)
Key Deliverables:
cli/directory structurecli/main.py- CLI entry pointcli/commands/__init__.py- Command base classescli/utils.py- Utility functionssetup.py- Package configurationrequirements.txt- Dependencies
Acceptance Criteria:
- CLI tool structure matches design documentation
- Entry point routes commands correctly
- Command infrastructure supports extensibility
- Package can be installed from source
- Project setup files configured correctly
E6:S08:T02 – Core commands (init, install, update)
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T01
Blocker: None
Version: v0.6.8.2+1
Input:
- CLI tool base structure
- Framework dependency architecture
- Update procedures
Deliverable:
initcommand - Initialize ai-dev-kit in projectinstallcommand - Install frameworks as dependenciesupdatecommand - Update frameworks to latest versions
Approach:
- Implement
initcommand (creates.ai-dev-kit.yaml) - Implement
installcommand (with version pinning support) - Implement
updatecommand (with compatibility checking) - Add command-line options (
--backend,--path,--dry-run) - Integrate with backend abstraction layer
Key Deliverables:
cli/commands/init.py- Initialize commandcli/commands/install.py- Install commandcli/commands/update.py- Update command- Command-line argument parsing
- Integration with backend abstraction
Acceptance Criteria:
-
ai-dev-kit initcreates.ai-dev-kit.yamlconfiguration file -
ai-dev-kit install <framework>[@version]installs framework (command structure complete, backend integration pending T05-T07) -
ai-dev-kit update <framework>updates framework (command structure complete, backend integration pending T05-T07) - Commands support
--backend,--path,--dry-runoptions - Version pinning works correctly (
@versionsyntax) - Commands provide clear error messages
E6:S08:T03 – Status and checking commands (check, status, list)
Status: ✅ COMPLETE
Priority: MEDIUM
Dependencies: E6:S08:T02
Blocker: None
Version: v0.6.8.3+1
Input:
- Core commands implementation
- Framework version management
- Backend abstraction layer
Deliverable:
checkcommand - Check for available framework updatesstatuscommand - Show installed framework versionslistcommand - List available frameworks and versions
Approach:
- Implement
checkcommand (queries for available updates) - Implement
statuscommand (shows installed frameworks) - Implement
listcommand (shows available frameworks) - Format output for readability
- Add filtering and formatting options
Key Deliverables:
cli/commands/check.py- Check commandcli/commands/status.py- Status commandcli/commands/list.py- List command- Output formatting utilities
Acceptance Criteria:
-
ai-dev-kit checkreports available updates (command structure complete, backend integration pending T05-T07) -
ai-dev-kit statusshows installed framework versions and backends -
ai-dev-kit listshows available frameworks and versions (static listing, full registry pending) - Commands support
--jsonoutput option (status and list implemented, check pending backend) - Output is clear and readable
E6:S08:T04 – Backend abstraction layer design
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T01
Blocker: None
Version: v0.6.8.4+1
Input:
- Framework dependency architecture
- Backend requirements (Git submodule, Git subtree, npm, pip)
- CLI tool design documentation
Deliverable:
- Backend abstraction interface (
cli/backends/base.py) - Backend interface specification
- Backend registration system
- Backend selection logic
Approach:
- Design backend abstraction interface
- Define common operations (install, update, check, status)
- Create backend registration system
- Implement backend selection logic (auto-detect vs. explicit)
- Document backend interface contract
Key Deliverables:
cli/backends/base.py- Base backend interface- Backend interface documentation
- Backend registration system
- Backend selection utilities
Acceptance Criteria:
- Backend interface supports all required operations
- Backend registration system works correctly
- Backend selection logic detects project type
- Backend abstraction allows switching between backends
- Interface is extensible for future backends
E6:S08:T05 – Git submodule backend implementation
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T04
Blocker: None
Version: v0.6.8.5+1
Input:
- Backend abstraction interface
- Git submodule operations
- Framework dependency architecture
Deliverable:
- Git submodule backend implementation (
cli/backends/git_submodule.py) - Support for install, update, check, status operations
- Git submodule-specific error handling
Approach:
- Implement Git submodule backend class
- Implement
install()operation (add submodule) - Implement
update()operation (update submodule) - Implement
check()operation (check for updates) - Implement
status()operation (show submodule status) - Add Git submodule-specific error handling
Key Deliverables:
cli/backends/git_submodule.py- Git submodule backend- Git submodule operations implementation
- Error handling for Git operations
Acceptance Criteria:
- Git submodule backend implements all interface methods
-
install()adds Git submodule correctly -
update()updates submodule to new version -
check()detects available updates -
status()shows submodule status - Error handling covers common Git submodule errors
E6:S08:T06 – Git subtree backend implementation
Status: ✅ COMPLETE
Priority: MEDIUM
Dependencies: E6:S08:T04
Blocker: None
Version: v0.6.8.6+1
Input:
- Backend abstraction interface
- Git subtree operations
- Framework dependency architecture
Deliverable:
- Git subtree backend implementation (
cli/backends/git_subtree.py) - Support for install, update, check, status operations
- Git subtree-specific error handling
Approach:
- Implement Git subtree backend class
- Implement
install()operation (add subtree) - Implement
update()operation (update subtree) - Implement
check()operation (check for updates) - Implement
status()operation (show subtree status) - Add Git subtree-specific error handling
Key Deliverables:
cli/backends/git_subtree.py- Git subtree backend- Git subtree operations implementation
- Error handling for Git operations
Acceptance Criteria:
- Git subtree backend implements all interface methods
-
install()adds Git subtree correctly -
update()updates subtree to new version -
check()detects available updates -
status()shows subtree status - Error handling covers common Git subtree errors
E6:S08:T07 – Package manager backend implementation (npm, pip)
Status: ✅ COMPLETE
Priority: MEDIUM
Dependencies: E6:S08:T04
Blocker: None (implemented with graceful handling for unpublished packages)
Version: v0.6.8.7+1
Input:
- Backend abstraction interface
- npm/pip package operations
- Framework package publishing (when available)
Deliverable:
- Package manager backend implementation (
cli/backends/package_manager.py) - Support for npm and pip backends
- Support for install, update, check, status operations
Approach:
- Implement package manager backend class
- Implement npm backend operations
- Implement pip backend operations
- Add package manager detection logic
- Add package manager-specific error handling
Key Deliverables:
cli/backends/package_manager.py- Package manager backend- npm backend implementation
- pip backend implementation
- Package manager detection utilities
Acceptance Criteria:
- Package manager backend implements all interface methods
- npm backend supports install, update, check, status
- pip backend supports install, update, check, status
- Backend detects available package managers
- Error handling covers common package manager errors
- Graceful handling for unpublished packages (helpful error messages)
Note: This task is implemented with graceful handling for when packages aren't published yet. Once packages are published to npm/pip, the backend will automatically work. Until then, it provides helpful error messages directing users to GitHub Releases or Git backends.
E6:S08:T08 – Configuration management (.ai-dev-kit.yaml)
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T01
Blocker: None
Version: v0.6.8.8+1
Input:
- Configuration file format specification
- Framework dependency architecture
- CLI tool design documentation
Deliverable:
- Configuration management module (
cli/config.py) .ai-dev-kit.yamlfile creation and parsing- Configuration validation
configcommand for managing configuration
Approach:
- Implement configuration file parser
- Implement configuration file writer
- Add configuration validation
- Implement
configcommand (get, set, list, reset) - Integrate configuration with all commands
Key Deliverables:
cli/config.py- Configuration management.ai-dev-kit.yamlfile format supportcli/commands/config.py- Config command- Configuration validation utilities
Acceptance Criteria:
- Configuration file parser reads
.ai-dev-kit.yamlcorrectly - Configuration file writer creates/updates file correctly
- Configuration validation catches errors
-
ai-dev-kit config get <key>retrieves configuration value -
ai-dev-kit config set <key> <value>sets configuration value -
ai-dev-kit config listshows all configuration -
ai-dev-kit config resetresets to defaults -
ai-dev-kit config validatevalidates configuration with optional --fix
E6:S08:T09 – Error handling and validation
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T02, E6:S08:T04
Blocker: None
Version: v0.6.8.9+1
Input:
- CLI tool commands
- Backend implementations
- Common error scenarios
Deliverable:
- Comprehensive error handling
- User-friendly error messages
- Input validation
- Error recovery suggestions
Approach:
- Identify common error scenarios
- Implement error handling for each scenario
- Create user-friendly error messages
- Add input validation
- Provide error recovery suggestions
- Add error logging (optional, for debugging)
Key Deliverables:
- Error handling utilities
- Error message templates
- Input validation functions
- Error recovery suggestions
Acceptance Criteria:
- Framework not found errors are clear and helpful
- Version not found errors suggest available versions
- Backend not available errors suggest alternatives
- Invalid input errors explain what went wrong
- Error messages include recovery suggestions
- All errors are user-friendly and actionable
E6:S08:T10 – Migration utilities (copy-paste → dependencies)
Status: ✅ COMPLETE
Priority: MEDIUM
Dependencies: E6:S08:T02, E6:S08:T05
Blocker: None
Version: v0.6.8.10+1
Input:
- Migration scenarios
- Copy-paste framework detection
- CLI tool commands
Deliverable:
- Migration detection utilities
- Migration conversion tools
- Migration documentation
Approach:
- Implement detection of copy-paste frameworks
- Create migration conversion utilities
- Implement
migratecommand (detect, convert) - Add migration validation
- Document migration process
Key Deliverables:
cli/commands/migrate.py- Migration command- Migration detection utilities
- Migration conversion tools
- Migration documentation
Acceptance Criteria:
-
ai-dev-kit migrate --detectdetects copy-paste frameworks -
ai-dev-kit migrate --convertconverts to dependencies - Migration preserves framework files (via backup)
- Migration creates
.ai-dev-kit.yamlconfiguration - Migration validates converted state
- Migration process is documented
E6:S08:T11 – Remove command (complements FR-008)
Status: ✅ COMPLETE
Priority: MEDIUM
Dependencies: E6:S08:T02, FR-008
Blocker: None
Version: v0.6.8.11+1
Input:
- CLI tool commands
- FR-008: Package Uninstall Capabilities
- Backend implementations
Deliverable:
removecommand - Remove framework dependencies- Cleanup utilities
- Recovery mode support
Approach:
- Implement
removecommand - Add cleanup utilities (remove files, config, dependencies)
- Add recovery mode (clean up failed installations)
- Integrate with backend implementations
- Add
--keep-filesoption
Key Deliverables:
cli/commands/remove.py- Remove command- Cleanup utilities
- Recovery mode support
Acceptance Criteria:
-
ai-dev-kit remove <framework>removes framework -
--keep-filesoption preserves framework files - Cleanup removes all traces (files, config, dependencies)
- Recovery mode fixes failed installations
- Command works with all backends
Related: FR-008 (Package Uninstall Capabilities)
E6:S08:T12 – Documentation and usage examples
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T02, E6:S08:T03
Blocker: None
Version: v0.6.8.12+1
Input:
- CLI tool implementation
- Command reference documentation
- Usage scenarios
Deliverable:
- CLI command reference documentation
- Installation and usage guides
- Example workflows
- Troubleshooting guide
Approach:
- Document all CLI commands
- Create installation guide
- Create usage examples for common scenarios
- Document configuration file format
- Create troubleshooting guide
- Update existing CLI reference documentation
Key Deliverables:
- CLI command reference (update existing) ✅
- Installation guide ✅
- Usage examples ✅
- Configuration guide ✅
- Troubleshooting guide ✅
Acceptance Criteria:
- All commands are documented
- Installation guide is clear and complete
- Usage examples cover common scenarios
- Configuration file format is documented
- Troubleshooting guide addresses common issues
- Documentation is comprehensive and clear
Completed Deliverables:
- Updated
framework-dependency-cli-reference.mdwith all implemented commands (init, install, update, check, status, list, remove, config, migrate) - Created
cli-usage-examples.mdwith comprehensive usage examples and workflows - Updated
framework-dependency-installation-guide.mdto reflect CLI tool availability - Created
cli-configuration-guide.mddocumenting.ai-dev-kit.yamlformat and management - Created
cli-troubleshooting-guide.mdwith common issues and solutions - Updated
cli/README.mdwith documentation references
E6:S08:T13 – Testing, validation, and PyPI packaging
Status: ✅ COMPLETE
Priority: HIGH
Dependencies: E6:S08:T01-T12
Blocker: None
Version: v0.6.8.13+1
Input:
- Complete CLI tool implementation
- Testing requirements
- PyPI packaging requirements
Deliverable:
- Comprehensive test suite
- CLI tool validation
- PyPI package configuration
- Published package
Approach:
- Create test suite for all commands
- Create test suite for all backends
- Add integration tests
- Configure PyPI packaging (
setup.py,MANIFEST.in) - Test package installation
- Publish to PyPI (or prepare for publishing)
Key Deliverables:
- Test suite (
tests/directory) ✅ - PyPI package configuration ✅
- Package validation ✅
- Publishing documentation ✅
Acceptance Criteria:
- Test suite covers all commands
- Test suite covers all backends
- Integration tests verify end-to-end workflows
- PyPI package configuration is correct
- Package can be installed via
pip install ai-dev-kit(configuration ready) - Package validation passes (validation script created)
- Publishing process is documented
Completed Deliverables:
-
Created comprehensive test suite (
tests/directory):test_commands.py- Unit tests for all CLI commandstest_config.py- Configuration management teststest_utils.py- Utility function teststest_validation.py- Validation function teststest_backends.py- Backend implementation teststest_integration.py- Integration tests for end-to-end workflowsconftest.py- Pytest fixtures and configuration
-
Created
pytest.inifor test configuration -
Created
tests/requirements.txtfor test dependencies -
Created
tests/README.mdwith test documentation -
Updated
setup.pyfor PyPI packaging:- Dynamic version reading from
cli/__init__.py - Enhanced metadata (project URLs, keywords, classifiers)
- Proper package configuration
- Dynamic version reading from
-
Created
MANIFEST.infor package file inclusion -
Created
scripts/validate_cli.pyfor comprehensive validation -
Created
docs/documentation/user-docs/cli-publishing-guide.mdwith publishing instructions -
Updated
cli/README.mdwith development and testing instructions
Dependencies
Blocks:
- Framework dependency management (Phase 2 of framework architecture)
- Automated framework updates
- Migration from copy-paste to dependency model
- FR-008 (Package Uninstall Capabilities) - T11 complements FR-008
Blocked By:
- E6:S01 (Framework Version Management) - Must establish versioning strategy first
- E6:S02:T01 (Framework Update Procedures) - Must define update procedures first
- E6:S08:T07 blocked by E6:S01 (frameworks must be published to npm/pip first)
Coordinates With:
- Epic 5 (Documentation Management) - Documentation requirements
- Epic 2 (Workflow Management Framework) - May integrate with RW
- FR-008 (Package Uninstall Capabilities) - T11 implements remove command
References
- Feature Request: FR-030 - ai-dev-kit CLI Tool
- Epic 6:
docs/project-management/kanban/epics/Epic-6/Epic-6.md - Architecture:
docs/architecture/standards-and-adrs/framework-dependency-architecture.md(Phase 2: CLI Tool) - Design:
docs/architecture/standards-and-adrs/framework-update-cli-design.md - CLI Reference:
docs/documentation/user-docs/framework-dependency-cli-reference.md - FR-008:
FR-008-package-uninstall-capabilities.md(complements T11)
Last updated: 2025-12-22 (v0.6.8.0+0 – Story created and FR-030 intake complete)