Skip to content
 
 

Repository files navigation

mycc

mycc is a local API-driven coding agent CLI.

This repository is the current working source for the mycc command. It is separated from the official claude CLI and uses its own local config path by default.

What It Does

  • Runs as a terminal coding agent.
  • Uses url + apiKey + model directly.
  • Supports both:
    • Anthropic-style endpoints: /v1/messages
    • OpenAI-compatible endpoints: /chat/completions
  • Stores local config in ~/.mycc-local/config.json
  • Exposes a small local toolset:
    • list_files
    • read_file
    • write_file
    • run_command

Requirements

  • Node.js 18+
  • npm
  • Windows, macOS, or Linux

Install

1. Clone the repository

git clone https://github.com/zja2004/claude-code.git
cd claude-code

2. Install dependencies

npm install

3. Install the CLI globally

npm install -g .

After that, the command will be available as:

mycc

First-Time Setup

Run:

mycc

If no config exists yet, mycc will ask for:

  1. Base URL
  2. API key
  3. Model

Then it will save them to:

~/.mycc-local/config.json

Direct Login Command

You can also configure it in one step:

mycc auth login --url https://your-api-base --api-key your-key --model your-model

Check current config:

mycc auth status

Remove saved config:

mycc auth logout

Environment Variables

mycc supports these overrides:

MYCC_BASE_URL
MYCC_API_KEY
MYCC_MODEL
MYCC_API_STYLE
MYCC_MAX_TOKENS

Compatible fallback names are also accepted:

ANTHROPIC_BASE_URL
ANTHROPIC_API_KEY
ANTHROPIC_MODEL
ANTHROPIC_API_STYLE
ANTHROPIC_MAX_TOKENS

API Style

MYCC_API_STYLE can be:

  • auto
  • anthropic
  • openai

Default is auto.

In auto mode:

  • mycc tries Anthropic-style /v1/messages first.
  • If the endpoint rejects that style with routing-style errors such as 404, it falls back to OpenAI-compatible /chat/completions.

This is useful for providers such as:

  • DashScope compatible mode
  • OpenAI-compatible gateways
  • Reverse proxies
  • Multi-provider API routers

DashScope Example

Example for DashScope compatible mode:

mycc auth login `
  --url https://dashscope.aliyuncs.com/compatible-mode/v1 `
  --api-key YOUR_KEY `
  --model glm-5 `
  --api-style openai

Then start:

mycc

You can also do it with environment variables:

$env:MYCC_BASE_URL='https://dashscope.aliyuncs.com/compatible-mode/v1'
$env:MYCC_API_KEY='YOUR_KEY'
$env:MYCC_MODEL='glm-5'
$env:MYCC_API_STYLE='openai'
mycc

Basic Usage

Interactive mode:

mycc

Single prompt:

mycc -p "Summarize this repository"

List models:

mycc models

Notes

  • mycc is intentionally isolated from the official claude command.
  • Default config path is ~/.mycc / ~/.mycc-local, not ~/.claude.
  • This repo currently uses the lightweight API-only entrypoint for the global mycc command.
  • The larger recovered source tree remains in the repo, but the stable user-facing path is the minimal CLI.

Current Entry Point

The global mycc command currently points to:

minimal/cli.js

The source-style recovered CLI remains available for development/testing at:

npm run start:source

About

Claude Code v2.1.88 Source Code

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages