An open API service indexing awesome lists of open source software.

https://github.com/felipeadeildo/claude-code-profiles

Manage multiple Claude Code profiles: switch accounts, providers, and env vars with one command
https://github.com/felipeadeildo/claude-code-profiles

bash-script claude claude-ai claude-code

Last synced: 12 days ago
JSON representation

Manage multiple Claude Code profiles: switch accounts, providers, and env vars with one command

Awesome Lists containing this project

README

          


ccp: Claude Code Profiles

Switch between Claude Code setups with a single command.
Different accounts, different providers, different models — each in its own profile.

No dependencies. Works with bash, zsh, and fish.

[![Version](https://img.shields.io/github/v/release/felipeadeildo/claude-code-profiles?label=version&color=58a6ff)](https://github.com/felipeadeildo/claude-code-profiles/releases/latest)
[![License](https://img.shields.io/github/license/felipeadeildo/claude-code-profiles?color=3fb950)](LICENSE)

---

## Install

```bash
curl -fsSL https://ccp.fa.dev.br/install.sh | bash
```

Then reload your shell:

| Shell | Command |
|-------|---------|
| bash | `source ~/.bashrc` |
| zsh | `source ~/.zshrc` |
| fish | `source ~/.config/fish/conf.d/ccp.fish` |

The installer detects your shell automatically. For fish, it installs a native `ccp.fish` function to `~/.config/fish/conf.d/` — no need to source anything on the next shell launch.

## Quickstart

```bash
ccp new work # create a profile (interactive wizard)
ccp work # launch claude with that profile
ccp use work # export its vars into your current shell
```

## How it works

A profile is a `.env` file under `~/.ccp/profiles/`. Each profile gets an isolated `CLAUDE_CONFIG_DIR` — separate settings, history, and todos per profile.

```
~/.ccp/
profiles/
work.env
personal.env
openrouter.env
config # stores the default profile name
data/ # isolated CLAUDE_CONFIG_DIR per profile
```

Example profile:

```bash
# ~/.ccp/profiles/work.env
CLAUDE_CONFIG_DIR=~/.ccp/data/work
ANTHROPIC_BASE_URL=https://openrouter.ai/api
ANTHROPIC_API_KEY=sk-or-...
```

## Commands

```
ccp list list all profiles
ccp new create a profile (interactive)
ccp show show vars (keys masked)
ccp edit open in $EDITOR
ccp remove delete a profile

ccp [] [flags] launch claude (with optional profile and claude flags)
ccp use export vars into current shell
ccp run run any command with profile vars

ccp default [profile] get or set the default profile
ccp doctor validate all profiles
ccp version show current version
ccp update update to the latest release
```

**Shorthand**: `ccp work --resume` launches claude with the `work` profile and passes `--resume` directly to claude. Bare `ccp` uses the default profile.

**`ccp use` vs `ccp `**: use `ccp use` when you want vars to persist in your shell session. The shorthand spawns a subprocess — vars are scoped to that invocation only.

## Providers

| Provider | `ANTHROPIC_BASE_URL` | Auth var |
|----------------|------------------------------------------|-------------------------------|
| Anthropic | *(leave blank)* | `ANTHROPIC_API_KEY` |
| OpenRouter | `https://openrouter.ai/api` | `ANTHROPIC_API_KEY` |
| z.ai (GLM) | `https://api.z.ai/api/anthropic` | `ANTHROPIC_AUTH_TOKEN` |
| Kimi | `https://api.moonshot.ai/anthropic` | `ANTHROPIC_AUTH_TOKEN` |
| DeepSeek | `https://api.deepseek.com/anthropic` | `ANTHROPIC_AUTH_TOKEN` |
| Ollama (local) | `http://localhost:11434` | `ANTHROPIC_AUTH_TOKEN=ollama` |

The interactive wizard sets the right auth variable automatically.

## Model mapping

Claude Code internally requests `claude-opus`, `claude-sonnet`, etc. If your provider uses different model names, map them in the profile:

```bash
ANTHROPIC_DEFAULT_OPUS_MODEL=glm-4.6
ANTHROPIC_DEFAULT_SONNET_MODEL=glm-4.6
ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-4.5-air
```

The wizard asks for these optionally when creating a profile.

## Updating

```bash
ccp update # downloads and installs the latest release
ccp version # show current version
```

ccp checks for updates in the background and notifies you when a new version is available.

---

*Want to contribute? See [CONTRIBUTING.md](CONTRIBUTING.md).*