You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 61ed714
Browse filesBrowse the repository at this point in the historyBrowse files
feat(providers): read provider keys from the freedesktop keyring
A plugin started by the graphical session inherits the user manager's
environment and never an interactive shell's exports, so a key exported in
~/.bashrc never reaches an adapter. The OpenRouter, GLM / Z.ai and OpenCode
Go adapters can now read the key from the keyring at the moment of use.
The environment carries only a lookup spec, AIOC_VAULT_OPENROUTER and its
siblings, which names the secret-tool attributes. The spec is not a secret,
so it can live in a display manager or user-service environment file, and
the key never enters a process environment, a child process, a cache or a
log. An exported key still wins, and AIOC_VAULT_TIMEOUT bounds the lookup so
a locked keyring cannot stall a refresh. Readiness accepts a spec without
performing a lookup, so the settings page cannot raise a prompt.
The test covers the key reaching curl, exported-key precedence, the bound, a
missing secret-tool, and readiness without a lookup.
Signed-off-by: Álvaro Tejero Cantero <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
## Unreleased
4
4
5
+
### Providers
6
+
7
+
- A provider key can come from the freedesktop keyring, read at the moment of use, for a session that never exported it. `AIOC_VAULT_OPENROUTER`, `AIOC_VAULT_ZAI`, and `AIOC_VAULT_OPENCODE` name the `secret-tool lookup` words for an entry, and the OpenRouter, GLM / Z.ai, and OpenCode Go adapters use that key when the environment has none. The spec is not a secret, so it can live in a display manager or user-service environment file. An exported key still wins, and `AIOC_VAULT_TIMEOUT` (default 3 s) bounds the lookup so a locked keyring cannot stall a refresh. Readiness accepts a spec without performing a lookup, so the settings page cannot raise a prompt.
8
+
5
9
## 2.2.4 - 2026-11-04
6
10
7
11
A bug-fix release for Dux Shell 2.0 and 2.1, the shell formerly called DankMaterialShell. The Claude card stops polling Anthropic's usage endpoint while it is rate-limited, sharing one backoff across every bar, and the bar fades numbers that are no longer fresh. The docs and settings strings use the Dux Shell names, and the documented checkout install works again. Settings, profiles, pins and history carry over unchanged; no restart is needed.
For a durable environment-variable setup, configure your display manager or user-service environment rather than relying on an interactive shell.
120
120
121
+
### Keys from the keyring
122
+
123
+
A provider key can come from the freedesktop keyring instead, read at the moment of use. Give the provider a lookup spec and the adapter runs `secret-tool lookup` with those words whenever the environment has no key:
The spec names the attributes the entry is stored under, so it is not a secret and can live in the display manager's or the user service's environment file. The key itself never enters the process environment, a child process, a cache or a log. An exported key still wins, so an existing setup keeps working unchanged. `AIOC_VAULT_TIMEOUT` bounds the lookup in seconds (default 3): a locked keyring raises a prompt and waits, and the refresh continues without a key rather than blocking. Readiness accepts a spec without performing a lookup, so opening the settings never raises a prompt.
132
+
121
133
## Provider readiness labels
122
134
123
135
The settings health check describes whether the plugin can run an adapter in the current shell process; it is not a claim that the provider publishes a quota API.
@@ -132,12 +144,13 @@ The settings health check describes whether the plugin can run an adapter in the
132
144
| Copilot |`COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `GITHUB_TOKEN`; `AIOC_NO_DOH_FALLBACK=1` disables the `dns.google` DNS-over-HTTPS fallback used to resolve an alternate `api.github.com` edge after a regional route fails (TLS hostname verification stays enabled either way) |
133
145
| Antigravity | No environment variable is normally required. Credentials are discovered from `~/.gemini/antigravity-cli/antigravity-oauth-token`, the desktop keyring, or the IDE state database. Optional `ANTIGRAVITY_API_BASE_URL` retargets Cloud Code Assist; `ANTIGRAVITY_QUOTA_METHOD` can pin the compatibility method for diagnostics. |
134
146
| Gemini | Gemini CLI sign-in (`~/.gemini/oauth_creds.json`) for per-model quota with a Code Assist Standard or Enterprise project; optional `GOOGLE_CLOUD_PROJECT` (or `GOOGLE_CLOUD_PROJECT_ID`) selects the project. Otherwise `GEMINI_API_KEY`, `GOOGLE_API_KEY`, or `GOOGLE_GENERATIVE_AI_API_KEY` for a key check. The CLI token is renewed in memory only; `GEMINI_CLI_OAUTH_CLIENT_ID`, `GEMINI_CLI_OAUTH_CLIENT_SECRET`, `GEMINI_CLI_TOKEN_URL` and `GEMINI_CODE_ASSIST_ENDPOINT` override the CLI's defaults for diagnostics |
135
-
| OpenRouter |`OPENROUTER_API_KEY`|
147
+
| OpenRouter |`OPENROUTER_API_KEY`, or `AIOC_VAULT_OPENROUTER` for a keyring entry |
148
+
| OpenCode |`OPENCODE_API_KEY`, or `AIOC_VAULT_OPENCODE` for a keyring entry; otherwise the CLI's `~/.local/share/opencode/auth.json`|
136
149
| DeepSeek |`DEEPSEEK_API_KEY`|
137
150
| Kimi | Balance: `MOONSHOT_API_KEY` or `KIMI_API_KEY` (optional `MOONSHOT_API_BASE`). Kimi Code subscription quota: `KIMI_CODING_API_KEY` (or a `sk-kimi-` prefixed `KIMI_API_KEY`; optional `KIMI_CODE_BASE_URL`; legacy `KIMI_BASE_URL` also accepted) |
138
151
| MiniMax |`MINIMAX_TOKEN_PLAN_KEY` (Token Plan Subscription Key, `sk-cp-...`) — backward-compatible: a `sk-cp-` value in `MINIMAX_API_KEY` is also recognised. PAYG `sk-api-` keys stay on `MINIMAX_API_KEY` and surface auth-only; set both to keep an auth-only card when the Token Plan endpoint is unreachable. Optional `MINIMAX_API_BASE` retargets both read-only endpoints at a gateway or mirror. |
139
152
| Command Code |`COMMAND_CODE_API_KEY`, or the `apiKey` saved by `cmd login` in `~/.commandcode/auth.json`|
140
-
| GLM / Z.ai |`ZAI_API_KEY`, `GLM_API_KEY`, or `ZHIPU_API_KEY`; optional `GLM_API_BASE`|
153
+
| GLM / Z.ai |`ZAI_API_KEY`, `GLM_API_KEY`, or `ZHIPU_API_KEY`, or `AIOC_VAULT_ZAI` for a keyring entry; optional `GLM_API_BASE`|
141
154
| Mistral |`MISTRAL_API_KEY`|
142
155
| Ollama | optional `OLLAMA_HOST`; requires the `ollama` CLI in PATH |
Copy file name to clipboardExpand all lines: docs/providers.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,7 @@ The matrix below summarises the **authentication/billing surface** for every sup
151
151
<td>✅ per-window % + reset timestamp</td>
152
152
<td>✅ GLM Coding Plan $18–$160/mo</td>
153
153
<td>✅ per token</td>
154
-
<td><code>ZAI_API_KEY</code> / <code>GLM_API_KEY</code> (<code>ZHIPU_API_KEY</code> also accepted; precedence depends on the adapter — see <ahref="#glm--zai-zhipu-ai">GLM / Z.ai</a>)</td>
154
+
<td><code>ZAI_API_KEY</code> / <code>GLM_API_KEY</code> (<code>ZHIPU_API_KEY</code> also accepted; precedence depends on the adapter — see <ahref="#glm--zai-zhipu-ai">GLM / Z.ai</a>), or a keyring entry (<code>AIOC_VAULT_ZAI</code>)</td>
Copy file name to clipboardExpand all lines: providers/native/opencode.bash
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ fetch_opencode_native() {
45
45
local key
46
46
key="$(opencode_api_key)"
47
47
if [ -z"$key" ];then
48
-
json_error opencode opencode-api 2 provider "OpenCode credentials are unavailable. Set OPENCODE_API_KEY or run 'opencode auth login' so ~/.local/share/opencode/auth.json has a key."
48
+
json_error opencode opencode-api 2 provider "OpenCode credentials are unavailable. Set OPENCODE_API_KEY, set AIOC_VAULT_OPENCODE for a keyring entry, or run 'opencode auth login' so ~/.local/share/opencode/auth.json has a key."
Copy file name to clipboardExpand all lines: providers/native/openrouter.bash
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
# Sourced adapter; shared transport/normalization helpers live in get-provider-usage.
2
2
fetch_openrouter_native() {
3
3
local key="${OPENROUTER_API_KEY:-}"
4
+
[ -n"$key" ] || key="$(vault_key openrouter)"
4
5
if [ -z"$key" ];then
5
-
json_error openrouter openrouter-api 2 provider "OPENROUTER_API_KEY is not set and no local 9Router usage was found."
6
+
json_error openrouter openrouter-api 2 provider "OPENROUTER_API_KEY is not set, AIOC_VAULT_OPENROUTER has no keyring entry, and no local 9Router usage was found."
0 commit comments