summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-10-16 20:13:59 -0600
committert <t@tjp.lol>2026-10-16 20:42:57 -0600
commit1b2efcb71ec87af985f33591145419ce6d8c70eb (patch)
tree94f3fb1b5c7cbf07f6e6fad68b2e3263e9ee1029 /README.md
initial commit; basically working
Diffstat (limited to 'README.md')
-rw-r--r--README.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d36bd73
--- /dev/null
+++ b/README.md
@@ -0,0 +1,63 @@
+# panto-opencode-go
+
+OpenCode Go defaults for panto. Mark named tables; the extension fills the boilerplate.
+
+## Setup
+
+Requires panto's `configure(config)` extension hook (before auth/provider validation).
+
+```toml
+[extensions]
+rocks = ["panto-opencode-go"]
+
+[auth.opencode]
+panto_opencode_go_extension = true
+
+[providers.go]
+auth = "opencode"
+panto_opencode_go_extension = true
+```
+
+```sh
+export OPENCODE_API_KEY='your-key'
+panto models sync
+panto models list go:
+```
+
+## Defaults
+
+| Setting | Value |
+| --- | --- |
+| Auth | API key via `${env:OPENCODE_API_KEY}`; no OAuth login |
+| APIs | Chat Completions (default), Responses, Anthropic Messages |
+| OpenAI endpoint | `https://opencode.ai/zen/go/v1` |
+| Anthropic endpoint | `https://opencode.ai/zen/go` |
+| Catalog | `opencode-go` |
+| Headers | `User-Agent: panto`, `x-opencode-session: ${session:id}` |
+
+## Rules
+
+- Only `panto_opencode_go_extension = true` opts in; auth/provider names are arbitrary.
+- Keep `providers.<name>.auth` explicit; the extension never guesses linkage.
+- Explicit values win, including nested endpoints and case-insensitive headers.
+- Defaults are independent per table/load; no config files are rewritten.
+- No network or credentials in Lua; env/session placeholders stay raw for panto.
+- Rigs must include this extension themselves; `--no-extensions` skips it.
+
+Existing flat `base_url` configurations stay flat; otherwise all three endpoints
+are filled. Overrides must remain valid panto configuration.
+
+## Packaging / checks
+
+```sh
+panto lua _selfcheck.lua
+luarocks lint panto-opencode-go-scm-1.rockspec
+```
+
+The rockspec maps `require("panto-opencode-go")` to `init.lua`; no dependencies
+beyond Lua.
+
+## References
+
+- [OpenCode Go](https://opencode.ai/docs/go/)
+- Defaults match the existing panto OpenCode Go configuration.