Skip to content

Latest commit

 

History

History
100 lines (82 loc) · 3.07 KB

File metadata and controls

100 lines (82 loc) · 3.07 KB

Development Guide

Development Progress

Phase 1: MVP (Completed) ✅

  • Basic CLI framework (using cobra)
  • market add supports multiple URL formats
  • market list lists added marketplaces
  • plugin list lists installed plugins
  • Smart URL format recognition
  • marketplace.json parsing
  • Configuration file management
  • Unit test coverage

Phase 2: Core Features (Completed) ✅

  • Git operations module
  • Marketplace manager module
  • Actual marketplace cloning (Git repository)
  • Actual plugin installation logic
  • Version resolution (plugin.json + git SHA)
  • Symlink creation to OpenCode
  • Actual plugin removal logic
  • Error handling and user prompts

Phase 3: Advanced Features (Completed) ✅

  • Market update and remove commands
  • Plugin update and version management
  • Plugin info command
  • Available versions listing
  • Project scope support
  • Multi-version coexistence
  • Offline mode
  • Plugin dependency management
  • Configuration file support
  • doctor diagnostic command

Testing

# Run all unit tests
make test

# Run e2e tests (downloads real plugins)
make test-e2e

# Run tests with coverage
make test-coverage

# Run specific e2e test
go test ./test/e2e -v -run TestE2ECodeSimplifier

E2E Testing

The e2e test downloads and installs the code-simplifier plugin from the official Claude plugin marketplace. This test:

  • Uses a temporary directory (no side effects on production config)
  • Tests the complete workflow: add marketplace → install plugin → verify → remove
  • Takes ~15 seconds to run

See CONFIGURATION.md for details on the test environment system.

Project Structure

opencode-plugin-cli/
├── cmd/                           # CLI commands
│   ├── root.go
│   ├── market.go
│   ├── market_add.go
│   ├── market_update.go
│   ├── plugin.go
│   ├── plugin_install.go
│   ├── plugin_update.go
│   └── plugin_info.go
├── internal/
│   ├── marketplace/               # Marketplace management
│   │   ├── source.go              # URL format recognition
│   │   ├── parser.go              # marketplace.json parsing
│   │   ├── manager.go             # Marketplace CRUD operations
│   │   ├── git.go                 # Git operations
│   │   └── types.go
│   ├── plugin/                    # Plugin management
│   │   ├── installer.go           # Install/remove plugins
│   │   └── version.go             # Version resolution
│   ├── config/                    # Configuration management
│   │   ├── manager.go
│   │   └── types.go
│   └── opencode/                  # OpenCode integration
│       └── linker.go              # Symlink management
├── test/
│   └── fixtures/                  # Test data
├── .docs/plans/                   # Design documents
├── go.mod
├── Makefile
└── README.md