This README explains how to install a global Claude/Anthropic CLI or SDK and fetch configuration from the cfgmgr/claude GitHub repository using curl. All global installs/updates use the explicit path /usr/bin/npm i -g -U as requested.
Note: This guide assumes you’ll install an npm package such as
anthropic(official SDK) or a CLI likeclaude/claude-cliif you use one. Adjust names/paths to match your actual package and binary.
- Quick Start
- Prerequisites
- Install
- Configuration
- Environment Variables
- Usage
- Update
- Troubleshooting
- Uninstall
- Security Notes
- FAQ
- Support
- License
- Summary
# 1) Verify prerequisites
node -v
curl --version
# 3) Install/upgrade globally (uses the full npm path)
sudo /usr/bin/npm i -g -U "@anthropic-ai/claude-code"
# 4) Create a config directory
mkdir -p "$HOME/.claude"
# 5) Pull config from GitHub (adjust file path if needed)
CONFIG_URL="https://raw.githubusercontent.com/cfgmgr/claude/main/config.json"
curl -fsSL "$CONFIG_URL" -o "$HOME/.claude/config.json"
# 6) Set your API key
export ANTHROPIC_API_KEY=""
# 7) Verify (replace 'claude' with your CLI name if different)
claude --version || claude --help - Node.js: Version 18+ recommended.
- npm: Comes with Node.js. This guide uses
/usr/bin/npmexplicitly. - curl: Required for fetching configuration from GitHub.
- A Unix-like shell (macOS/Linux). Windows users can use WSL or PowerShell and adapt paths.
Install Node quickly:
- macOS:
brew install node - Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y nodejs npm
For newer Node versions, consider NodeSource, Volta, or nvm.
- Confirm where
npmlives:
which npm
ls -l /usr/bin/npm || echo "/usr/bin/npm not found; adjust commands accordingly"- Install or upgrade the global package:
# Exact path and flags as requested
sudo /usr/bin/npm i -g -U @anthropic-ai/claude-code- Confirm the CLI/library is available:
which claude || echo "If no 'claude' on PATH, check your CLI package name or global npm bin path."
claude --help || trueIf you are using the SDK only (
anthropic), there may be no CLI binary. Use it programmatically in Node.js.
This guide stores configuration under ~/.claude. It pulls a JSON config file from the cfgmgr/claude repository using GitHub’s raw content endpoint.
- Create the config directory:
CONFIG_DIR="$HOME/.claude"
mkdir -p "$CONFIG_DIR"- Choose the raw config URL. Update the branch/path/file as needed:
CONFIG_URL="https://raw.githubusercontent.com/cfgmgr/claude/main/config.json"- Download the config:
curl -fsSL "$CONFIG_URL" -o "$CONFIG_DIR/config.json" && echo "Wrote config to: $CONFIG_DIR/config.json"- Sanity-check the config content:
head -n 20 "$CONFIG_DIR/config.json" || trueMost Claude-based tools require an API key.
- Set your Anthropic API key:
export ANTHROPIC_API_KEY=""- Optional variables (adjust per your tool’s docs):
CLAUDE_CONFIG_PATH: Absolute path to a specific config fileANTHROPIC_API_URL: Override base URL if using a proxy/gatewayHTTP_PROXY/HTTPS_PROXY: Proxy support if requiredNO_PROXY: Comma-separated list of hosts not to proxyDEBUG=1: Enable verbose logging if supported
Persist environment variables by adding them to your shell profile (e.g., ~/.bashrc, ~/.zshrc).
- CLI usage (if you installed a
claudeCLI):
claude --help
claude run --config "$HOME/.claude/config.json"- Upgrade the global package to the latest version:
sudo /usr/bin/npm i -g -U @anthropic-ai/claude-code- Refresh your configuration from GitHub:
CONFIG_URL="https://raw.githubusercontent.com/cfgmgr/claude/main/config.json"
curl -fsSL "$CONFIG_URL" -o "$HOME/.claude/config.json"- “/usr/bin/npm: No such file or directory”
- Your system’s
npmmay be elsewhere (e.g.,/usr/local/bin/npm). Runwhich npmand either adjust the path or create a symlink.
- Your system’s
- “Permission denied” during global install
- Use
sudo, or configure a user-level global prefix:
npm config set prefix "$HOME/.npm-global"and add$HOME/.npm-global/binto your PATH.
- Use
- CLI not found after install
- Ensure the package actually provides a binary and your global npm bin dir is on
PATH. Checknpm bin -g.
- Ensure the package actually provides a binary and your global npm bin dir is on
- 404 or error when fetching config
- Verify the repo, branch (
mainvsmaster), file path, and that your network/proxy allows GitHub access.
- Verify the repo, branch (
- Proxy issues
- Set
HTTP_PROXY,HTTPS_PROXY, and possiblyNO_PROXY. Test withcurl -v.
- Set
- Config format mismatch
- Confirm your tool expects JSON vs YAML/TOML and point
--configor env vars to the correct file.
- Confirm your tool expects JSON vs YAML/TOML and point
sudo /usr/bin/npm uninstall -g anthropic
rm -Rf "$HOME/.claude" 2>/dev/null || true- Never commit secrets (like
ANTHROPIC_API_KEY) to version control. - Restrict permissions on your config directory if it contains sensitive values:
chmod 700 "$HOME/.claude"
chmod 600 "$HOME/.claude/config.json"- Consider using a secrets manager or environment variable injection for CI/CD.
- “Can I use a different config location?”
- Yes. Either set
CLAUDE_CONFIG_PATH(if supported) or pass a--configflag to the CLI if it provides one.
- Yes. Either set
- Issues with the npm package: open an issue in that package’s repository.
- Problems with configuration retrieval: verify the file path and branch in
cfgmgr/claude, then open an issue there if needed.
Include your project’s license information here (e.g., MIT). If you’re consuming third-party packages, follow their licenses accordingly.
- Installed the global package using
sudo /usr/bin/npm i -g -U @anthropic-ai/claude-code - Fetched configuration from
cfgmgr/claudewithcurland stored it under~/.claude/config.json. - Set environment variables, verified the CLI/library, and provided steps to update, troubleshoot, and uninstall.