Skip to content

qiniu/coding-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ qiniu-coding-helper

npm version License: AGPL-3.0 Node.js Version

The CLI helper for configuring Claude Code with Qiniu AI API endpoints

็ฎ€ไฝ“ไธญๆ–‡ ยท Features ยท Quick Start ยท Commands ยท Configuration ยท FAQ


โœจ Features

  • ๐ŸŽฏ Interactive Wizard โ€” Guided step-by-step setup for language, endpoint, API Key, and model on first run
  • ๐ŸŒ Multi-Region Support โ€” Domestic (api.qnaigc.com) / International (openai.sufy.com) endpoints
  • ๐Ÿ” API Key Management โ€” Input, validate, save, and revoke API keys
  • ๐Ÿ“ฆ Model Configuration โ€” Fetch available models from the API, with manual model ID input support
  • โšก Claude Code Integration โ€” Automatically writes environment variables to ~/.claude/settings.json
  • ๐Ÿ” Health Check โ€” Built-in doctor command to verify config, API Key, network, tools, Git, and Node.js
  • ๐ŸŒ Internationalization โ€” Supports Chinese (zh_CN) and English (en_US)

๐Ÿ“‹ Prerequisites

Before you begin, ensure you have:

๐Ÿš€ Quick Start

1๏ธโƒฃ Run the Setup Wizard

No installation required โ€” just run:

npx qiniu-coding-helper

2๏ธโƒฃ Follow the Interactive Prompts

  • Select your language (Chinese / English)
  • Choose your endpoint (Domestic / International)
  • Enter and validate your API Key
  • Pick a model

3๏ธโƒฃ Restart Claude Code

If Claude Code is running, restart it to apply changes.

4๏ธโƒฃ Start Coding! ๐ŸŽ‰

claude

That's it! You're now using Qiniu AI endpoints in Claude Code.


๐Ÿ“š Commands

๐ŸŽฌ coding-helper init

Run the interactive setup wizard (force re-initialization).

npx qiniu-coding-helper init

๐Ÿ” coding-helper auth

Manage your API Key authentication.

# Set API Key interactively
npx qiniu-coding-helper auth

# Set API Key directly
npx qiniu-coding-helper auth <token>

# Remove API Key
npx qiniu-coding-helper auth revoke

# Reload configuration to Claude Code
npx qiniu-coding-helper auth reload claude

๐ŸŒ coding-helper lang

Manage interface language.

# Show current language
npx qiniu-coding-helper lang show

# Set to Chinese
npx qiniu-coding-helper lang set zh_CN

# Set to English
npx qiniu-coding-helper lang set en_US

๐Ÿฅ coding-helper doctor

Run system health check to diagnose configuration issues.

npx qiniu-coding-helper doctor

Checks: Config files ยท API Key validity ยท Network connectivity ยท Claude Code installation ยท Git ยท Node.js


โš™๏ธ coding-helper enter

Enter the interactive configuration menu.

# Main menu
npx qiniu-coding-helper enter

# Claude Code configuration menu
npx qiniu-coding-helper enter claude-code

๐Ÿ”ง Configuration

๐Ÿ“ Storage Locations

Location Path Purpose
Coding Helper Config ~/.coding-helper/config.yaml Language, endpoint, API Key, model settings
Claude Code Settings ~/.claude/settings.json API endpoint environment variables
Claude Code Onboarding ~/.claude.json Onboarding completion flag

๐ŸŒ Region Endpoints

Region Base URL Best For
๐Ÿ‡จ๐Ÿ‡ณ Domestic https://api.qnaigc.com Users in China
๐ŸŒ International https://openai.sufy.com Users outside China

๐Ÿ”ง Claude Code Environment Variables

When configuration is applied, these environment variables are set in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.qnaigc.com",
    "ANTHROPIC_AUTH_TOKEN": "<your-api-key>",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Note: The tool also sets API_TIMEOUT_MS (50 min, for long inference requests), disables non-essential traffic (telemetry not needed for third-party endpoints), and disables commit/PR attribution (inaccurate via proxy endpoints).


โ“ FAQ

Claude Code doesn't use the configured endpoint

  1. Run npx qiniu-coding-helper doctor to check configuration
  2. Run npx qiniu-coding-helper auth reload claude to reapply settings
  3. Restart Claude Code completely
  4. Ensure ANTHROPIC_BASE_URL is not set in your shell environment (unset ANTHROPIC_BASE_URL)

API errors or authentication failures

  1. Verify your API Key: check ~/.coding-helper/config.yaml
  2. Confirm the correct endpoint is selected (Domestic vs International)
  3. Ensure your API Key has remaining quota on the Qiniu Portal

Permission denied errors

chmod 600 ~/.claude/settings.json
chmod 600 ~/.coding-helper/config.yaml

๐Ÿ› ๏ธ Development

pnpm install        # Install dependencies
pnpm build          # Build (tsc + copy locales to dist/)
pnpm dev            # Watch mode
pnpm start          # Run CLI (node dist/cli.js)
pnpm clean          # Clean dist/

Verify after build:

node dist/cli.js --version
node dist/cli.js --help
node dist/cli.js doctor

๐Ÿ“„ License

This project is licensed under the AGPL-3.0 License.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors