Skip to content

feat: add config subcommand to manage API keys#231

Merged
johnlanni merged 1 commit into
higress-group:mainfrom
johnlanni:feature/config-subcommand
Feb 1, 2026
Merged

feat: add config subcommand to manage API keys#231
johnlanni merged 1 commit into
higress-group:mainfrom
johnlanni:feature/config-subcommand

Conversation

@johnlanni
Copy link
Copy Markdown
Contributor

Description

This PR adds a new config subcommand to the get-ai-gateway.sh script for managing LLM provider API keys.

Changes

New Commands

  • config add --provider <provider> --key <api-key> - Add or update an API key
  • config list - List all configured API keys (with masking for security)
  • config remove --provider <provider> - Remove an API key

Features

  • Support for all LLM providers (dashscope, deepseek, openai, claude, gemini, etc.)
  • User-friendly provider name mapping (e.g., qwenDASHSCOPE_API_KEY)
  • API key masking in list output (e.g., sk-ab***cd12)
  • Clear error messages and usage instructions
  • Updated help documentation with examples

Examples

# List all configured API keys
./get-ai-gateway.sh config list

# Add or update an API key
./get-ai-gateway.sh config add --provider deepseek --key sk-xxx

# Remove an API key
./get-ai-gateway.sh config remove --provider deepseek

Benefits

  • Easier management of API keys without manually editing config files
  • Better security with masked display of sensitive keys
  • Improved user experience for updating credentials

Testing

  • Syntax check passed (bash -n)
  • Command parsing works correctly
  • Help documentation updated

Related Issue

N/A

- Add config add: Add or update API key for a provider
- Add config list: List all configured API keys (with masking)
- Add config remove: Remove API key for a provider
- Support for all LLM providers (dashscope, deepseek, openai, etc.)
- User-friendly provider name mapping
- Update help documentation with examples
@johnlanni johnlanni requested a review from CH3CHO as a code owner February 1, 2026 09:02
@lingma-agents
Copy link
Copy Markdown

lingma-agents Bot commented Feb 1, 2026

🔍 代码审查进行中

⏳ 正在审查

⏰️ 剩余时间:约需数分钟

🔄 分支流向: feature/config-subcommandmain

📦 提交: 审查当前PR从5747465f15cdbc的提交。


📒 文件清单 (1 个文件)
📝 变更: 1 个文件

📝 变更文件:

  • all-in-one/get-ai-gateway.sh

@johnlanni johnlanni merged commit abdbafa into higress-group:main Feb 1, 2026
3 of 4 checks passed
@lingma-agents
Copy link
Copy Markdown

lingma-agents Bot commented Feb 1, 2026

CodeReview流程已终止

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