nixcfg/config/opencode/config.json
Harald Hoyer d0c58a5c9d feat(opencode): configure formatters and provide them on PATH
Add formatter entries for nix, prettier (md/yaml/json/web), shell,
python, toml and lua, and install the matching tools via the opencode
home module so they are available wherever opencode runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:02:53 +02:00

43 lines
1,015 B
JSON

{
"$schema": "https://opencode.ai/config.json",
"lsp": true,
"formatter": {
"nixfmt": {
"command": ["nixfmt", "$FILE"],
"extensions": [".nix"]
},
"prettier": {
"command": ["prettier", "--write", "$FILE"],
"extensions": [".md", ".yaml", ".yml", ".json", ".css", ".html", ".js", ".ts", ".jsx", ".tsx"]
},
"shfmt": {
"command": ["shfmt", "-w", "$FILE"],
"extensions": [".sh", ".bash"]
},
"ruff": {
"command": ["ruff", "format", "$FILE"],
"extensions": [".py"]
},
"taplo": {
"command": ["taplo", "format", "$FILE"],
"extensions": [".toml"]
},
"stylua": {
"command": ["stylua", "$FILE"],
"extensions": [".lua"]
}
},
"disabled_providers": ["opencode"],
"provider": {
"halo": {
"npm": "@ai-sdk/openai-compatible",
"name": "Halo",
"options": {
"baseURL": "http://halo:8000/v1"
},
"models": {
"coder": { "name": "coder" }
}
}
}
}