Skip to main content

A safe, extensible terminal coding agent

Project description

Windcode

Windcode 是一个Coding Agent。它可以在本地 工作区中读取和修改代码、执行命令、运行测试、恢复会话,并通过权限策略与 Linux 沙箱控制 高风险操作。

alt text alt text alt text alt text alt text

功能

  • Textual 终端工作台与 Python SDK
  • Anthropic Messages、OpenAI Responses 和 OpenAI-compatible 模型协议
  • 流式输出、工具调用、审批、取消、重试与显式模型回退
  • 会话恢复、历史回退、上下文压缩和本地 trace
  • 多子智能体并行执行与独立 Worktree
  • 项目级长期记忆:用户画像、项目事实、经验、SOP 与主动查询
  • MCP Server、Skills、Hooks 和本地插件扩展
  • 四种权限模式与可选 bubblewrap 沙箱

快速开始

环境要求:Linux、Python 3.12+、uv。bubblewrap 可选。

从 PyPI 安装命令行工具:

uv tool install windcode
windcode /path/to/project

也可以安装到当前 Python 环境:

uv pip install windcode

从源码运行:

uv sync --frozen --all-groups
cp .windcode/config.toml.example .windcode/config.toml
uv run windcode /path/to/project

最小模型配置:

primary_provider = "primary"

[providers.primary]
protocol = "openai_compatible"
model = "your-model"
base_url = "https://example.com/v1"
api_key_env = "MODEL_API_KEY"

密钥应通过环境变量或 Windcode 凭据存储提供,不要写入项目配置。

export MODEL_API_KEY="..."
uv run windcode .

常用启动参数:

--config FILE
--model PROVIDER_OR_MODEL
--resume SESSION_ID
--permission-mode plan|default|accept_edits|full_access
--sandbox / --no-sandbox

常用命令

/new                         新建会话
/resume [SESSION_ID]         恢复会话
/history                     查看历史节点
/rewind RECORD_ID            回退到历史记录
/model                       管理模型与 Provider
/mode MODE                   切换权限模式
/memory                      管理长期记忆
/extensions                  管理扩展
/compact                     压缩当前上下文
/agents                      查看子智能体
/status                      查看运行状态

MCP Server

[extensions]
enabled = true

[extensions.mcp_servers.example]
transport = "streamable_http"
url = "https://example.com/mcp"
enable = true
required = false

enable = false 的服务器不会连接、不会参与工具搜索,也不会注入模型上下文。required 只在 服务器启用时表示启动阶段必须连接成功。

本地状态

Windcode 将记忆、会话、trace、扩展状态和 Worktree 统一存放在选定的状态根下:

[storage]
project_state_root = ".windcode"
user_storage_root = "~/.local/state/windcode"

配置项目状态根时优先使用项目目录;未配置时使用用户状态目录。Skill 会同时扫描两边的 skill/,同名时项目级覆盖用户级。.windcode/config.toml.windcode/ 下的运行状态都 不应提交到 Git。

开发

uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest -q
uv build

构建与发布

发布前更新 pyproject.tomlsrc/windcode/__init__.py 中的版本号,并完成完整检查:

uv sync --frozen --all-groups
uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest -q
uv build --no-sources

可以先发布到 TestPyPI 验证:

uv publish \
  --publish-url https://test.pypi.org/legacy/ \
  --token "$TEST_PYPI_TOKEN"

正式版本通过 GitHub Release 自动发布:创建与项目版本一致的标签,例如 v0.1.0,然后发布 GitHub Release。.github/workflows/publish.yml 会验证标签、运行测试、构建发行包,并使用 PyPI Trusted Publishing 发布。首次发布前需要在 PyPI 配置以下 Trusted Publisher:

Owner: tingfeng347
Repository: windcode
Workflow: publish.yml
Environment: pypi

PyPI 不允许覆盖已经发布的同名版本;重新发布前必须增加版本号。

生产代码位于 src/windcode/。本地 tests/spec/ 目录由 Git 忽略,仅用于开发和规格管理。

License

Apache-2.0

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

windcode-0.1.2.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

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

windcode-0.1.2-py3-none-any.whl (217.6 kB view details)

Uploaded Python 3

File details

Details for the file windcode-0.1.2.tar.gz.

File metadata

  • Download URL: windcode-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for windcode-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d1238109869a6c0f5a24063d37be1e6100f771f60dc24d76dce84154f7f0f368
MD5 199120626c707832bbc8addaaa5f4391
BLAKE2b-256 f8295f1a0ebd0ec455129faebf685d9bba0b12107dee81f6db4cab05bfde9193

See more details on using hashes here.

Provenance

The following attestation bundles were made for windcode-0.1.2.tar.gz:

Publisher: publish.yml on tingfeng347/windcode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file windcode-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: windcode-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 217.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for windcode-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 87f9b2fafefabb80c427dedaf26a1be943aad2699d7939f27fbf482e23c8c391
MD5 7eb2cc624ed463338de0be9b94ba854b
BLAKE2b-256 08b148b544a612a2b6995208ecd402fa2e3ca0e0d7a369a97d46d82eefaa6cca

See more details on using hashes here.

Provenance

The following attestation bundles were made for windcode-0.1.2-py3-none-any.whl:

Publisher: publish.yml on tingfeng347/windcode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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