Skip to main content

Minimal coding agent CLI and web UI built on mycode-sdk.

Project description

mycode

There are many coding agents, but this one is mine.

A minimal coding agent. Inspired by pi.

  • Minimal agent core (< 5k lines) with multiple provider support and robust message replay.
  • 4 built-in tools only (read, write, edit, bash), expanded via skills.
  • Mobile-friendly web UI.
  • Native image and pdf input support.

Quick Start

Requires Python 3.12+. Install via uv:

uv tool install mycode-cli

Interactive terminal UI:

mycode

Web UI (default at http://localhost:8000):

mycode web [--port <port>] [--hostname <hostname>]

Single message, non-interactive:

mycode run "explain how the session store works"

API keys are discovered automatically from environment variables (see Providers).

Providers

Provider id Env var
Anthropic anthropic ANTHROPIC_API_KEY
OpenAI openai OPENAI_API_KEY
Google Gemini google GEMINI_API_KEY
Moonshot moonshotai MOONSHOT_API_KEY
MiniMax minimax MINIMAX_API_KEY
DeepSeek deepseek DEEPSEEK_API_KEY
Z.AI zai ZAI_API_KEY
OpenRouter openrouter OPENROUTER_API_KEY
OpenAI-compatible openai_chat

Run /model in tui to see the available models.

Configuration

A config file is optional — API keys from the environment are usually sufficient.

Create ~/.mycode/config.json (global) or <workspace>/.mycode/config.json (project, takes precedence) to:

  • set a default provider, model, and reasoning effort
  • expose additional models on an existing provider (e.g. OpenRouter's catalog)
  • register a custom endpoint, such as a private or regional deployment
{
  "default": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "reasoning_effort": "medium"
  },
  "providers": {
    "openrouter": {
      "models": {
        "deepseek/deepseek-v3.2": {},
        "xiaomi/mimo-v2-pro": {}
      }
    },
    "zhipu-coding-plan": {
      "type": "zai",
      "base_url": "https://open.bigmodel.cn/api/coding/paas/v4",
      "api_key": "${ZHIPU_API_KEY}"
    },
    "custom-provider": {
      "type": "openai_chat",
      "base_url": "https://custom-endpoint.com/v1",
      "api_key": "${CUSTOM_API_KEY}",
      "models": {
        "custom-model": {
          "context_window": 128000,
          "max_output_tokens": 16384,
          "supports_reasoning": true,
          "supports_image_input": false
        }
      }
    }
  }
}
  • To override a built-in provider, reuse its id as the key — no type needed. Custom providers must declare a type — one of the built-in protocols.
  • reasoning_effort controls extended thinking for supported models: auto (default) · none · low · medium · high · xhigh.
  • API keys in config accept ${ENV_VAR} references.
  • Model metadata is bundled from models.dev{} is enough for most models. Provide explicit fields only for models not listed there.

Built-in Moonshot, MiniMax, and Z.AI providers default to international endpoints. Override base_url for China endpoints.

CLI Reference

mycode                            start interactive session (new)
mycode --continue                 resume the most recent session
mycode --session <id>             resume a specific session
mycode run "..."                  send one message, non-interactive
mycode web                        start web server (default port 8000)
mycode web --dev                  API only, no static files
mycode session list               list saved sessions

Interactive slash commands: /new /resume /rewind /provider /model /effort /clear /q

Development

git clone https://github.com/legibet/mycode.git && cd mycode
uv sync --dev
uv run mycode

Web development (backend + Vite dev server):

uv run mycode web --dev
pnpm --dir web install && pnpm --dir web dev

Or start both together:

just dev

Other useful shortcuts: just check · just test · just fmt

Build distributable artifacts:

uv build --package mycode-sdk
uv build --package mycode-cli

mycode-sdk

Agent core of mycode as a lightweight Python SDK for building custom agents. Install via: uv add mycode-sdk

from mycode import Agent, read_tool

agent = Agent(
    model="claude-sonnet-4-6",
    api_key="...",
    tools=[read_tool],
)

result = agent.run("Read pyproject.toml and tell me the project name.")
print(result.text)

See mycode/README.md for details.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mycode_cli-0.5.8.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mycode_cli-0.5.8-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file mycode_cli-0.5.8.tar.gz.

File metadata

  • Download URL: mycode_cli-0.5.8.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mycode_cli-0.5.8.tar.gz
Algorithm Hash digest
SHA256 7606f9a65479e5a1f22495a17f2e1d933dc75f6b0764c2bbcaf5bbaa393cf587
MD5 101c2d56b7aa41803e254b5823ac11c5
BLAKE2b-256 583f6b2a547b635dcca0baeae1d85d7f4d8c77f0a1b7422912db6f42f99b40af

See more details on using hashes here.

File details

Details for the file mycode_cli-0.5.8-py3-none-any.whl.

File metadata

  • Download URL: mycode_cli-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mycode_cli-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb16ba88b829d9e696a07e0db5074edb8d3ef5e04292949060aed79359c12d8
MD5 00f6c2d63fd7611efee6c868eee9cad1
BLAKE2b-256 e35f1813a3c0d7af1f625bae75d68b0bc2fc13fff6e7a2094c0291977a9030eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page