Skip to content

feat: add env configuration option #21

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

totalolage
Copy link

  • Add env field to config for passing environment variables to Claude CLI
  • Update init.lua to pass env variables when spawning Claude terminal
  • Allows users to set custom environment like ANTHROPIC_API_KEY

- Add env field to config for passing environment variables to Claude CLI
- Update init.lua to pass env variables when spawning Claude terminal
- Allows users to set custom environment like ANTHROPIC_API_KEY

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'd personally remove the vim.fn.getenv for the CLAUDE_TERMINAL_CMD and mention it in the docs if someone has that use case.

Comment on lines +87 to +93
-- Check environment variable for terminal_cmd if not set in user config
if config.terminal_cmd == nil then
local env_cmd = vim.fn.getenv("CLAUDE_TERMINAL_CMD")
if env_cmd ~= vim.NIL then
config.terminal_cmd = env_cmd
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have the user configure that in their settings and then pass that value into the terminal_cmd instead of us doing it here.

Comment on lines +101 to +102


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be removed if you run nix fmt

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants