co-mono/packages/coding-agent/test
Carlos Villela def9e4e9a9
Support shell command execution for API key resolution in models.json (#762)
* Support shell command execution for API key resolution in models.json

Add ! prefix support to apiKey field in models.json to execute shell commands
and use stdout as the API key. This allows users to store API keys in secure
credential managers like macOS Keychain, 1Password, Bitwarden, or HashiCorp Vault.

Example: "apiKey": "!security find-generic-password -ws 'anthropic'"

The apiKey field now supports three formats:
- !command - executes shell command, uses trimmed stdout
- ENV_VAR_NAME - uses environment variable value
- literal - uses value directly

fixes #697

* feat(coding-agent): cache API key command results for process lifetime

Shell commands (! prefix) are now executed once and cached. Environment
variables and literal values are not cached, so changes are picked up.

Addresses review feedback on #762.

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-01-18 19:48:06 +01:00
..
fixtures Centralize frontmatter parsing + parse frontmatter with yaml library (#728) 2026-01-16 00:31:53 +01:00
session-manager Merge hooks and custom-tools into unified extensions system (#454) 2026-01-05 01:43:35 +01:00
agent-session-branching.test.ts Rename /branch command to /fork 2026-01-11 23:12:31 +01:00
agent-session-compaction.test.ts Add tree navigation tests and shared test utilities 2025-12-30 22:42:23 +01:00
agent-session-concurrent.test.ts Fix test: update expected error message for concurrent prompt 2026-01-03 16:41:01 +01:00
agent-session-tree-navigation.test.ts Hook up custom summarization on branch switch 2026-01-12 00:09:33 +01:00
args.test.ts feat(coding-agent): add tool override support via extensions 2026-01-08 18:52:33 +01:00
block-images.test.ts Add blockImages setting to prevent images from being sent to LLM providers 2026-01-06 11:59:09 +01:00
clipboard-image.test.ts Switch to @mariozechner/clipboard fork with musl support 2026-01-08 04:50:37 +01:00
compaction-extensions-example.test.ts Merge hooks and custom-tools into unified extensions system (#454) 2026-01-05 01:43:35 +01:00
compaction-extensions.test.ts feat(coding-agent): add ExtensionAPI setLabel 2026-01-17 21:18:59 +01:00
compaction-thinking-model.test.ts fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models 2026-01-03 02:45:30 +01:00
compaction.test.ts refactor(coding-agent): fix compaction for branched sessions, consolidate hook context types 2025-12-31 02:24:24 +01:00
extensions-discovery.test.ts fix(coding-agent): update test expectations after registerFlag -- prefix removal 2026-01-11 11:44:19 +00:00
extensions-input-event.test.ts feat(coding-agent): add input event for extension input interception (#761) 2026-01-16 02:41:56 +01:00
extensions-runner.test.ts Respect reserved keybindings when registering extensions 2026-01-18 19:37:52 +01:00
frontmatter.test.ts Centralize frontmatter parsing + parse frontmatter with yaml library (#728) 2026-01-16 00:31:53 +01:00
image-processing.test.ts build(coding-agent): replaced wasm-vips with @silvia-odwyer/photon-node for image processing (#710) 2026-01-14 02:46:49 +01:00
interactive-mode-status.test.ts Coalesce sequential status messages 2026-01-01 00:28:37 +01:00
model-registry.test.ts Support shell command execution for API key resolution in models.json (#762) 2026-01-18 19:48:06 +01:00
model-resolver.test.ts Fix PR #689: Add changelog attribution, coding-agent changelog, fix test types, add provider to test suites 2026-01-13 16:46:00 +01:00
plan-mode-utils.test.ts feat(plan-mode): enhanced plan mode with explicit step tracking (#694) 2026-01-13 17:53:11 +01:00
prompt-templates.test.ts docs: document prompt template slicing 2026-01-16 12:08:57 +01:00
rpc-example.ts Update RPC example to use RpcClient 2025-12-09 14:44:13 +01:00
rpc.test.ts Consolidate session events: remove session_before_new/session_new, add reason field to switch events 2026-01-01 23:31:26 +01:00
sdk-skills.test.ts Fix --no-skills flag not preventing skills from loading 2026-01-08 23:41:54 +01:00
session-selector-search.test.ts feat(coding-agent): improve session picker search (#731) 2026-01-14 23:28:23 +01:00
settings-manager.test.ts fix(ai): filter empty error assistant messages in transformMessages 2026-01-16 22:35:50 +01:00
skills.test.ts Centralize frontmatter parsing + parse frontmatter with yaml library (#728) 2026-01-16 00:31:53 +01:00
streaming-render-debug.ts Fix syntax highlighting stderr spam with malformed markdown, fixes #274 2025-12-22 00:23:01 +01:00
system-prompt.test.ts feat(coding-agent): add tool override support via extensions 2026-01-08 18:52:33 +01:00
test-theme-colors.ts Improve light theme color contrast for WCAG compliance (#682) 2026-01-13 13:03:04 +01:00
tools.test.ts fix(ai): filter empty error assistant messages in transformMessages 2026-01-16 22:35:50 +01:00
truncate-to-width.test.ts fix: TUI crash with Unicode characters in branch selector 2025-12-05 11:59:39 +01:00
utilities.ts fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models 2026-01-03 02:45:30 +01:00