Files
dotfiles/.config/opencode/opencode.jsonc
T
colem 4f6136e88c fix(opencode): load global rules by renaming RULES.md to AGENTS.md
RULES.md was not an opencode-recognized rules filename, so global
rules (including the "no AI co-author" Git rule) were never loaded;
only the stale, un-version-controlled ~/.claude/CLAUDE.md fallback
applied, which lacked that rule. Rename to AGENTS.md so opencode
loads it natively as the global rules file.

Also add watcher.ignore for node_modules/.git/dist/.venv/target dirs.
2026-07-31 09:37:17 -05:00

140 lines
3.7 KiB
JSON

{
"$schema": "https://opencode.ai/config.json",
"permission": {
"bash": {
"*": "ask",
// Git
"git log *": "allow",
"git commit *": "ask",
"git status *": "allow",
"git diff *": "allow",
"git show *": "allow",
"git push *": "ask",
// GNU Utils
"sudo *": "deny",
"curl *": "ask",
"wget *": "ask",
"diff *": "allow",
"npm *": "allow",
"rm *": "ask",
"rm -rf *": "deny",
"grep *": "allow",
"sort *": "allow",
"head *": "allow",
"tail *": "allow",
"echo *": "allow",
"which *": "allow",
"find *": "allow",
"ls *": "allow",
"wc *": "allow",
// Go
"go build *": "allow",
"go test *": "allow",
"go vet *": "allow",
"go mod tidy": "allow",
"go mod download": "allow",
// Python
"python -m unittest *": "allow",
"python -m py_compile": "allow",
"python3 -m venv .venv": "allow",
"source .venv/bin/activate": "allow",
"ruff check *": "allow",
"ruff format --check *": "allow",
// Dotnet
"dotnet *": "allow",
// Docker
"docker ps *": "allow",
"docker logs *": "allow",
"docker compose logs *": "allow",
},
"read": {
".env": "deny",
".secrets": "deny",
"*.key": "deny",
"*.pem": "deny",
"id_rsa": "deny",
"id_ed25519": "deny",
".aws/credentials": "deny",
"~/.ssh/known_hosts": "allow",
},
"grep": "allow",
"glob": "allow",
"question": "allow",
"lsp": "allow",
"websearch": "allow",
},
"mcp": {
"zai-mcp-server": {
"type": "local",
"command": ["npx", "-y", "@z_ai/mcp-server"],
"environment": {
"Z_AI_API_KEY": "{env:ZAI_API_KEY}",
"Z_AI_MODE": "ZAI",
},
},
"web-search-prime": {
"type": "remote",
"url": "https://api.z.ai/api/mcp/web_search_prime/mcp",
"headers": {
"Authorization": "Bearer {env:ZAI_API_KEY}",
},
},
"web-reader": {
"type": "remote",
"url": "https://api.z.ai/api/mcp/web_reader/mcp",
"headers": {
"Authorization": "Bearer {env:ZAI_API_KEY}",
},
},
"zread": {
"type": "remote",
"url": "https://api.z.ai/api/mcp/zread/mcp",
"headers": {
"Authorization": "Bearer {env:ZAI_API_KEY}",
},
},
"ibmi-server": {
"type": "local",
"command": [
"npx",
"-y",
"@ibm/ibmi-mcp-server@latest",
"--tools",
"{env:HOME}/.config/opencode/mcp/ibmi-mcp-server/tools/custom-tools.yaml",
],
"enabled": false,
"environment": {
"DB2i_HOST": "{env:DB2i_HOST}",
"DB2i_USER": "{env:DB2i_USER}",
"DB2i_PASS": "{env:DB2i_PASS}",
"DB2i_PORT": "8076",
"DB2i_IGNORE_UNAUTHORIZED": "true",
},
},
},
"watcher": {
"ignore": ["node_modules/**", ".git/**", "dist/**", "**/.venv/**", "**/target/**"],
},
"lsp": true,
"formatter": true,
"model": "zai-coding-plan/glm-5.2",
"small_model": "zai-coding-plan/glm-4.5-air",
"agent": {
"explore": {
"model": "zai-coding-plan/glm-4.5-air",
},
"scout": {
"model": "zai-coding-plan/glm-4.5-air",
},
},
"share": "disabled",
"snapshot": true,
// OpenCode Quota: tuiCommandDisplay chooses whether native TUI command output appears in the session transcript or a local popup dialog.
// OpenCode Quota: loads the server plugin for slash commands and quota checks.
"plugin": ["./plugins/ibmi-gate.ts", "@slkiser/opencode-quota@latest"],
"provider": {
// Detected zai authentication; opencode-quota added this global provider declaration.
"zai": {},
},
}