MVP OpenCode plugin that commits changes using an agent Git identity.
It does two things:
- rewrites any OpenCode-driven
git commitshell command so it uses agent author and committer env vars - auto-commits a dirty git worktree when the OpenCode session becomes idle
Clone this repo and run:
./setup.shThe installer will prompt for your agent identity and install the plugin either:
- globally into
~/.config/opencode/, or - into a specific project's
.opencode/directory
.opencode/plugins/agent-commit.js- OpenCode plugin.opencode/package.json- marks plugin code as ESMsetup.sh- interactive installer
The plugin loads config from:
~/.config/opencode/agent-commit.jsonfor global installs.opencode/agent-commit.jsonfor project installs
Environment variables still override file config when they are set:
OPENCODE_AGENT_COMMIT_ENABLEDOPENCODE_AGENT_COMMIT_REWRITE_GIT_COMMITOPENCODE_AGENT_COMMIT_ON_IDLEOPENCODE_AGENT_COMMIT_NAMEOPENCODE_AGENT_COMMIT_EMAILOPENCODE_AGENT_COMMIT_MESSAGE
- Run
./setup.sh. - Start OpenCode in a repo covered by your install.
- Make changes with the agent.
- Let the session go idle, or have the agent run a
git commitcommand.
After OpenCode makes a change, verify the latest commit identity:
git log -1 --format='%an <%ae> | %cn <%ce> | %s'The author and committer should both match your configured agent identity.
GitHub attributes commits by author email. If you want commits to show up under a separate agent profile, the email must belong to that GitHub account and be verified there.