@aiaiai-pt/martha-cli

中文文档
0.68.1发布于 2026/11/03MITES Module近 30 天下载 2199

Terminal-first client for the Martha AI platform

原始使用文档
文档目录12 节
  1. Install
  2. Run on demand (recommended)
  3. Install globally
  4. Quickstart
  5. Configuration
  6. Auth precedence
  7. JSON output
  8. Put an agent in a Buzz channel
  9. Agent integration
  10. Stability
  11. Development
  12. License

martha-cli

Terminal-first client for the Martha AI platform.

Manage agents, functions, workflows, tasks, documents, and more from your shell. Designed for both human developers and external agent harnesses (Claude Code, ork, CrewAI, Pydantic AI, etc.) — see Agent integration below.

Install

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

Pin a version when calling from CI or agent runtimes:

npx -y @aiaiai-pt/[email protected] agents list --json

Install globally

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

Requires Node.js >= 22.

Quickstart

# 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"

Full command reference: martha --help (or any subcommand --help).

Configuration

Profiles live at ~/.martha/config.yaml. Each profile defines:

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

Override per-command:

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

Auth precedence

  1. MARTHA_TOKEN env var (raw JWT, bypasses everything)
  2. MARTHA_CLIENT_ID + MARTHA_CLIENT_SECRET (client_credentials grant, auto-refresh)
  3. Profile-stored token from prior martha auth login
  4. Browser-based OIDC (interactive only)

JSON output

Every command supports --json for machine-readable output. Use it when piping to jq or calling from scripts/agents:

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

Exit codes: 0 success · 1 generic error · 2 auth failure · 3 not found · 4 validation · 5 conflict (409).

Put an agent in a Buzz channel

One command, no install of its own:

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

Then in Buzz Desktop: New agent → runtime "Martha". The command registers Martha as an ACP runtime by writing a definition into Buzz's own app-data directory — the supported route for any ACP agent, no PR and no plugin.

To have an agent for it to be, and leave Buzz's Edit Agent empty:

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

The profile name goes in the definition; the credential stays in ~/.martha/credentials.json (0600). Check everything before trusting it with martha channels preflight buzz --agent support --relay wss://…, which names each missing precondition and exits non-zero. Full guide: https://docs.martha.nomadriver.co/buzz.

Agent integration

This package ships an agent-facing skill reference at skills/martha-cli/SKILL.md describing every command, JSON contract, and conceptual primitive (tenant, agent, function, task, etc.). Agent harnesses can pull it directly:

# 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

Stability

0.x releases may change CLI flags or JSON output between minor versions. Pin a version in CI/agent contexts:

npx -y @aiaiai-pt/[email protected] ...

1.0.0 will commit to a stable contract — see the tracking issue.

Development

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

The CLI lives in the westeuropeco/martha monorepo under martha-cli/. PRs welcome.

License

MIT

版本与发布记录

@aiaiai-pt/martha-cli 共发布 56 个版本,首次发布于 2026/05/10;过去 12 个月发布了 56 个版本。

版本发布日期距今
0.68.1latest2026/11/034 天前
0.68.02026/11/034 天前
0.66.12026/11/025 天前
0.66.02026/11/016 天前
0.65.02026/10/2514 天前
0.64.02026/10/2117 天前

关于 @aiaiai-pt/martha-cli 的常见问题

@aiaiai-pt/martha-cli 是什么?

Terminal-first client for the Martha AI platform

如何安装 @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 和提交记录判断。