- 更新 release-android.md: 明确前置条件和通用项目支持 - 更新 auto-commit.md: 添加中英文 commit 信息平台选择规则 - 更新 commit-push.md: 添加中英文 commit 信息平台选择规则 - 更新 sync-oc-push.md: 添加中英文 commit 信息平台选择规则 - 更新 release-android.mjs: 支持从 tags 自动推断项目名,不再硬编码 android 前缀 - 更新 AGENTS.md: 补充中文交流规则的注意事项
2.4 KiB
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 diffto view unstaged changes - Run
git diff --cachedto view staged changes - Run
git log --oneline -5to 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 configfix: Fix command or config issuesdocs: Documentation updatechore: 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/andopencode.json, don't commit other local data. - Sensitive info:
opencode.jsonmay 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.