Skip to content

aminechraibi/cc-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc-wrapper

Cross-platform CLI wrapper for Claude Code with named environment profiles, arg passthrough, and zero config friction.

npm version npm downloads License: MIT Node.js >= 20 Platform

Switch between Claude environments — local proxies, OpenRouter, AWS Bedrock, Google Vertex AI — with a single command instead of exporting env vars every time.

# Before cc-wrapper
ANTHROPIC_BASE_URL=http://localhost:8787 ANTHROPIC_AUTH_TOKEN=my-token claude

# After cc-wrapper
cc-wrapper claude

Table of Contents


Features

  • Named profiles — save multiple Claude environments (local, openrouter, vertex, bedrock, etc.)
  • Interactive setup — searchable env var selector with descriptions and example values
  • Auto --dangerously-skip-permissions — injected by default, disable with --dd
  • Full arg passthrough — all extra args forwarded to claude unchanged
  • Cross-platform — Windows, macOS, Linux; config stored at correct OS path automatically
  • Secret masking — API keys and tokens masked in all log output
  • Live sync — fetch latest Claude env vars from official docs with npm run sync-envs

Requirements


Installation

npm install -g cc-wrapper

Verify:

cc-wrapper --version
cc-wrapper --help

Quick Start

1. Create your first profile:

cc-wrapper new

You will be prompted for:

  • Profile name (e.g. local, openrouter, vertex)
  • Which Claude env vars to set (searchable, numbered list with descriptions)
  • Value for each selected env var (with examples shown inline)
  • Default extra args to pass to claude

2. Run Claude with the profile:

cc-wrapper claude

Commands

cc-wrapper new

Create a new named profile interactively.

cc-wrapper new

Flow:

  1. Enter profile name
  2. Multi-select env vars from numbered list (SPACE to toggle, ENTER to confirm)
  3. Enter value for each selected var (example shown inline)
  4. Enter default claude args
  5. Profile saved — set as default if it's the first one

cc-wrapper list

List all saved profiles. Default profile is highlighted.

cc-wrapper list
● local  (default)
○ openrouter
○ vertex

cc-wrapper default <name>

Set the default profile used by cc-wrapper claude.

cc-wrapper default openrouter

cc-wrapper edit <name>

Interactively edit an existing profile. Current values are pre-filled and masked.

cc-wrapper edit local

cc-wrapper delete <name>

Delete a profile (confirmation prompt required).

cc-wrapper delete vertex

If the deleted profile was the default, the next available profile becomes the new default automatically.


cc-wrapper show <name>

Display all env vars and args stored in a profile. Secret values (keys, tokens, passwords) are masked.

cc-wrapper show local

Output example:

cc-wrapper › local (default)

  env:
    ANTHROPIC_BASE_URL    http://localhost:8787
    ANTHROPIC_API_KEY     sk-a*****

  args: --dangerously-skip-permissions

cc-wrapper claude [args...]

Launch claude with the default profile's environment variables injected.

cc-wrapper claude

Pass extra args directly to claude:

cc-wrapper claude --print "explain this codebase"
cc-wrapper claude --model claude-opus-4-7-20250514
cc-wrapper claude --no-stream

Disable automatic --dangerously-skip-permissions injection:

cc-wrapper claude --dd

Use a specific profile instead of default:

cc-wrapper claude --profile openrouter
cc-wrapper claude -p vertex --print "hello"

Configuration

Config is stored as a single JSON file at the OS-appropriate path:

OS Path
Linux ~/.config/cc-wrapper/config.json
macOS ~/Library/Preferences/cc-wrapper/config.json
Windows %APPDATA%\cc-wrapper\config.json

Config schema

{
  "default": "local",
  "configs": {
    "local": {
      "env": {
        "ANTHROPIC_BASE_URL": "http://localhost:8787",
        "ANTHROPIC_AUTH_TOKEN": "my-token"
      },
      "args": []
    },
    "openrouter": {
      "env": {
        "ANTHROPIC_BASE_URL": "https://openrouter.ai/api/v1",
        "ANTHROPIC_API_KEY": "sk-or-..."
      },
      "args": ["--model", "anthropic/claude-opus-4"]
    },
    "vertex": {
      "env": {
        "CLAUDE_CODE_USE_VERTEX": "1",
        "ANTHROPIC_VERTEX_PROJECT_ID": "my-gcp-project",
        "CLOUD_ML_REGION": "us-central1"
      },
      "args": []
    }
  }
}

You can edit this file directly or use cc-wrapper edit <name>.


Supported Environment Variables

cc-wrapper supports all official Claude Code environment variables. The list is stored in src/data/env-vars.json and can be refreshed from the official docs:

npm run sync-envs

Key variables include:

Variable Description
ANTHROPIC_API_KEY Anthropic API key
ANTHROPIC_BASE_URL Custom API base URL (local proxy, OpenRouter, etc.)
ANTHROPIC_AUTH_TOKEN Bearer token for custom auth
ANTHROPIC_MODEL Override default model
CLAUDE_CODE_USE_VERTEX Use Google Vertex AI
CLAUDE_CODE_USE_BEDROCK Use AWS Bedrock
AWS_REGION AWS region for Bedrock
CLOUD_ML_REGION GCP region for Vertex
HTTP_PROXY / HTTPS_PROXY Proxy settings
CLAUDE_CODE_MAX_OUTPUT_TOKENS Override max output tokens
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC Disable telemetry

Full list: run cc-wrapper new and browse the interactive selector.


Security

  • API keys and tokens are never printed in logs — always masked (e.g. sk-a*****)
  • Config file lives in your user data directory, not in project folders
  • No values are sent anywhere other than the claude process environment

Contributing

git clone https://github.com/aminechraibi/cc-wrapper
cd cc-wrapper
npm install
npm test
npm run build

Refresh Claude env var list from official docs:

npm run sync-envs

License

MIT — Amine Chraibi

About

Cross-platform CLI wrapper for `claude` with reusable environment profiles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors