@openharmonyinsight/opencode-oh
v0.1.1
Published
OpenHarmony OpenCode Helper Tool - Configure opencode with third-party model providers
Readme
opencode-oh
OpenHarmony OpenCode Helper Tool - Configure opencode with third-party model providers through an interactive TUI.
Features
- Interactive TUI interface for easy configuration
- Support for multiple providers (Volcengine, OpenAI, DeepSeek, etc.)
- API key validation before applying configuration
- Automatic backup of existing configuration
- Bilingual support (Chinese/English)
Installation
npm install -g opencode-ohUsage
Run the tool:
opencode-ohFollow the interactive prompts to:
- Select a provider
- Enter your API key
- Enter the model name
- Validate your API key
- Apply the configuration
Supported Providers
- Volcengine (火山引擎) - OpenAI-compatible API
- OpenAI - Official OpenAI API
- DeepSeek - OpenAI-compatible API
Configuration
The tool modifies ~/.config/opencode/opencode.json. Before making any changes, it automatically creates a timestamped backup file.
Development
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Run in development mode
npm run devProject Structure
src/
cli.ts # CLI entry point
index.ts # Main module
config/ # Configuration management
index.ts
types.ts
provider/ # Provider templates
templates.ts
tui/ # TUI interface
index.ts
validation/ # API key validation
index.tsLicense
MIT
