Skip to main content

YCode — a minimal, professional code agent powered by DeepSeek

Project description

YCode

A minimal, professional command-line code agent powered by DeepSeek. No IDE — launch it from PowerShell, give it a task, and it edits files, runs commands, and completes work through a tool loop.

  • Agentic tool loop — reads, writes, edits, greps, and runs shell/background commands; read-only actions run freely, writes and shell ask first (y/n/a).
  • Cross-session memory — remembers your preferences and project constraints in .ycode/memory/ (project) and ~/.ycode/memory/ (global) and reloads them each session.
  • Context management — automatically compacts long conversations and shows per-turn token usage so it never overflows the model's context.
  • Subagents — delegates self-contained subtasks to autonomous workers that report back, keeping the main context clean.
  • MCP client — connects to any Model Context Protocol server and exposes its tools to the model.
  • Extensible — markdown skills, plus a web_fetch tool for docs.
  • Scriptable — one-shot mode (ycode "task" -y) for unattended runs.

Install

Requires Python 3.11+ and a DeepSeek API key.

For users — pick one:

# Recommended: isolated global install via pipx
pipx install cbyzt-ycode

# Or plain pip
pip install cbyzt-ycode

# Or straight from GitHub (no PyPI needed)
pipx install git+https://github.com/cbyzt/ycode

# Or from a wheel file someone sent you
pip install cbyzt_ycode-0.2.0-py3-none-any.whl

For development — from a clone of the repo:

pip install -e .            # editable install
pip install -e ".[dev]"     # + pytest, then run: pytest

The test suite stubs the model client, so it needs no API key or network.

Set your API key

YCode needs a DeepSeek API key (get one at https://platform.deepseek.com). It is read from the DEEPSEEK_API_KEY environment variable:

$env:DEEPSEEK_API_KEY = "sk-..."     # this shell only
setx DEEPSEEK_API_KEY "sk-..."       # persist across shells (reopen the terminal)

Run

ycode                      # interactive REPL (or: python -m ycode)
ycode "add a /health route"   # one-shot: run one task, then exit
ycode "fix the failing test" -y   # -y auto-approves file/shell actions
ycode --model pro "..."    # pick the model for this run

Type a request in plain language. YCode will read files, propose edits, and run commands to accomplish it. Read-only actions run automatically; anything that writes files or runs a shell command asks for confirmation first (y/n/a).

Commands

Command Description
/help List commands and skills
/clear Clear the conversation (keeps the system prompt)
/compact Summarize older turns to free up context
/memory Show what YCode remembers across sessions
/forget <name> Delete a stored memory by name
/mcp Show connected MCP servers and their tools
/model [flash|pro] Show or switch model
/reload Hot-reload tools, skills & prompt (development)
/init Scan the project and generate YCODE.md
/exit Quit

Models

  • flashdeepseek-v4-flash (default: fast, cheap, 1M context)
  • prodeepseek-v4-pro (frontier reasoning for hard tasks)

Skills

A skill is a directory with a SKILL.md file:

---
name: my-skill
description: One line the model uses to decide relevance.
invocation: both      # slash | auto | both
kind: prompt          # prompt (inject body) | control (run Python)
---
Markdown instructions injected into the conversation when the skill runs.

Built-in skills live in ycode/skills/builtin/. Project skills are discovered from .ycode/skills/ in your working directory. invocation controls triggering: typed /name, model-initiated via load_skill, or both.

Tools

read_file, write_file, edit_file, ls, glob, grep, run_shell, web_fetch (fetch a URL as text), ask_user (interactive arrow-key selector), load_skill, save_memory, forget_memory, spawn_agent.

Background processes — for dev servers, watchers, and anything that does not exit on its own:

  • run_background — start a command in the background and return immediately
  • list_processes — list background processes and their status
  • read_output — read a background process's captured output
  • stop_process — stop a background process and its child processes

Background processes are all terminated automatically when YCode exits.

Memory

YCode keeps durable facts across sessions and loads them into every new conversation, so you don't repeat yourself. It saves them as one Markdown file per fact, in two scopes:

  • project.ycode/memory/ in your working directory (constraints and preferences specific to this repo)
  • global~/.ycode/memory/ (facts about you that hold across all projects)

The model decides what's worth remembering (a stated preference, feedback on how you want it to work, a non-obvious constraint) and calls save_memory; it won't store things already in the code, git, or YCODE.md. Use /memory to see what's stored and /forget <name> (or the forget_memory tool) to drop a fact.

Subagents

For larger tasks, YCode can delegate a self-contained subtask to a subagent — a fresh agent with its own context and the same tools. It runs autonomously and returns only a concise summary, so the main conversation stays uncluttered. Subagents can't spawn further subagents or prompt you, so they always terminate.

MCP servers

YCode is an MCP client: drop a .ycode/mcp.json in your project and its servers' tools become available to the model (as mcp__<server>__<tool>, gated by the same confirmation prompt).

{
  "mcpServers": {
    "fs": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] }
  }
}

Run /mcp to see connection status. Servers are started on launch and stopped on exit.

Context management

Long sessions never overflow the context window: YCode shows per-turn token usage and, once the conversation grows past a threshold, automatically compacts it — summarizing the older turns into one note while keeping the system prompt and the most recent turns. Run /compact to trigger it manually.

Building & publishing (maintainers)

# Build sdist + wheel into dist/
pip install build
python -m build

# Publish to PyPI (bump `version` in pyproject.toml first)
pip install twine
twine upload dist/*          # username __token__, password = your PyPI API token

Test the upload against TestPyPI first with twine upload -r testpypi dist/*.

Standalone executable (no Python required)

pip install pyinstaller
pyinstaller --onefile --name ycode ^
    --add-data "ycode/skills/builtin;ycode/skills/builtin" ^
    ycode/__main__.py

The --add-data flag is required — PyInstaller does not bundle the SKILL.md files automatically. The result is dist/ycode.exe.

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

cbyzt_ycode-0.2.0.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

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

cbyzt_ycode-0.2.0-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

Details for the file cbyzt_ycode-0.2.0.tar.gz.

File metadata

  • Download URL: cbyzt_ycode-0.2.0.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cbyzt_ycode-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f0fa6c21ebf1e442237762889c2ce239197cfb76800f3e9af8dc06487fb1354b
MD5 15fc1b5aa1037ab9bcbf3eb6a8e0aaa2
BLAKE2b-256 9de7773da0bb03b5f4db97577a27eb0b07e08aaa35485b77cbe2b1c0c193ddf4

See more details on using hashes here.

File details

Details for the file cbyzt_ycode-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cbyzt_ycode-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cbyzt_ycode-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbf542e6cf797810f121b58e727e093bbe119c129ba17f21b8905e48b72e79c0
MD5 c3eb567abd3904550e6280ee9e087ea3
BLAKE2b-256 e1d047cc8679e2b00eaf81916b99c27fd63b96c581db7c9541e8c4967a63b96e

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