--- description: Commit and push OpenCode config changes to remote agent: build --- # sync-oc-push Commit and push OpenCode configuration repository changes to remote repository. ## Use Cases When you modified config files in `~/.opencode` directory (such as `command/`, `skill/`, `opencode.json`, etc.), use this command to sync changes to remote repository. ## Steps ### 1. Switch to OpenCode Config Directory ```bash cd ~/.opencode ``` ### 2. Check Change Status Run `git status` to view current changes. **If there are no changes**: - Output prompt: "No changes to commit." - **Terminate command execution** ### 3. Collect Information (Execute in parallel) - Run `git diff` to view unstaged changes - Run `git diff --cached` to view staged changes - Run `git log --oneline -5` to view recent commit history ### 4. Add Changes to Staging Area Add all relevant config files to staging area: ```bash git add command/ skill/ opencode.json ``` > Only add config files that need to be synced, ignore other local files. ### 5. Generate Commit Message and Commit Generate concise commit message based on change content: - Use [Conventional Commits](https://www.conventionalcommits.org/) specification - Common types: - `feat`: New command or config - `fix`: Fix command or config issues - `docs`: Documentation update - `chore`: Miscellaneous adjustments **Examples**: ```bash git commit -m "feat: add new developer command for Vue.js" git commit -m "fix: correct MCP server configuration" git commit -m "docs: update review command instructions" ``` ### 6. Push to Remote Repository ```bash git push origin main ``` ## Notes - **Only sync config files**: Only add `command/`, `skill/` and `opencode.json`, don't commit other local data. - **Sensitive info**: `opencode.json` may contain API keys, ensure remote repository access permissions are set correctly. - **English commit**: To avoid encoding issues, suggest using English commit messages.