@aegean-org/necode-cli
v1.1.1
Published
NeCode terminal coding assistant for NE services
Readme
@aegean-org/necode-cli
NeCode 是基于本地 Codex Rust 运行时的终端编程助手。TypeScript 层负责 NE 登录、模型默认值、MCP、RAG、ACP、Mobile 和飞书集成;交互式会话、工具调用、历史记录和恢复由 Rust 运行时处理。
安装
npm install -g @aegean-org/necode-cli
necode --version
necode也可以使用平台安装脚本:
irm -Headers @{'User-Agent'='necode-installer'} https://www.inoteexpress.com/soft/updater/download/install.ps1 | iexcurl -fsSL -A necode-installer https://www.inoteexpress.com/soft/updater/download/install.sh | sh如果 NoteExpress 安装脚本入口暂时不可用,也可以从 GitHub 获取同一脚本:
irm https://github.com/aegean-org/necode-cli-releases/releases/latest/download/install.ps1 | iexcurl -fsSL https://github.com/aegean-org/necode-cli-releases/releases/latest/download/install.sh | sh二进制下载与校验
npm 包本身只包含轻量启动脚本和二进制清单。首次运行会:
- 根据包版本、操作系统和架构选择对应资产。
- 优先通过 NoteExpress 鉴权下载入口获取带版本文件名的资产。
- 下载失败时回退到同版本 GitHub Release。
- 对每个文件执行 SHA256 校验,通过后缓存到本机。
Windows 1.1.1 使用以下镜像文件名:
necode-launcher-windows-x64-v1.1.1.exe
necode-runtime-windows-x64-v1.1.1.exe
necode-sandbox-setup-windows-x64-v1.1.1.exe
necode-command-runner-windows-x64-v1.1.1.exemacOS 和 Linux 的七牛镜像使用下载接口允许的 .bin 后缀,安装后仍保存为无后缀可执行文件:
necode-launcher-linux-x64-v1.1.1.bin
necode-runtime-darwin-arm64-v1.1.1.bin常用命令
necode 启动交互式终端
necode resume 恢复历史会话
necode -p "任务" 非交互执行任务
necode login --username 账号 登录 NE
necode logout 清除本地 NE 凭据
necode mcp defaults --install 安装默认 MCP 服务
necode rag import <路径> 导入 txt、md 或 pdf 文档
necode rag search <查询> 搜索本地 RAG 数据
necode acp 启动 ACP stdio 服务
necode mobile 启动 Mobile daemon 并显示配对二维码
necode feishu init 扫码创建并绑定飞书/Lark 应用
necode feishu 启动飞书/Lark 长连接桥在交互输入中使用 @doc 或 @文献 选择已经导入的 RAG 文档。
Mobile
在需要操作的项目目录运行:
necode mobile命令会检查 NE 登录、安装或复用 Mobile daemon、绑定当前 NeCode ACP 入口并打印配对二维码。Mobile 与 CLI 使用同一套 Rust thread ID 和持久历史,可在两端继续同一会话。
辅助命令:
necode mobile status
necode mobile qr
necode mobile doctor
necode mobile stop
necode mobile serve飞书/Lark
necode feishu init
necode feishu初始化命令会写入当前项目的 .env。支持的配置包括:
NECODE_FEISHU_APP_IDNECODE_FEISHU_APP_SECRETNECODE_FEISHU_DOMAINNECODE_FEISHU_WORKSPACENECODE_FEISHU_ALLOWED_CHATSNECODE_FEISHU_ALLOWED_USERS
不要提交包含应用密钥的 .env。
本地状态
默认状态目录是 ~/.necode-cli:
~/.necode-cli/auth.json NE 登录信息
~/.necode-cli/codex/ Rust 会话与运行配置
~/.necode-cli/tools/ Mobile daemon 和启动器
~/.necode-cli/logs/ NeCode 运行日志可用 NE_CLI_HOME 覆盖根目录。其他常用环境变量:
NE_CLI_API_KEYNE_CLI_MODELNECODE_RUNTIMENECODE_MOBILE_DAEMONNECODE_MOBILE_DAEMON_DIRNECODE_MOBILE_DAEMON_URL
源码开发
bun install
bun packages/coding-agent/src/cli.ts --help
bun --cwd=packages/coding-agent run check
bun --cwd=packages/coding-agent test构建 Rust 运行时:
& 'C:\Users\11250\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\cargo.exe' build `
--manifest-path '.\codex-rs\Cargo.toml' `
-p codex-cli --bin necode构建 TypeScript 启动层:
bun --cwd=packages/coding-agent run build发布
npm run build:necode:binaries -- --targets win32-x64
npm run pack:necode -- --targets win32-x64正式发布通过 GitHub Actions 的 Publish NeCode 工作流完成:
- 全平台构建 launcher 与 Rust runtime。
- 对各平台集成运行时执行 smoke 验证。
- 创建或更新
aegean-org/necode-cli-releases中的 GitHub Release。 - 将带版本文件名的资产同步到七牛云。
- 将包含 NoteExpress 下载入口和 GitHub 回退地址的 npm 包发布到 npm。
工作流按平台和 codex-rs 内容哈希缓存已经通过 smoke 验证的 Rust 资产。纯文档或 TypeScript 修改只重编 launcher,并复用缓存的 Rust runtime。
工作流配置:
- Secrets:
RELEASES_TOKEN、NPM_TOKEN、QINIU_ACCESS_KEY、QINIU_SECRET_KEY - Variables:
QINIU_BUCKET、QINIU_PREFIX、QINIU_CDN_BASE
