# @aiaiai-pt/martha-cli 中文文档

规范地址：https://npmcn.com/package/%40aiaiai-pt/martha-cli/

版本：0\.68\.1
npm 元数据更新时间：2026-11-03T09:42:18.457Z
中文译文更新时间：2026-11-06T22:52:12.757Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aiaiai-pt/martha-cli
原文对照：https://npmcn.com/package/%40aiaiai-pt/martha-cli/?lang=original
项目主页：https://docs.martha.nomadriver.co/
源码仓库：https://github.com/westeuropeco/martha

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.1 MB，5 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=22\.0\.0
- 运行依赖：5 个
- 首次发布：2026-05-09T23:46:44.472Z
- 最新版本发布：2026-11-03T09:42:18.284Z
- 近 30 天下载量：2199（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：56（近 12 个月 56 个）

## 中文简介

Martha AI 平台的终端第一客户端

## 安装

```sh
npm install @aiaiai-pt/martha-cli
```

也可以使用：`pnpm add @aiaiai-pt/martha-cli`、`yarn add @aiaiai-pt/martha-cli`、`bun add @aiaiai-pt/martha-cli`

## README

# 玛莎克丽

终端第一客户端 [玛莎](https://martha.nomadriver.co/) AI平台.

管理代理,功能,工作流程,任务,文档,以及更多来自您外壳的. 为人类开发者和外部代理机床(Claude Code、Ork、CrewAI、Pydantic AI等)设计——见 [代理一体化](https://npmcn.com/package/%40aiaiai-pt/martha-cli/#readme-agent-integration) 见下文.

## 安装

### 按要求运行( 建议)

```bash
npx -y @aiaiai-pt/martha-cli@latest --help
```

从 CI 或代理运行时间调用时按下一个版本 :

```bash
npx -y @aiaiai-pt/martha-cli@0.2.0 agents list --json
```

### 全球安装

```bash
npm i -g @aiaiai-pt/martha-cli
martha --version
```

要求节点.js >= 22.

## 快速启动

```bash
# 1. Configure a profile — writes ~/.martha/config.yaml
martha init                       # interactive (defaults to cloud preset)
martha init --preset local        # localhost dev stack
martha init --no-interactive --name staging --api-url https://...   # scripted

# 2. Authenticate
martha auth login                 # browser flow (PKCE)
martha auth login --username u --password p   # headless
export MARTHA_TOKEN=eyJhbGc...    # bypass login (CI / one-off)

# 3. Verify everything is wired up
martha doctor                     # API + Keycloak + token + version skew

# 4. Run something
martha agents list
martha functions list --json | jq '.[].name'
martha chat my-agent "Summarise the latest task in tracker INGEST-42"
```

完整命令引用 : `martha --help` (或任何子命令) `--help`) (中文(简体) ).

## 配置

配置文件为 `~/.martha/config.yaml`。每个配置文件定义:

```yaml
current_profile: default
profiles:
  default:
    api_url: https://martha.nomadriver.co
    keycloak_url: https://auth.nomadriver.co
    keycloak_realm: frank
    auth_type: oidc
```

覆盖每个命令 :

```bash
martha --profile staging agents list
martha --api-url http://localhost:8080 status
MARTHA_PROFILE=cloud martha tasks list
```

### 自动优先

1.  `MARTHA_TOKEN` env var (raw JWT, 绕过一切)
2.  `MARTHA_CLIENT_ID` + 键 `MARTHA_CLIENT_SECRET` (客户证书补助金,自动更新)
3.  配置文件存储的符号来自上一个 `martha auth login`
4.  基于浏览器的 OIDC( 只交互)

## JSON 输出

每个命令都支持 `--json` 用于机器可读输出。 管道时使用 `jq` 或从脚本/代理人调用:

```bash
martha agents list --json | jq '.[] | {name, status}'
```

退出代码 : `0` 成功 · `1` 一般错误 ^ `2` 认证失败 `3` 找不到.. `4` 鉴定 · `5` 冲突(409).

## 在巴斯频道放一个特工

一个命令, 不安装自己的命令 :

```bash
npx -y @aiaiai-pt/martha-cli channels install-harness buzz
```

然后进入 [巴兹](https://github.com/block/buzz) 桌面 : **新代理 ~ 运行时间"玛莎"**. 命令将 Martha 注册为 ACP 运行时间, 将定义写入 Buz 自己的 app-data 目录 —— 任何 ACP 代理的辅助路径, 没有 PR 和 插件 .

有个特工来做 离开巴斯家 **编辑代理** 空 :

```bash
martha principals bootstrap --mode agent --agent support \
  --prompt "You answer support questions from our handbook." \
  --intents rag --collections "Handbook" --save-profile support
martha channels install-harness buzz --use-profile support
```

简介 _名称_ 定义; 证书在 `~/.martha/credentials.json` (0600) (中文(简体) ). 在信任它之前检查所有东西 `martha channels preflight buzz --agent support --relay wss://…`,其中列出每个缺失的前提条件并退出非0。 全向导 : [https://docs.martha.nomadriver.co/buzz 页面存档备份,存于互联网档案馆](https://docs.martha.nomadriver.co/buzz)。 。 。 .

## 代理一体化

这个包装了一种能提高特务技能的参考 `skills/martha-cli/SKILL.md` 描述每个命令、JSON合同和概念原始(租户、代理人、功能、任务等)。 特工带可以直接拉出:

```bash
# Print the skill to stdout (works for npm i -g and npx)
martha skill

# Seed an agent's prompt context
npx -y @aiaiai-pt/martha-cli@latest skill | head -200
```

## 稳定

`0.x` 发布可能会在小版本之间更改CLI旗或JSON输出. 在 CI/代理上下文中设定一个版本 :

```bash
npx -y @aiaiai-pt/martha-cli@0.3.0 ...
```

`1.0.0` 将致力于稳定的契约——见 [追踪问题](https://github.com/westeuropeco/martha/issues/292)。 。 。 .

## 发展

```bash
cd martha-cli
bun install
bun run dev -- agents list      # run from source
bun run build                   # produce dist/index.js
bun run test:run                # unit + integration tests
MARTHA_LIVE=1 bun run test:run tests/live/  # live tests against local Martha
```

CLI住在美国 [西欧佩科/马特哈](https://github.com/westeuropeco/martha) 单重 `martha-cli/`公关欢迎.

## 许可证

麻省理工学院

## 常见问题

### @aiaiai-pt/martha-cli 是什么？

Martha AI 平台的终端第一客户端

### 如何安装 @aiaiai-pt/martha-cli？

在项目目录运行 npm install @aiaiai-pt/martha-cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 martha，可以用 npx martha 直接运行。

### @aiaiai-pt/martha-cli 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/aiaiai-pt\_\_martha-cli 是否存在。

### @aiaiai-pt/martha-cli 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @aiaiai-pt/martha-cli 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @aiaiai-pt/martha-cli 可以商用吗？

@aiaiai-pt/martha-cli 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @aiaiai-pt/martha-cli 的下载量有多少？

根据 npm 官方下载统计，@aiaiai-pt/martha-cli 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,199 次，日均约 73 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @aiaiai-pt/martha-cli 还在维护吗？

最新版本 0\.68\.1 发布于 2026/11/03（4 天前）；至今共发布 56 个版本，其中过去 12 个月发布了 56 个；首次发布于 2026/05/10。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

