Add local collections support with GUI, CLI, and publishing workflow

Features:
- Local collection definitions stored in ~/.cmdforge/collections/
- CLI commands: create, show, add, remove, delete, publish, status
- GUI Collections page with local and registry tabs
- Collection publishing with tool resolution and visibility checks
- New API endpoints: GET /api/v1/me, GET /api/v1/tools/.../approved,
  POST /api/v1/collections
- RegistryClient methods: get_me(), has_approved_public_tool(),
  publish_collection()

Implementation:
- collection.py: Collection dataclass, resolve_tool_references(),
  classify_tool_reference(), ToolResolutionResult
- collections_page.py: GUI with background workers for install/publish
- collections_commands.py: Full CLI command implementations
- registry/app.py: New authenticated endpoints with validation

Tests:
- test_collection.py: 27 unit tests for collection module
- test_collection_api.py: 20 tests (8 client, 12 API with Flask skip)

Documentation updated: README, CHANGELOG, CLAUDE.md, tests/README

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
rob
2026-01-26 16:50:19 -04:00
co-authored by Claude Opus 4.5
parent 37e74bf339
commit 29869ef59f
14 changed files with 2917 additions and 27 deletions
+40
View File
@@ -6,6 +6,46 @@ All notable changes to CmdForge will be documented in this file.
### Added
#### Local Collections Support
- **Local collection definitions**: Create and manage collections locally before publishing
- Collections stored as YAML files in `~/.cmdforge/collections/`
- `Collection` dataclass with name, display_name, description, tools, pinned versions, tags
- `published`, `registry_name`, `pending_approval`, `pending_tools` fields for tracking state
- **CLI commands for local collections**:
- `cmdforge collections list --local` - List local collections
- `cmdforge collections create <name>` - Create new local collection
- `cmdforge collections show <name>` - View collection details
- `cmdforge collections add <name> <tool>` - Add tool to collection
- `cmdforge collections remove <name> <tool>` - Remove tool from collection
- `cmdforge collections delete <name>` - Delete local collection
- `cmdforge collections publish <name>` - Publish collection to registry
- `cmdforge collections status <name>` - Check tool visibility and approval status
- Flags: `--dry-run`, `--force`, `--continue` for publish workflow
- **GUI Collections page**: New page for managing collections
- Local collections tab: Create, edit, delete local collections
- Registry collections tab: Browse and install from registry
- Publish workflow with tool resolution analysis
- Background workers for non-blocking install/publish operations
- **Collection publishing workflow**:
- `resolve_tool_references()` function to transform local tool names to registry refs
- Visibility checking (tools must be public)
- Approval status checking (tools must have approved version)
- Options: publish tools first, skip unpublished, or cancel
- `ToolResolutionResult` dataclass for structured resolution data
- **New API endpoints**:
- `GET /api/v1/me` - Get current authenticated user info
- `GET /api/v1/tools/<owner>/<name>/approved` - Check if tool has approved public version
- `POST /api/v1/collections` - Publish/update collection (authenticated)
- **New RegistryClient methods**:
- `get_me()` - Get current user info
- `has_approved_public_tool(owner, name)` - Check tool approval status
- `publish_collection(data)` - Publish collection to registry
#### Registry Features
- **Fork tracking and display**: Tools now track their fork origin with `forked_from` and `forked_version` metadata
- Forked tools show a "Forked from" notice on the tool detail page