- Basic CLI framework (using cobra)
-
market addsupports multiple URL formats -
market listlists added marketplaces -
plugin listlists installed plugins - Smart URL format recognition
- marketplace.json parsing
- Configuration file management
- Unit test coverage
- 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
- 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
-
doctordiagnostic command
# 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 TestE2ECodeSimplifierThe 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.
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