bunx @activade/opencode-auth-sync
The interactive setup wizard will check prerequisites, list your repositories, and configure the plugin automatically.
OpenCode plugin that automatically syncs your authentication credentials to GitHub repositories as secrets whenever they change.
When using OpenCode with Claude Max, OpenAI, or other OAuth providers, your tokens refresh periodically. This plugin watches for those changes and automatically syncs the updated credentials to your GitHub repositories, keeping your CI/CD workflows authenticated.
bunx @activade/opencode-auth-sync
The interactive setup wizard will:
Running the wizard again will merge your changes with the existing configuration, preserving any custom settings like debounceMs or credentialsPath that you've modified.
Add to ~/.config/opencode/opencode.json:
{
"plugin": [
"@activade/opencode-auth-sync"
]
}
Create ~/.config/opencode/opencode-auth-sync.json:
{
"$schema": "https://raw.githubusercontent.com/activadee/opencode-auth-sync/main/schema.json",
"enabled": true,
"repositories": [
"your-username/repo1",
"your-org/private-repo"
]
}
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable/disable the plugin |
credentialsPath |
string | ~/.local/share/opencode/auth.json |
Path to OpenCode auth file |
secretName |
string | OPENCODE_AUTH |
GitHub secret name |
repositories |
string[] | [] |
Repositories to sync (owner/repo format) |
debounceMs |
number | 1000 |
Debounce delay for file changes |
authFileHashes |
object | (auto-managed) | Per-repository SHA-256 hashes of last synced auth.json (managed by plugin) |
gh auth login)~/.local/share/opencode/auth.json for changesgh secret setThe hash-based change detection reduces unnecessary GitHub API calls when file metadata changes but content remains the same.
# .github/workflows/example.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup OpenCode Auth
run: |
mkdir -p ~/.local/share/opencode
echo '${{ secrets.OPENCODE_AUTH }}' > ~/.local/share/opencode/auth.json
- name: Extract Anthropic Token
run: |
ANTHROPIC_TOKEN=$(echo '${{ secrets.OPENCODE_AUTH }}' | jq -r '.anthropic.access')
echo "::add-mask::$ANTHROPIC_TOKEN"
echo "ANTHROPIC_API_KEY=$ANTHROPIC_TOKEN" >> $GITHUB_ENV
The auth file contains credentials for all configured OpenCode providers:
anthropic - Claude Max (OAuth)openai - ChatGPT Plus/Pro (OAuth)google - Gemini (OAuth)bun test
bun run type-check
bun run build
MIT
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler
Awesome Claude Code Settings
Production-ready Claude Code settings.json with recommended configuration for development workflows.
by AgentHub Crawler
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler
Sign in to leave a comment.