Skip to main content

Naiyue Test Agent

本地运行的通用编程与测试 Agent,提供浏览器界面和终端交互。通过配置的模型、项目提示词、Skills 和工具读取项目、修改文件、执行命令,并保留会话历史。

  • 本地 Web:流式 Markdown、工具执行过程、权限审批、会话管理和历史滚动加载;首任务自动标题、文件差异预览/patch 下载、可见思考和最后任务重新生成。
  • 终端 CLI:多轮对话、恢复历史、审批、停止、Steering 和 Follow-up。
  • 模型接入:OpenAI、兼容 OpenAI 的接口、Anthropic、Ollama。
  • 工具:Read、Ls、Find、Grep、Write、Edit、Bash、PowerShell,以及一层前台子 Agent。
  • 0.1.1 新增 aitest_kit、百度/Tavily 回退的 web_search 和 web_fetch,配置见工具说明。
  • 0.2.0 统一模型请求准备与上下文预算,补充调用次数、耗时和 SDK HTTP 尝试诊断;支持分离配置代理地址、用户名/密码、直连名单及新会话默认工具,见设置示例。
  • Find/Grep 使用安装包内的 fd / rg;前端已经构建,使用发行包无需 Node.js 或 npm。
  • 0.2.0 支持 nyt mcp list 只读发现及根/子 Agent 调用本地/远程 MCP 工具,复用活动工具选择、审批与会话连接,支持按服务显式开启空闲回收;应用运行中可刷新配置以新增服务、调整名单和启停,CLI/Web显示来源、结果状态和归档位置,重启保留历史、旧 MCP 待审需取消后重新发起,见MCP客户端配置。

安装

需要 Python 3.12 或更高版本;当前 CI 基线为 Python 3.12。建议使用独立虚拟环境。

python -m venv .venv

激活环境:

  • macOS / Linux:source .venv/bin/activate
  • Windows PowerShell:.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install naiyue-test-agent
nyt --version

当前发行目标:macOS Apple Silicon、Linux x86_64 / ARM64、Windows x64。每个平台分别提供 wheel,pip 自动选择。Linux 目标为 glibc 环境;Intel Mac、Windows ARM 和 Alpine 暂未列入支持范围。macOS 标签标识内置程序的最低系统要求,Python 和第三方依赖可能有更高要求。跨平台运行结果以相应 CI 为准。

配置模型

默认读取用户目录下的 ~/.naiyue-test-agent/models.json,Windows 对应 %USERPROFILE%\.naiyue-test-agent\models.json。自行创建目录和 JSON 文件,或启动时用 --config 指定已有配置。

下面是配置格式示例,将尖括号占位项替换为自己的值:

{
  "schema_version": 1,
  "default_model_id": "main",
  "providers": {
    "gateway": {
      "kind": "openai_compatible",
      "base_url": "https://example.invalid/v1",
      "api_key": "<your-api-key>"
    }
  },
  "models": {
    "main": {
      "provider_id": "gateway",
      "model": "<your-model-name>",
      "api": "chat_completions"
    }
  }
}

OpenAI / 兼容接口的 api 可选 chat_completions 或 responses,应与实际端点能力一致。其他供应商、思考参数、缓存和工具预算的配置说明见仓库中的 模型示例 与 应用设置示例。

对于使用 reasoning_content 返回可见思考的兼容网关,可在对应模型的 profile 中声明 "reasoning_output": "reasoning_content";Responses 可在 request 中配置 "reasoning_summary": "auto"(或 concise / detailed)。未配置时不额外请求思考摘要;模型没有返回可见思考时,界面不显示该区域。重新生成会重新执行最后一次任务及其工具,工作区文件不会回滚。

模型凭证由用户保管,不随包提供。使用远程模型时,发送给模型的消息和工具结果会交给所配置的供应商;本地应用不代表模型也在本地运行。

启动 Web

在需要操作的项目目录执行:

nyt

终端会输出本地访问链接,在浏览器中打开即可。默认绑定回环地址并自动选择端口。访问链接含本次服务的访问凭证,请按私有链接保管。

nyt --workspace /path/to/project
nyt --config /path/to/models.json
nyt --port 8080
nyt --help

--port 为显式覆盖示例;默认端口不固定。Ctrl+C 请求退出并等待必要收尾。

使用终端 CLI

nyt chat
nyt chat --workspace /path/to/project
nyt chat --resume
nyt chat --resume <session-id>
nyt chat --no-session
nyt chat --help

常用交互命令::quit 退出、:stop 停止、:approve / :deny 处理审批。完整交互说明以终端提示为准。

0.2.0 支持只读查询::usage 查看当前会话累计模型用量和调用耗时,:diagnostics 列最近运行,:diagnostics <run_id> 查看模型、工具和 HTTP 尝试明细;有后续页时会打印下一页命令。Web 在原上下文侧栏的“会话累计”和“运行诊断”查看同一批已保存事实。临时会话 --no-session 无持久化查询;诊断只在有限保留范围内可用。口径与入口见调用观测说明。

Web 与终端各自启动应用实例,同一工作区数据库由一个实例持有。切换入口前先关闭正在占用该数据库的服务。

工具、权限与数据

有工作区时默认启用文件工具。Bash / PowerShell 需要启用,并受权限规则及审批控制;解释器需由操作系统环境提供。命令使用当前用户的宿主文件和网络权限,当前不提供沙箱隔离。

会话、checkpoint、聊天归档和用量等保存在工作区关联的用户数据目录中,默认位于 ~/.naiyue-test-agent/data/。模型上下文压缩保留独立聊天归档。安装或升级应用不迁移或清理这些数据。

升级前关闭应用,再执行:

python -m pip install --upgrade naiyue-test-agent

开发与发行

从源码开发时安装 requirements.txt 和 requirements-web.txt,并在 PATH 中提供 rg / fd。前端开发使用仓库 frontend/ 下的 npm 配置。源码入口仍支持 python -m naiyue_test_agent.web 和 python -m naiyue_test_agent.application.cli。

发布维护、四平台构建和 PyPI 首次授权步骤见 发行指南。项目设计与开发记录保留在 GitHub 仓库,不进入 wheel。

许可证

本项目使用 MIT。发行包内的第三方软件保留各自许可证和版权声明。

Metadata

Release files for naiyue-test-agent 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for naiyue-test-agent 0.2.0
File
naiyue_test_agent-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
naiyue_test_agent-0.2.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
naiyue_test_agent-0.2.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
naiyue_test_agent-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 15.9 MB

Release files / naiyue_test_agent-0.2.0-py3-none-win_amd64.whl

Download URL naiyue_test_agent-0.2.0-py3-none-win_amd64.whl
Size 3.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
75c3daecb16c54e4368a949f75af49e4d66f494bf061be6d11b8ab06baeb004b
BLAKE2b-256 checksum
How to use checksums
47ffccbf4ba0f8ccf741502e3ec29734138f458223bcb6c31390f3e098197121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / naiyue_test_agent-0.2.0-py3-none-manylinux_2_17_x86_64.whl

Download URL naiyue_test_agent-0.2.0-py3-none-manylinux_2_17_x86_64.whl
Size 4.4 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b543764700b0f6cebc2d7216288aa20e295722973d86345ed28d69f8e0b5537b
BLAKE2b-256 checksum
How to use checksums
eb36ba50e6aa0a3988ba4fdc4466eaa4f5a96bbe088a892a8378257fd526f26c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / naiyue_test_agent-0.2.0-py3-none-manylinux_2_17_aarch64.whl

Download URL naiyue_test_agent-0.2.0-py3-none-manylinux_2_17_aarch64.whl
Size 3.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
78ed2a5ff23fdb995905cb85396559b5a11b353ac00078a8eef86030eb58d547
BLAKE2b-256 checksum
How to use checksums
718755db5f43edfa2dc412472685d87f941c312e29d10b5edab204ff52976236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / naiyue_test_agent-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL naiyue_test_agent-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 3.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
86e82a7a0697ac16583ac50cee717580d83d0fd9215f9ab55835812497939a79
BLAKE2b-256 checksum
How to use checksums
05d330175af46690f9e2de1838371421d291219875d9754e6cf5276da3aedf83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for naiyue-test-agent 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for naiyue_test_agent-0.2.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page