@orlan-maker/cli 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,70 +17,43 @@ orlan connect --agent claude-code
17
17
  ```
18
18
 
19
19
  - `orlan auth login` shows a code and opens the approval page in your browser. Sign in, check the
20
- code, choose the organisation, and the topics and role your agents get. The command waits for the
20
+ code, choose the organisation, and what your agents get: one topic, or all topics of the organisation
21
+ (also the topics made later). Details has a checkbox for each topic and the agent role. The command waits for the
21
22
  approval (codes work for 10 minutes). The CLI token goes to the OS keychain (macOS keychain, or the
22
23
  Secret Service on Linux), else to `credentials.json` in the config folder, readable by you only.
23
24
  `--server <url>` signs in to another Orlan server; `--no-browser` only prints the address.
25
+ - `orlan auth login --pair <id>` is the sign-in that the prompt of the Connect dialog in the Orlan web
26
+ app runs. It shows the code and opens no page: the code waits in the Connect dialog. Check that the
27
+ dialog shows the same code, choose this topic or all topics for your agents, then approve it there. A
28
+ `--pair` id works for one sign-in, for 10 minutes. A second CLI with the same id stops with
29
+ `pair_used`, and the dialog warns. A denied sign-in stops the CLI with `login_denied`.
24
30
  - `orlan connect` makes an agent token and keeps it in the keychain. The agent then works on Orlan
25
- with the `orlan` command. Only an admin of the organisation connects agents. The command installs
26
- the skills, and the plugin or the hooks of the agent (table below). Then it tests the token with one
27
- plain HTTP call. `--topic` and `--role` change the topics and the role of the agent.
31
+ with the `orlan` command. Only an admin of the organisation connects agents. The command writes the
32
+ skills where the agent reads skills (table below), and tests the token with one plain HTTP call.
33
+ It writes nothing else: no plugin, no hook, no MCP entry, and no instruction file such as
34
+ `CLAUDE.md` or `AGENTS.md`. `--topic` limits the agent to the named topics, and `--role` changes its role.
28
35
  - The skills are `orlan`, `orlan-review` and `orlan-versions`. `orlan` tells the agent what Orlan is:
29
36
  "the canvas", "the board" and "the topic" mean the Orlan topic, and a file the person asks for goes
30
- on the topic. A diagram is board shapes, never an HTML file or notes. `orlan skills add` writes the
31
- skills again without a new token.
32
- - An older CLI wrote an Orlan server entry in the agent's settings. `orlan connect` removes that
33
- entry, and keeps every other entry.
37
+ on the topic. A diagram is board shapes with labeled arrows, never an HTML file or notes: the agent
38
+ draws a flow with `orlan board mermaid` in a frame, fixes the warnings and looks at
39
+ `orlan board view`. A second `orlan connect` writes the skills again.
40
+ - An older CLI (0.1 and 0.2) installed more: the Claude Code plugin `orlan@orlan` and its local
41
+ marketplace, hooks for Codex and Cursor, an OpenCode plugin, and an Orlan MCP entry. `orlan connect`
42
+ and `orlan disconnect` remove them, and keep every other entry the person has.
34
43
  - `orlan status` shows who you are, the server, and each connected agent, and tests each agent's
35
44
  connection with one plain HTTP call. It ends with exit code 1 when a check fails.
36
45
 
37
46
  Agents: `claude-code`, `codex`, `cursor`, `opencode`, `other`.
38
47
 
39
- | Agent | Skills | Also installs |
40
- | --- | --- | --- |
41
- | claude-code | in the plugin | the Claude Code plugin (below) |
42
- | codex | `~/.agents/skills` | the hooks in `$CODEX_HOME/hooks.json` |
43
- | cursor | `~/.cursor/skills` | the hooks in `~/.cursor/hooks.json` |
44
- | opencode | `~/.config/opencode/skills` | the plugin in `~/.config/opencode/plugins/orlan.js` |
45
- | other | `.agents/skills` in the folder you are in | - |
48
+ | Agent | Skills |
49
+ | --- | --- |
50
+ | claude-code | `~/.claude/skills` (`$CLAUDE_CONFIG_DIR/skills` when it is set) |
51
+ | codex | `~/.agents/skills` |
52
+ | cursor | `~/.cursor/skills` |
53
+ | opencode | `~/.config/opencode/skills` |
54
+ | other | `.agents/skills` in the folder you are in |
46
55
 
47
- With `--no-plugin`, Claude Code gets no plugin, and the skills go to `~/.claude/skills`. Without
48
- `--agent`, the CLI finds the agent that runs it from its environment.
49
-
50
- ## The Claude Code plugin
51
-
52
- This package is also the Claude Code plugin `orlan@orlan`. Its public marketplace is
53
- https://github.com/AliProgrammin/orlan-plugin (MIT). Install it in two lines:
54
-
55
- ```
56
- claude plugin marketplace add AliProgrammin/orlan-plugin
57
- claude plugin install orlan@orlan
58
- ```
59
-
60
- `orlan connect --agent claude-code` installs it too; from a checkout,
61
- `claude plugin marketplace add ./packages/cli` and `claude plugin install orlan@orlan` do the same. One install gives the session:
62
-
63
- - `orlan` on the PATH of Claude Code's shell.
64
- - Hooks that show the session on the board: working (session start, a prompt, each tool), waiting for
65
- input (a permission prompt or a question in the terminal), idle (the turn ended), done (the session
66
- ended). At the session start, `orlan brief` goes into the session's context, with one line that says
67
- what Orlan is: "the canvas", "the board" and "the topic" mean the Orlan topic, and a diagram, a page,
68
- a deck or a mock starts with the `orlan` skill. Codex, Cursor and OpenCode get the same line, from
69
- `hooks/orlan-intro.txt`.
70
- - The skills `orlan`, `orlan-review` and `orlan-versions`.
71
-
72
- The session works on Orlan with the `orlan` command. A new request comes to the session when the agent
73
- runs `orlan brief`, `orlan inbox` or `orlan wait`.
74
-
75
- ## The OpenCode plugin
76
-
77
- `orlan connect --agent opencode` also writes the Orlan plugin to `~/.config/opencode/plugins/orlan.js`.
78
- When a session's turn ends, the plugin runs `orlan hook wait`. A mention of the agent on the board then goes
79
- to the session as a new prompt, and a new turn starts. The plugin also shows the session on the board:
80
- working, waiting for a permission prompt, idle, done. It adds the line that says what Orlan is to the
81
- system prompt of each session. A request wakes a session only while OpenCode runs
82
- (the TUI or `opencode serve`). Restart a running OpenCode to load the plugin. `orlan disconnect
83
- --agent opencode` removes it.
56
+ Without `--agent`, the CLI finds the agent that runs it from its environment.
84
57
 
85
58
  ## Daily commands
86
59
 
@@ -100,21 +73,20 @@ orlan comments list [--topic <topic>] [--status open|resolved|all] [--file <file
100
73
  orlan comment <thread> "<text>" | --file <file> --page <n> [--region <x,y,w,h>] "<text>" | --at <x,y> "<text>" [--topic <topic>]
101
74
  orlan comments resolve <thread> [--topic <topic>]
102
75
  orlan board [--topic <topic>]
103
- orlan board add note|text|frame ["<text>"] --at <x,y> [--size <w,h>] | arrow --from <item> --to <item>
104
- orlan board change <item> [--text "<text>"] [--at <x,y>] [--size <w,h>] [--from <item>|none] [--to <item>|none]
76
+ orlan board view --out <file.png> [--frame <frame>] [--topic <topic>]
77
+ orlan board add note|text|frame|shape ["<text>"] --at <x,y> [--size <w,h>] [--text-color <color>] [--kind <kind>] [--color <color>] [--frame <frame>|none] | arrow --from <item> --to <item> [--text "<label>"] [--id <id>]
78
+ orlan board change <item> [--text "<text>"] [--at <x,y>] [--size <w,h>] [--text-color <color>] [--kind <kind>] [--color <color>] [--from <item>|none] [--to <item>|none] [--frame <frame>|none]
105
79
  orlan board delete <item>...
106
80
  orlan board edit '<edits as JSON>'
81
+ orlan board mermaid <file.mmd> [--frame <frame>] [--topic <topic>]
107
82
  orlan tasks add "<text>" [--assignee me|user:<id>|agent:<id>] [--thread <thread>] [--done]
108
83
  orlan tasks change <task id> [--text "<text>"] [--done | --open] [--assignee me|user:<id>|agent:<id>|none]
109
84
  orlan decisions add "<title>" [--body "<text>"] [--thread <thread>]
110
85
  orlan search "<words>" [--topic <topic>] [--limit <n>]
111
86
  orlan open [<topic id>] [--file <file id>]
112
- orlan wait [--follow]
113
87
  orlan inbox [--new]
114
88
  orlan inbox done <request id>
115
- orlan respond <request id> --message "<text>" [--file <path>] [--to <file>] [--changelog "<text>"] [--base <n>] [--wait]
116
- orlan hook <working|needs-input|idle|done>
117
- orlan hook start|stop --agent codex|cursor
89
+ orlan respond <request id> --message "<text>" [--file <path>] [--to <file>] [--changelog "<text>"] [--base <n>]
118
90
  ```
119
91
 
120
92
  The ids people see work as input: a topic by its name, a file by its name, a thread as `#12`, and a
@@ -124,8 +96,9 @@ its id and topic: give the id, or add `--topic`.
124
96
 
125
97
  Every output ends with a `next_step` line, and every error says what to do next in a `next_step` line.
126
98
  With `--json`, a command prints small JSON on one line with a `next_step` field; an error is JSON too:
127
- `{"error": "<code>", "message": "...", "next_step": "..."}`. The hook commands
128
- print only what their harness reads, and `orlan inbox --new` prints nothing when there is no request.
99
+ `{"error": "<code>", "message": "...", "next_step": "..."}`. `orlan inbox --new` prints nothing when
100
+ there is no request. A text people wrote is always quoted, and the line that says so comes once in an
101
+ output.
129
102
 
130
103
  `orlan brief` is for the start of a session. It prints the topic, the open requests, the files with
131
104
  their current versions, and one `next_step` line, in about 500 tokens for 6 files and 3 requests. The
@@ -133,14 +106,74 @@ topic is the one the agent used last, else its only topic. `orlan files add` pos
133
106
  topic and puts it on the board, in one request. Both are plain HTTP calls with the agent token.
134
107
 
135
108
  `orlan board` prints the board of the topic. Each item shows its id, type, place and size in board
136
- coordinates, and its text. A file shows its name and pages, and an arrow the items it links. Then come the
137
- timer, the open vote and the last vote with its result, and the open tasks. People vote; an agent reads
138
- the vote, it does not vote. `orlan board add` adds a note, a text, a frame or an arrow, `orlan board
139
- change` changes an item's text, place, size or arrow ends, and `orlan board delete` deletes items. Each
109
+ coordinates, and its text. A note, a text and a shape also show a text size other than M and a text color other
110
+ than ink (`text color red`), a shape its kind and color, a file its name and pages, and an arrow the items it links and its label. An item in a frame
111
+ shows `in frame <id>`. Then come the timer, the open vote and the last vote with its result, and the
112
+ open tasks. People vote; an agent reads the vote, it does not vote. `orlan board add` adds a note, a
113
+ text, a shape, a frame or an arrow, `orlan board change` changes an item's text, place, size, a shape's
114
+ kind and color, or an arrow's ends and label, and `orlan board delete` deletes items. A shape has a kind (`--kind`:
115
+ rectangle, rounded, ellipse, diamond, cylinder or parallelogram; default rectangle), a named color
116
+ (`--color`: white, gray, blue, teal, green, yellow, orange or red; default white), and its words in its
117
+ middle. An arrow can end on a shape. An arrow's text is its label (`--text "yes"`), drawn on a pill on
118
+ the middle of the arrow that moves with it; `--text ""` takes it away. Each
140
119
  command is one step that a person can undo on the board. `orlan board edit` takes a JSON list of edits
141
- and makes them in one step, all or none; `"#0"` names the item that the first edit made. A file on the
142
- board only moves. A negative coordinate goes with `=`: `--at=-50,120`. The CLI cannot draw shapes yet,
143
- so a diagram is not made with these commands.
120
+ and makes them in one step, all or none. A create can give its item an id of its own (`"id":"api"`, also
121
+ `orlan board add --id api`), so the arrow of the same step, and a later command, name it. Without
122
+ `--size <w,h>` or `w`, `h`, a note is 190x120, a text 320x40, a shape 160x100 and a frame 480x320. A note, a
123
+ text and a shape take a text size: `--size S`, `M`, `L` or `XL` (`"size"` in the JSON; default M), and a
124
+ text color for their words: `--text-color` ink (default), white, gray, blue, teal, green, yellow, orange or
125
+ red (`"textColor"` in the JSON). The names are the shape colors; the words draw in a strong shade of each
126
+ that reads on a note, a shape and the board (white reads only on a dark background). Their
127
+ box grows to fit their words, so no word is cut and no word spills out: a note and a shape grow in
128
+ height, and a text is as high as its lines. With no width, a text is as wide as its words (at most 20
129
+ em), and a shape grows wider for its words (at most twice its default width, 320). `orlan board add`, `orlan board
130
+ change` and `orlan board edit` print each item with its final place and size, after it grew. An unknown key, a key the item cannot use, or an arrow that ends on an arrow is
131
+ refused, nothing changes, and the error says what to change. A file on the board only moves, and goes in a frame or out of it. A negative coordinate goes with `=`: `--at=-50,120`.
132
+ A frame holds items: a move of the frame moves its items, and the items of the frames in it. An item goes in the
133
+ smallest frame that holds more than half of it when it is made or moved, and a new frame takes the items it is
134
+ drawn around. `--frame <id>` on `orlan board add` and `orlan board change` (`"frame"` in the JSON) puts an item
135
+ in a frame, and `--frame none` (`"frame": null`) takes it out; the item stays where it is. An arrow is in no
136
+ frame: its ends follow the items they are on. A deleted frame leaves its items on the board.
137
+ After each change, `orlan board add`, `change`, `delete` and `edit` print drawing warnings about the items the change
138
+ made or changed, one `warning:` line each, after the result: two items overlap (`shape api overlaps shape db by 40
139
+ px: move one of them.`), an item lies partly or all outside the frame it is in, an arrow crosses an item that is not one of its ends, an end of an arrow points at no item, an arrow label covers an item, or a frame title is wider than its frame. Each warning
140
+ names the items and says what to change; the first id is the item to change. A warning never stops a change. With
141
+ `--json` the answer has `"warnings": [{"kind","ids","text"}]`, and `[]` when the drawing is clean.
142
+
143
+ `orlan board mermaid <file.mmd>` draws a Mermaid flowchart on the board as real items, in one step that a person
144
+ can undo: a shape for each node, an arrow with its label for each link, and a frame for each subgraph. The first
145
+ line is `flowchart` or `graph` with TD, TB, BT, LR or RL. `A[text]` is a rectangle, `A(text)` and `A([text])`
146
+ rounded, `A((text))` an ellipse, `A{text}` a diamond, `A[(text)]` a cylinder and `A[/text/]` a parallelogram;
147
+ `A[[text]]`, `A>text]`, `A{{text}}`, `A[\text\]` and `A(((text)))` take the nearest of these. A label goes as
148
+ `A -->|label| B` or `A -- label --> B`; `-->`, `---`, `-.->` and `==>` all become arrows, and `A & B --> C` and
149
+ chains work. `subgraph id [title] ... end` is a frame, also in another frame. A fill from `style`, `classDef`,
150
+ `class` or `:::` takes the nearest shape color. `A ~~~ B` places B after A and draws no arrow. A `direction` in a
151
+ subgraph, and a link to a subgraph id, work when no link goes out of that subgraph, as in Mermaid. `linkStyle`,
152
+ `click` and a `direction` in a subgraph that a link goes out of are left
153
+ out, and the answer says so. The layout is in layers (dagre), each box as large as its words need, with no
154
+ overlap and no arrow across a box for the usual diagrams; the answer lists drawing warnings when it could not
155
+ avoid one. Subgraphs that are stacked or side by side line up (one left edge and width, or one top and height)
156
+ with even gaps, and subgraphs that no link joins keep the order of the file. The diagram goes in free space right of the items on the board, and nothing on the board moves.
157
+ Each node and subgraph keeps its Mermaid id as its item id, so `orlan board change <id>` changes it later; an
158
+ id that is on the board already gets a prefix (`m2-`, `m3-`), and the answer gives it. With
159
+ `--frame <frame>`, the diagram goes in that frame, which then fits it with 24 px of room (it grows and shrinks;
160
+ a person's items in it stay in it), and it replaces the items this agent
161
+ drew in that frame before: run it again after a change to the file, and the diagram changes in place, at the
162
+ same place and with the same ids. A person's items in the frame stay where they are. Another Mermaid diagram (`sequenceDiagram`,
163
+ `classDiagram` and others) is refused with `mermaid_unsupported`, and a syntax error with `mermaid_invalid` and
164
+ its line; both list what works, and nothing changes. With `--json`: `{ ids, items, warnings, replaced,
165
+ ignored }`.
166
+
167
+ `orlan board view --out <file.png>` saves a PNG picture of the board as people see it, so an agent can look
168
+ at what it drew. Orlan draws it with the same board canvas people use, without cursors, made-by marks and
169
+ tools. The picture fits all the items, or one frame with `--frame <frame>`. It shows them at 100% when they
170
+ fit in 1600 pixels, else smaller to fit, but not below 20%. A board too large for that shows its middle
171
+ part, and the answer says so (`"cut": true`): then look at one frame at a time. A picture is at most 4000 x
172
+ 4000 pixels. The command prints where it saved the picture, its size in pixels and KB, its zoom, and the
173
+ board point of its top left pixel. With `--json`: `{ saved, topicId, frameId, width, height, bytes, zoom,
174
+ at: { x, y }, cut }`, where `saved` is the absolute path. The picture holds only the board and the files of
175
+ that topic: a topic the token does not reach is refused. Errors: `frame_not_found`, `render_unavailable`,
176
+ `render_timeout`, `render_failed`.
144
177
 
145
178
  `orlan tasks add` adds a task to the topic, `orlan tasks change` changes its text, marks it done or open,
146
179
  or sets its assignee (`--assignee me` is the agent). `orlan decisions add` records a decision in the
@@ -158,13 +191,13 @@ on the board at once. "@" and a name mentions a person or an agent of the topic.
158
191
  agent makes no request when that agent still has an open request from you in the thread, or after 5 asks
159
192
  this hour: the command prints "Not asked: <name>".
160
193
 
161
- `orlan wait` waits for the next request to the agent: a person, a guest or an agent mentions it in a
162
- comment. It prints the request with each comment, its file, version, page, region, the text under the
163
- region and a crop link, and exits. Running it again after a lost connection is safe: the request comes
164
- once. The wait confirms each request after it printed it; when the wait stops before that, the request
165
- goes back to the inbox within 20 seconds. `--follow` stays open and prints one line per request. `orlan inbox` prints the open requests;
166
- `--new` takes the new ones and prints nothing when there are none, for a stop hook. `orlan inbox done`
167
- closes a request when its work is finished.
194
+ A request comes when a person, a guest or an agent mentions the agent in a comment, or answers in a
195
+ thread the agent asked in. `orlan inbox` prints the open requests, each with its comments, file,
196
+ version, page, region, the text under the region and a crop link, and exits at once. `--new` takes
197
+ only the new ones and prints nothing when there are none. The CLI confirms each request after it
198
+ printed it; when it stops before that, the request goes back to the inbox within 20 seconds.
199
+ `orlan inbox done` closes a request when its work is finished. Nothing wakes the agent when a request
200
+ comes: it runs `orlan brief` or `orlan inbox` when the person asks, or at the start of a task.
168
201
 
169
202
  `orlan files pull --pages 2,5` gets pages, not the file: it saves the image of each page as
170
203
  `<name>-page-<n>.png` in the `--out` folder, and prints the text of each page. `--since 4` gets the
@@ -185,38 +218,29 @@ When a newer version landed first, Orlan refuses it with `stale_base`, the newer
185
218
  `orlan respond` closes a review round in one command. With `--file`, it posts the file as a new version
186
219
  of the file the request is about, with the version the comments were on as its base (`--to <file id>`
187
220
  when the request names no file or several). Then it replies with the message in each thread of the
188
- request, resolves the threads, and marks the request done. `--wait` then waits for the next request, as
189
- `orlan wait` does. A request that is done already gives a refusal and a `next_step` line. To ask a
221
+ request, resolves the threads, and marks the request done. A request that is done already gives a refusal and a `next_step` line. To ask a
190
222
  person a question, reply with `orlan comment` and leave the thread open: the answer comes to the
191
223
  inbox as a request. A request that stays taken for 10 minutes with no done goes back to the inbox.
192
224
 
193
- `orlan hook` is for harness hooks, not for the model: it tells the board that the agent works, waits
194
- in the terminal (for example on a permission prompt), is idle or is done. It reads the hook's JSON on
195
- standard input, makes one request, prints nothing and makes no model call. Orlan never answers the
196
- terminal prompt; the board tells people to go to the terminal. With no agent connected, it does nothing.
197
-
198
- `orlan hook start` and `orlan hook stop` are the session start and stop hooks of Codex and Cursor, and
199
- `orlan connect --agent codex|cursor` installs them. Codex and Cursor sessions do not wake when idle:
200
- the start hook puts the brief and the line that says what Orlan is in the session, and when a turn ends the stop hook gives the session the
201
- new requests, so it works on at once. After 5 requests in a row it lets the session stop. Codex runs a
202
- hook only after you trust it once with `/hooks`.
203
-
204
- Each command shows on the board as a step of the agent's hook session: a page it reads moves its cursor
205
- there. The command finds its session from the harness: `CLAUDE_CODE_SESSION_ID` in Claude Code,
206
- `CODEX_THREAD_ID` in Codex, and in OpenCode `ORLAN_SESSION` (the plugin sets it) or
207
- `OPENCODE_SESSION_ID`. Cursor gives no session id to the shell: Orlan then takes the hook session of the
208
- agent that reported last.
225
+ Each command shows on the board as a step of the agent's session: the agent works while it calls, and
226
+ a page it reads moves its cursor there (F102). There is no hook. The command finds its session from
227
+ the harness: `CLAUDE_CODE_SESSION_ID` in Claude Code, `CODEX_THREAD_ID` in Codex and
228
+ `OPENCODE_SESSION_ID` in OpenCode (`ORLAN_SESSION` wins over them). Cursor and a plain shell give
229
+ none: the CLI then makes one for its shell, so each command of that shell lands on one session.
209
230
 
210
- While a wait of the agent is open, the `next_step` lines do not say `--wait`:
211
- the open wait gets the next request.
231
+ A person on the board can press Stop on the agent (D109). Each next command of each of its sessions
232
+ on that topic then prints who stopped it, the topic and what to do now: `orlan inbox` and `orlan brief`
233
+ show the stop, and every other command fails with `agent_stopped`, so the agent changes nothing more.
234
+ The stop stays on that session. A new session of the agent (a new session id, for example a new
235
+ conversation in the harness) is not stopped.
212
236
 
213
237
  A version the agent posts waits for a person to make it current. When several agents are connected,
214
238
  add `--agent <id>`.
215
239
 
216
240
  ## Stop
217
241
 
218
- - `orlan disconnect --agent <id>` revokes the agent's token, and removes its plugin or hooks and an old
219
- Orlan server entry. The skills stay.
242
+ - `orlan disconnect --agent <id>` revokes the agent's token, and removes its Orlan skills and what an
243
+ older CLI installed.
220
244
  - `orlan auth logout` revokes the CLI token. You can also revoke it in Orlan: Profile, Orlan CLI sign-ins.
221
245
 
222
246
  Run `orlan help` for every command, and `orlan <command> --help` for its options.