Run OpenCode directly against a Scaleway serverless model — one command, no proxy, no config file. Defaults to GLM 5.2.
pks opencode [ARGS] [--model <id>]$ pks opencodeStart OpenCode on GLM 5.2 (the default) on Scaleway
$ pks opencode --model glm-5.2Explicitly select GLM 5.2
$ pks opencode run --format json "Reply with exactly: OK"One-shot, non-interactive run — args pass through to the opencode CLI
pks opencode launches the OpenCode CLI directly against Scaleway's OpenAI-compatible serverless API. It is the no-proxy sibling of pks claude scaleway: where that command hosts a local Anthropic→OpenAI translation proxy for Claude Code, this one hands OpenCode a Scaleway provider and lets it call api.scaleway.ai/v1 itself.
The default model is GLM 5.2 (glm-5.2). Run pks opencode with no arguments and you are in.
Use an installed pks command, run the NuGet tool directly with .NET 10, or run the npm package without installing it globally:
dotnet tool install --global pks-cli
pks scaleway init
pks opencode --model glm-5.2opencode CLI on your PATH. Install it from opencode.ai — npm install -g opencode-ai. Without it, the command exits 127 with that instruction.pks scaleway init. Stores your Scaleway secret key. Without it the command exits 1 with that instruction. If you have already authenticated for GPU or pks claude scaleway work, you are done.OpenCode reads its provider list from a config file (opencode.json). Editing that file by hand is friction — and writing a Scaleway secret into it is a leak. pks opencode does neither:
pks scaleway init.OPENCODE_CONFIG_CONTENT environment variable — OpenCode's runtime-override mechanism, which has the highest effective priority.PKS_SCALEWAY_API_KEY, referenced inside the inline config as {env:PKS_SCALEWAY_API_KEY}.The result: the provider registration is process-local. Your opencode.json stays untouched, and the secret is not duplicated into OpenCode configuration or placed on the command line.
pks opencode
OpenCode opens against scaleway/glm-5.2. The model id passed to OpenCode is always scaleway/<model>.
pks opencode --model glm-5.2
The default is already glm-5.2, so this is equivalent — but it documents intent. Any Scaleway serverless model id is accepted verbatim, so brand-new models work before any local catalog knows about them. A scaleway/ prefix is stripped if present, so --model scaleway/glm-5.2 and --model glm-5.2 are identical.
pks opencode run --format json "Reply with exactly: OK"
Everything after the options is forwarded verbatim to the opencode CLI. Use run, --format, --continue, or any native OpenCode argument.
If you have ever run pks scaleway init (for GPU work, for pks claude scaleway, or otherwise), you are already at step 2:
pks scaleway init # once — stores your Scaleway secret key
pks opencode --model glm-5.2 # every time after — launches OpenCode on GLM 5.2
| Argument | Required | Description |
|---|---|---|
ARGS | no | Additional arguments passed through to the opencode CLI (e.g. run --format json "..."). |
| Flag | Default | Description |
|---|---|---|
-m, --model <id> | glm-5.2 | Scaleway serverless model id. A scaleway/ prefix is accepted and stripped. |
pks opencode --model glm-5.2
OpenCode launches and its model selector shows scaleway/glm-5.2. Send a prompt and confirm the reply.
| Symptom | Cause and fix |
|---|---|
Exit 1 naming pks scaleway init | No stored Scaleway secret key. Run pks scaleway init. |
Exit 127 naming the opencode CLI | OpenCode is not on PATH. Install it: npm install -g opencode-ai. |
| Model not found at runtime | Unrecognized ids pass through verbatim by design. Check the spelling against the Scaleway serverless catalog. The endpoint is https://api.scaleway.ai/v1. |
Your opencode.json was not modified | This is intentional. The provider config is injected per-process via OPENCODE_CONFIG_CONTENT and never written to disk. |