Add make add-model helper for interactive API key configuration#94
Merged
Conversation
Introduce an interactive helper to set or switch the API key for a containerized agent (Claude Code, DeepSeek, or Z.ai / GLM 5.2) without running the full setup wizard or hand-editing .env. - scripts/add_model.sh: lists the models with their current key status, prompts for the chosen model's key (hidden input), and writes it to .env using the same injection-safe writer as setup.sh (the value is never passed through sed; the secret is never echoed or logged; .env is chmod 600). It also prints the matching launch command when done. - Makefile: add the `add-model` target (plus its .PHONY entry). - README: new "Configuring a Model (API Keys)" section, a TOC entry, a Makefile-shortcuts row, and pointers from the DeepSeek/Z.ai tutorials. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Htst5VmusN6mUVN14vHyD4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new interactive helper script (
scripts/add_model.sh) and correspondingmake add-modeltarget to simplify configuring API keys for containerized agent models (Claude Code, DeepSeek, Z.ai) without running the full setup wizard.Key Changes
New script:
scripts/add_model.sh.envusing sed (no shell injection risk).envfrom.env.exampleif missing, with secure permissions (chmod 600)setup.shUpdated
Makefile.PHONY: add-modeldeclarationadd-modeltarget that invokes the scriptUpdated
README.mdmake add-model(recommended).envediting with reference tablemake add-modelas an optionImplementation Details
read -rsp(silent, no echo), passed only toset_env(), and never logged or printed.envmutation: Usessed -i -Eto remove any prior definition (commented or active) before appending, avoiding escaping pitfallssk-ant-*prefix and DeepSeek forsk-*prefix; unknown providers (Z.ai) always pass; user can override warningsNO_COLORenvironment variable and TTY detection, matching project conventionshttps://claude.ai/code/session_01Htst5VmusN6mUVN14vHyD4