Armadra

使用

Agent 与 CLI

支持的 CLI、启动与恢复会话、权限模式、终端与会话视图两种驱动方式、会话时间线与内置的 ama。


Armadra 启动的是你本机已经装好并登录的真实 CLI,账户、模型选择、工具策略与会话格式都沿用它自己的。这一页讲怎样启动、恢复、设置权限,以及在终端与会话视图之间选哪种方式。

支持的 Agent

CLI 状态通道 恢复会话 非默认权限模式
Claude Code 命令 Hook --resume ID 自动编辑 / 全自动 / 计划
Codex 命令 Hook resume ID 自动编辑 / 全自动 / 计划
OpenCode 插件 --session ID 仅 CLI 默认
Pi 进程内扩展 --session PATH_OR_ID 仅 CLI 默认
Oh My Pi 进程内扩展 --resume ID 自动编辑 / 全自动
GitHub Copilot 命令 Hook --resume ID 自动编辑 / 全自动 / 计划
ama 宿主适配器 --resume ID 自动编辑 / 全自动 / 计划

ama 是 Armadra 自带的协调 Agent,随安装包一起提供,不需要另装,见下文「内置的 ama」。也可以在「设置 → 自定义 Agent」添加自定义 CLI,借用任一内置 CLI 的启动方式。

安装检测与启动

Armadra 不替你安装或登录 CLI。启动前先在终端里把要用的 CLI 装好并登录一次。

  1. 在画布空白处右键(或点 Dock 上的「新建」),在「AI 助手」分组里选「新建 Claude Code」「新建 Codex」等。
  2. 没有检测到的 CLI 在菜单里标为「未安装」,不能选。
  3. 节点出现后直接运行对应的 CLI。节点头部的状态胶囊反映它自己的回报:启动中、运行中、等待审批、等待回答、已完成等。

状态来自 CLI 自己上报:Claude Code、Codex、Copilot 经命令 Hook,Pi 与 Oh My Pi 经进程内扩展,OpenCode 经插件。这些只在从画布启动时注入,在画布外自己启动的 CLI 不受任何影响。

恢复会话

  • 按 ⌘K 打开命令面板(或用侧栏顶部的搜索),在「历史对话」里选一条,会在画布上新开一个节点,用该 CLI 的恢复参数接回那个会话。
  • 要把 CLI 自己历史里的会话接到画布上,打开「设置 → Agent CLI」进入该 CLI 的子页,在「接管会话」一行点「选择…」,在「接管 Claude Code 的会话…」对话框里搜索并选一个(只对报告了列出会话能力的 CLI 出现;需要先打开工作空间)。
  • 恢复用的是各 CLI 自己的参数(见上表),所以只有那个 CLI 认得的会话才能接回。Copilot 在会话视图下不能接回已有会话。

权限模式

在「设置 → 默认」里设置「默认权限模式」与「默认 Agent」,新建节点沿用这个默认值。可选的模式有:默认、自动编辑、全自动、计划,但只列出该 CLI 有对应启动参数的那些。选了 CLI 不支持的模式,启动前会明确报错,不会悄悄降级。

选择模型

节点头部「更多 → 模型」列出该 CLI 文档里的模型别名,默认是「CLI 默认」。选择后在下一次启动时生效,当前会话不受影响。检测不到 CLI 版本时,这个菜单不出现。

两种驱动方式

同一个 Agent 节点可以在两种方式之间切换,会话本身不变:

终端视图 会话视图
看到什么 真实 CLI 的终端画面 消息流、工具调用、文件差异、权限卡
适合 习惯 CLI 原生交互、要用 CLI 的斜杠命令 看清每一步做了什么、在手机上用
状态来源 Hook、扩展或插件上报 经各家 ACP 适配器直接获得
  • 节点头部「更多」或右键菜单里选「会话视图」或「终端视图」切换。切换时如果有未答复的审批,先答完再切。
  • 在「设置 → 默认」的「Agent 默认视图」里选新建节点默认用哪种。
  • 会话视图里的回复可以一键落成便签、白板对象或编辑器节点:在消息的「输出到画板」里选「落为便签」「落为白板文字」「代码块 → 编辑器」或「Mermaid → 白板」。
  • 连线读取、消息、投递与休眠在两种视图下都一样。

各 CLI 在会话视图下的实测程度不同:Claude Code 已在真实 CLI 上实测,Pi 只实测了开会话与切换模式,其余尚未在真实 CLI 上实测。遇到问题可以随时切回终端视图。

会话时间线

会话视图里的内容是一条按回合排列的时间线:用户的消息、助手回复、思考、工具调用、计划与文件差异。

  • 连续的读文件、改文件、运行命令会折成一组,例如「读了 3 个文件」「运行 2 条命令」,点开看细节。
  • 打开已有节点时先显示历史,不必等 CLI 重新接上。
  • 节点头部的状态实时显示 Agent 正在做什么:思考中、调用工具、等待审批、等待回答、输出中、已休眠、已退出。
  • 终端驱动的 CLI 也汇入同一条时间线,但粒度是整条消息,不是逐字流式。
  • 回合出错或被拒绝时,时间线上有「重试」与「继续」。

节能休眠

空闲的 Agent 可以先退出 CLI 再结束进程,聚焦它或收到投递时用 resume 接回原会话。休眠中的节点显示「已休眠」。

内置的 ama

ama 是协调 Agent:给它一个目标,它把子任务落成画布上的 Agent 节点并收齐结果,详见协调者。它需要模型的 API Key,密钥保存在本机的密钥后端;在「设置 → Agent CLI → Armadra Agent」页的「Armadra Agent 的模型密钥」一组里选供应商、填 API Key、保存。

下一步

Guides

Agents and CLIs

Supported CLIs, launching and resuming sessions, permission modes, the terminal and session views, the session timeline and the built-in ama.


Armadra launches the real CLIs you have already installed and signed in to, and keeps their accounts, model choice, tool policy and session format. This page covers launching, resuming, permission modes, and how to choose between the terminal view and the session view.

Supported agents

CLI Status channel Resume Extra permission modes
Claude Code Command hook --resume ID Auto edit / Full auto / Plan
Codex Command hook resume ID Auto edit / Full auto / Plan
OpenCode Plugin --session ID CLI default only
Pi In-process extension --session PATH_OR_ID CLI default only
Oh My Pi In-process extension --resume ID Auto edit / Full auto
GitHub Copilot Command hook --resume ID Auto edit / Full auto / Plan
ama Host adapter --resume ID Auto edit / Full auto / Plan

ama is Armadra’s own coordinator agent. It ships with the installer, so there is nothing to install; see “The built-in ama” below. You can also add custom CLIs under Settings → Custom agents, borrowing the launch shape of any built-in one.

Install detection and launching

Armadra does not install or sign in to CLIs for you. Install the CLI you want and sign in once in a terminal first.

  1. Right-click an empty spot on the canvas (or choose “New” on the Dock) and pick “New Claude Code”, “New Codex” and so on from the “AI assistants” group.
  2. A CLI that was not detected is marked “Not installed” and cannot be picked.
  3. The node runs the CLI directly. The status chip in its header reflects what the CLI itself reports: Starting, Running, Awaiting approval, Awaiting an answer, Done and so on.

Status comes from the CLI reporting on itself: Claude Code, Codex and Copilot through command hooks, Pi and Oh My Pi through in-process extensions, OpenCode through a plugin. All of this is injected only when launched from the canvas; a CLI you start yourself outside the canvas is untouched.

Resuming sessions

  • Press ⌘K to open the command palette (or use the search at the top of the sidebar) and choose an entry under “Conversations”; a new node opens on the canvas and picks that session back up with the CLI’s resume flag.
  • To bring a session from the CLI’s own history onto the canvas, open “Settings → Agent CLI”, go to that CLI’s page, choose “Choose…” on the “Attach a session” row, then search and pick one in the “Attach a Claude Code session…” dialog (only for CLIs that report they can list sessions; a workspace must be open).
  • Resuming uses each CLI’s own flags (see the table), so only sessions that CLI recognises can be picked up. Copilot cannot resume an existing session in the session view.

Permission modes

Set “Default permission mode” and “Default agent” under Settings → Defaults; new nodes use them. The modes are Default, Auto edit, Full auto and Plan, but only those the CLI has flags for are offered. Choosing a mode the CLI does not support fails clearly before launch instead of silently downgrading.

Choosing a model

More → Model in the node header lists the model aliases from that CLI’s own docs, with “CLI default” as the default. The choice applies on the next launch; the running session is unaffected. If the CLI version cannot be detected, the menu does not appear.

Two ways to drive an agent

The same agent node can switch between two ways of being driven while the session stays the same:

Terminal view Session view
What you see The real CLI’s terminal Message stream, tool calls, file diffs, permission cards
Good for CLI-native interaction and slash commands Seeing each step clearly, and using it on a phone
Status source Reported by hook, extension or plugin Obtained directly through each CLI’s ACP adapter
  • Choose “Session view” or “Terminal view” from More in the node header, or from the right-click menu. If an approval is still waiting, answer it before switching.
  • Under Settings → Defaults, “Default agent view” decides which one new nodes use.
  • A reply in the session view can become a sticky, a whiteboard object or an editor node in one click: under “Put on board” on a message, choose “Save as sticky”, “Save as whiteboard text”, “Code block → editor” or “Mermaid → whiteboard”.
  • Link reads, messages, delivery and hibernation behave the same in both views.

How far each CLI has been tested in the session view differs: Claude Code has been tested against the real CLI, Pi only for opening a session and switching modes, and the rest have not yet been tested against the real CLI. If something misbehaves, switch back to the terminal view at any time.

The session timeline

The session view is a timeline arranged by turn: your messages, assistant replies, thinking, tool calls, plans and file diffs.

  • Runs of reads, edits and commands fold into one group, such as “Read 3 files” or “Ran 2 commands”; open it for the details.
  • Opening an existing node shows its history first, without waiting for the CLI to reattach.
  • The node header status shows what the agent is doing right now: Thinking, Running a tool, Awaiting approval, Awaiting an answer, Responding, Asleep, Exited.
  • Terminal-driven CLIs feed the same timeline, but at whole-message granularity rather than token by token.
  • When a turn fails or is refused, the timeline offers “Retry” and “Continue”.

Eco hibernation

An idle agent can exit its CLI and end the process, then resume the same session when you focus it or when a delivery arrives. A hibernating node shows “Asleep”.

The built-in ama

ama is the coordinator agent: give it a goal and it turns subtasks into agent nodes on the canvas and collects the results; see Coordinator. It needs a model API key, kept in the machine’s key backend; enter it in “Settings → Agent CLI → Armadra Agent”: under “Armadra Agent model keys”, choose the “Provider”, enter the “API key” and “Save”.

Next

在 GitHub 上编辑本页 Edit this page on GitHub