Files
opencode/command/sync-oc-push.md
2026-01-12 17:39:49 +08:00

2.4 KiB

description, agent
description agent
Commit and push OpenCode config changes to remote 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

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:

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 specification
  • Language selection:
    • Default (macOS/Linux): Use Chinese (中文) for commit messages
    • Windows: Use English due to encoding issues with Cursor Shell tool
  • Common types:
    • feat: New command or config
    • fix: Fix command or config issues
    • docs: Documentation update
    • chore: Miscellaneous adjustments

Examples (macOS/Linux - Chinese):

git commit -m "feat: 添加 Vue.js 开发命令"
git commit -m "fix: 修正 MCP 服务器配置"
git commit -m "docs: 更新 review 命令说明"

Examples (Windows - English):

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

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.
  • Commit message language: Default use Chinese (macOS/Linux); Windows must use English due to Cursor Shell tool encoding issues.