Metadata-Version: 2.4
Name: claude-code-mate
Version: 0.1.0
Summary: Claude Code Mate (CCM) - A companion tool for Claude Code, enabling flexible LLM integration through LiteLLM proxy.
Author-email: RussellLuo <luopeng.he@gmail.com>
License-File: LICENSE
Requires-Python: >=3.8
Requires-Dist: litellm[proxy]>=1.0.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pyyaml>=6.0
Description-Content-Type: text/markdown

# Claude Code Mate (CCM)

A companion tool for Claude Code, enabling flexible LLM integration through LiteLLM proxy.

The code (as well as the README) of Claude Code Mate is mainly vibe coded by Claude Code, with some adjustments and enhancements made by the author. 🤖✨

## Installation

```bash
# Install with uv
uv pip install claude-code-mate

# Or with pip
pip install claude-code-mate
```

## Usage

```bash
$ ccm -h
usage: cccm [-h] {start,stop,restart,status,logs} ...

A companion tool for Claude Code, enabling flexible LLM integration through LiteLLM proxy.

positional arguments:
  {start,stop,restart,status,logs}
                        Available commands
    start               Start the LiteLLM proxy in background
    stop                Stop the running LiteLLM proxy
    restart             Restart the LiteLLM proxy
    status              Show current proxy status
    logs                Show proxy logs

options:
  -h, --help            show this help message and exit

Examples:
  ccm start
  ccm stop
  ccm restart
  ccm status
  ccm logs
  ccm logs --follow --lines 100

This tool manages a LiteLLM proxy running with: litellm --config ~/.claude-code-mate/config.yaml
```

## Quick Start

Start the LiteLLM proxy:

```bash
ccm start
```

Set up the environment variables according to the given instructions:

```bash
export ANTHROPIC_BASE_URL=http://0.0.0.0:4000
export ANTHROPIC_AUTH_TOKEN=sk-1234567890
```

Then run Claude Code with your desired model:

```bash
claude --model claude-3.5-haiku
```

## Configuration

Default config (at `~/.claude-code-mate/config.yaml`):

```yaml
litellm_settings:
  master_key: sk-1234567890

model_list:
  - model_name: claude-3.5-haiku
    litellm_params:
      model: openrouter/anthropic/claude-3.5-haiku
      api_key: os.environ/OPENROUTER_API_KEY
      api_base: https://openrouter.ai/api/v1
```

Edit the config as needed, then restart the proxy to apply changes:

```bash
ccm restart
```

You need to update the environment variables if `master_key` is changed.

## Resources

- [LiteLLM Documentation](https://docs.litellm.ai/docs/tutorials/claude_responses_api)
- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code/llm-gateway)

## License

[MIT](http://opensource.org/licenses/MIT)
