Skip to content

feat: file-based config (~/.config/lmnr/claude-code-plugin.json), drop userConfig - #4

Merged
kolbeyang merged 1 commit into
mainfrom
feat/file-based-config
Jul 13, 2026
Merged

kolbeyang merged 1 commit into
mainfrom
feat/file-based-config

Conversation

@kolbeyang

@kolbeyang kolbeyang commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Makes the Claude Code plugin symmetric with the Codex plugin: the project API key comes from a laminar-owned per-agent file, not Claude Code's keychain userConfig.

Why

Codex has no per-plugin secret store. To keep both plugins on one mental model (and let lmnr-cli plugin add own key delivery), the key now lives in ~/.config/lmnr/<agent>-plugin.json — the same directory both plugins already read for user_id (credentials.json).

Changes

  • config.ts: read projectApiKey/baseUrl from ~/.config/lmnr/claude-code-plugin.json; LMNR_PROJECT_API_KEY/LMNR_BASE_URL env still override.
  • .claude-plugin/plugin.json: remove userConfig — zero-prompt install, no --config.
  • New test for file resolution + env override; README/CLAUDE.md updated; dist/hook.cjs rebuilt.

Coupling

Pairs with lmnr-ts PR #279 (CLI writes the file and installs without --config). Merge together.

Tested

npm test (57 pass, incl. new), typecheck, build, claude plugin validate passes.

🤖 Generated with Claude Code


Note

Medium Risk
Changes where the Laminar project API key is read (plaintext file vs former plugin secret store); tracing fails open if unset, but misconfiguration could send traces to the wrong project or nowhere until the CLI file exists.

Overview
Aligns Claude Code plugin setup with the Codex plugin by sourcing the project API key and base URL from ~/.config/lmnr/claude-code-plugin.json (written by lmnr-cli plugin add claude-code) instead of Claude Code’s userConfig prompts.

getLaminarConfig() now loads projectApiKey / baseUrl from that file (fail-open if missing), with LMNR_PROJECT_API_KEY / LMNR_BASE_URL still overriding for CI or existing shell config. .claude-plugin/plugin.json drops userConfig so install is zero-prompt.

Docs switch install to lmnr-cli plugin add claude-code; dist/hook.cjs is rebuilt. A new test covers file resolution and env override.

Reviewed by Cursor Bugbot for commit 99a1985. Bugbot is set up for automated code reviews on this repo. Configure here.

….json

Symmetric, file-based config shared with the Codex plugin. Codex has no
per-plugin secret store, so both plugins now read the key from a laminar-owned
per-agent file (written by `lmnr-cli plugin add claude-code`) instead of Claude
Code's keychain-backed userConfig.

- config.ts: resolve projectApiKey/baseUrl from ~/.config/lmnr/claude-code-plugin.json;
  LMNR_PROJECT_API_KEY / LMNR_BASE_URL env still override (CI / existing shells).
- plugin.json: drop userConfig entirely — the plugin installs with zero prompts
  and no `--config`, matching the Codex plugin's zero-config install.
- Test covers file resolution + env override; README/CLAUDE.md updated; dist rebuilt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kolbeyang
kolbeyang merged commit 4e28aad into main Jul 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant