### Install dependencies and build Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/README.md Prepares the environment and builds the plugin after generation. ```bash cd my-plugin bun install mise run build ``` -------------------------------- ### Execute setup script commands Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/README.md Provides options for generating a plugin, viewing help, or checking the version. ```bash # Generate a new plugin (interactive prompts) ./setup.sh generate # Show help ./setup.sh help # Show version ./setup.sh version ``` -------------------------------- ### Run the generator script Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/README.md Executes the setup script to initialize the plugin structure. ```bash ./setup.sh ``` -------------------------------- ### Install Dependencies Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/README.md Installs project dependencies using the Bun package manager. ```bash bun install ``` -------------------------------- ### Clone the Template Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/README.md Initializes a new plugin project by copying the template directory. ```bash cp -r opencode-plugin-template your-plugin-name cd your-plugin-name ``` -------------------------------- ### Clone the template repository Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/README.md Initializes a new project by cloning the template from GitHub. ```bash git clone https://github.com/zenobi-us/opencode-plugin-template.git my-plugin cd my-plugin ``` -------------------------------- ### Available development scripts Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/README.md Lists common commands for managing the plugin lifecycle. ```bash bun install # Install dependencies mise run setup # Initial setup mise run build # Build the plugin mise run test # Run tests mise run lint # Lint code mise run lint:fix # Fix linting issues mise run format # Format code with Prettier mise run pkgjsonlint # Lint package.json mise run prepare # Prepare for release mise run publish # Publish the plugin mise run version # Manage version ``` -------------------------------- ### View project structure Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/README.md Displays the directory layout of a generated plugin. ```text my-plugin/ ├── src/ │ ├── index.ts # Plugin entry point │ ├── version.ts # Version info │ └── commands/ # Your plugin commands ├── .github/ │ └── workflows/ # CI/CD workflows ├── package.json # Dependencies and scripts ├── tsconfig.json # TypeScript config └── README.md # Your plugin's documentation ``` -------------------------------- ### Trigger a manual release Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/RELEASE.md Manually initiate a release by pushing a semver-formatted tag. ```bash git tag v1.2.3 git push origin v1.2.3 ``` -------------------------------- ### Configure OpenCode Plugin Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/README.md Registers the plugin in the OpenCode configuration file. ```json { "plugins": ["{{pluginName}}"] } ``` -------------------------------- ### Configure extra files for versioning Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/RELEASE.md Define additional files to be updated during a release in release-please-config.json. ```json { "extra-files": [ "src/version.ts", { "type": "generic", "path": "docs/VERSION.md" }, { "type": "yaml", "path": ".tool-versions", "jsonpath": "$.node" } ] } ``` -------------------------------- ### Run Tests Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/README.md Executes the test suite using the Mise task runner. ```bash mise run test ``` -------------------------------- ### Force a specific version with Release-As Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/RELEASE.md Use the Release-As footer in a commit message to override automated versioning. ```bash git commit --allow-empty -m "chore: release 2.0.0" -m "Release-As: 2.0.0" ``` ```text chore: release 2.0.0 Release-As: 2.0.0 ``` -------------------------------- ### Use magic comments for version markers Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/RELEASE.md Mark specific locations in code or documentation for automated version updates. ```javascript // x-release-please-version const VERSION = '1.0.0'; // x-release-please-major const MAJOR = '1'; ``` ```markdown - Current version: 1.0.0 ``` -------------------------------- ### Implement Plugin Logic Source: https://github.com/zenobi-us/opencode-plugin-template/blob/main/template/README.md Defines the plugin structure in the main source file using the OpenCode Plugin type. ```typescript import type { Plugin } from '@opencode-ai/plugin'; export const YourPlugin: Plugin = async (ctx) => { return { tool: { // Your plugin tools here }, }; }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.