Skip to main content

Experimental Python-runner coding agent with a Textual TUI

Project description

uv-agent

简体中文

uv-agent is a Windows-first coding agent with a Textual TUI. It is designed to feel at home on Windows, where many coding agents stumble over PowerShell quoting, shell semantics, or Unix-first assumptions. Its only external action surface is run_python: the model submits Python scripts to a managed uv run runner, and those scripts do the actual work instead of relying on fragile shell snippets. This single-tool design keeps behavior predictable on Windows and portable to any OS with Python and uv. It includes a mature context management system — see Context Management for details.

Public APIs, config fields, and runtime behavior may still change as the project evolves.

Prerequisites

Install the following tools:

Install And Run

Run the latest published package:

uvx uv-agent@latest

Run from a local checkout:

uv run uv-agent

Ask a single prompt without opening the TUI:

uvx uv-agent@latest ask "Reply with exactly: ok"

Resume an existing thread:

uvx uv-agent@latest ask --thread thr_xxx "Continue from here"

Configuration

User config lives at ~/.uv-agent/config.json. A project can override it with .uv-agent/config.json; that project-local directory is ignored by git. Keep API keys in environment variables or ignored local config.

API compatibility
This project supports three API formats — set api on your model config:

api value Format Status
"chat_completions" OpenAI Chat Completions API ✅ Supported
"responses" OpenAI Responses API ✅ Supported
"anthropic_messages" Anthropic Messages API ✅ Supported

Issues and PRs are welcome for any format!Example configuration:

{
  "providers": {
    "deepseek": {
      "base_url": "https://api.deepseek.com",
      "api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "chat_completions": {
        "path": "/chat/completions"
      },
      "message_passthrough": {
        "assistant": [
          "reasoning_content"
        ]
      },
      "reasoning_display": {
        "assistant_message_fields": [
          "reasoning_content"
        ],
        "stream_delta_fields": [
          "reasoning_content"
        ]
      }
    },
    "minimax": {
      "base_url": "https://api.minimaxi.com",
      "api_key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "chat_completions": {
        "path": "/v1/chat/completions"
      },
      "anthropic_messages": {
        "path": "/anthropic/v1/messages"
      }
    }
  },
  "models": {
    "deepseek-v4-flash": {
      "provider": "deepseek",
      "model": "deepseek-v4-flash",
      "api": "chat_completions",
      "supports_images": false,
      "context_window_tokens": 1000000,
      "params": {
        "reasoning_effort": "high"
      }
    },
    "deepseek-v4-pro": {
      "provider": "deepseek",
      "model": "deepseek-v4-pro",
      "api": "chat_completions",
      "supports_images": false,
      "context_window_tokens": 1000000,
      "params": {
        "reasoning_effort": "max"
      }
    },
    "MiniMax-M2.7": {
      "provider": "minimax",
      "model": "MiniMax-M2.7-highspeed",
      "api": "anthropic_messages",
      "supports_images": false,
      "context_window_tokens": 204800
    }
  },
  "levels": {
    "deepseek-flash": {
      "model": "deepseek-v4-flash"
    },
    "deepseek-pro": {
      "model": "deepseek-v4-pro"
    },
    "MiniMax-M2.7": {
      "model": "MiniMax-M2.7"
    }
  },
  "runtime": {
    "default_level": "deepseek-flash",
    "ask_default_level": "deepseek-flash",
    "store_provider_response": false,
    "max_agent_rounds": 1000,
    "compression": {
      "enabled": true,
      "model_level": "deepseek-flash",
      "trigger_ratio": 0.9
    },
    "title_generation": {
      "enabled": true,
      "model_level": "deepseek-flash"
    }
  },
  "runner": {
    "default_timeout_s": 7200,
    "max_output_bytes": 1000000
  },
  "pricing": {
    "currency": "RMB",
    "unit": "1M_tokens",
    "models": {
      "deepseek-v4-flash": {
        "input": 1,
        "output": 2,
        "cached_input": 0.02
      },
      "deepseek-v4-pro": {
        "input": 3,
        "output": 6,
        "cached_input": 0.025
      }
    }
  },
  "ui": {
    "completion_notification": {
      "enabled": true
    }
  }
}

Use /config in the TUI to switch the default level, language, and automatic compression. Set ui.language to zh-CN for a Chinese UI. Completion notifications can be configured under ui.completion_notification. Non-Windows platforms use the terminal bell for completion sound.

See configuration for all supported options and config.example.json for a detailed example.

Documentation

Core Ideas

  • The agent has exactly one external action surface: run_python.
  • Managed scripts run in a project-shared uv environment; scripts add third-party dependencies to that environment with add_dependency.
  • The distributed package includes both uv_agent and uv_agent_runtime; managed scripts import helpers from uv_agent_runtime.
  • Workspace rules, skills, and MCP declarations are progressively disclosed as context. MCP calls happen from Python runtime helpers, not direct model tools.
  • Thread state, run logs, the shared script environment, and attachments live under ~/.uv-agent/projects/<project-id>/.

Context Management

uv-agent uses a mature context management system with fingerprint-based incremental updates: only context blocks (runtime env, model levels, helpers, skills, MCP servers) that have changed are re-sent, while the system prompt stays stable and all dynamic context is appended via user messages. After compaction, the epoch resets and all blocks are re-sent fresh. Updates arrive as explicit <context_update status="current|removed"> envelopes, and workspace rules are progressively loaded on demand.

Development

uv run pytest

Local debug state, screenshots, config, scripts, runs, and thread data belong in .uv-agent/ and should stay out of git.

License

MIT. See LICENSE.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

uv_agent-0.7.12.tar.gz (501.6 kB view details)

Uploaded Source

Built Distribution

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

uv_agent-0.7.12-py3-none-any.whl (188.2 kB view details)

Uploaded Python 3

File details

Details for the file uv_agent-0.7.12.tar.gz.

File metadata

  • Download URL: uv_agent-0.7.12.tar.gz
  • Upload date:
  • Size: 501.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uv_agent-0.7.12.tar.gz
Algorithm Hash digest
SHA256 5b0b3c9e0bd7ed989f9929c5c3b05be9dfc51cb7afeeb1b29a94a1926911b0e2
MD5 a7c398faff1b014291e027463ca176e4
BLAKE2b-256 d02adfc07cc715a1214e7367699b97245fcf42d0b885d89f0c87c30030912edd

See more details on using hashes here.

File details

Details for the file uv_agent-0.7.12-py3-none-any.whl.

File metadata

  • Download URL: uv_agent-0.7.12-py3-none-any.whl
  • Upload date:
  • Size: 188.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for uv_agent-0.7.12-py3-none-any.whl
Algorithm Hash digest
SHA256 9e226bcefadadec6598093e07c716a32ad20e324e6d63b6aa877d69cb42eaf94
MD5 5f19987439bf76c64a97c01207d32bae
BLAKE2b-256 d733616502799997d0fcbbadc4f0bff4e2f0f461142ef5c215115e3855e67a47

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