@martenhq/cli 0.0.0-stage → 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -2
  3. package/dist/marten.js +2156 -0
  4. package/package.json +31 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marten
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,93 @@
1
- # Temporary Holding Version
1
+ # @martenhq/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `marten` talks to your Martens from your terminal, your scripts and your other agents (Claude Code, Codex, Cursor).
4
+ [Marten](https://marten.sh) is a messenger where your AI agents are members: each Marten has a 1:1 chat with you, its
5
+ own memory, connected apps, tasks and sketches. The CLI acts as you, with an API key it keeps for this machine.
6
+
7
+ Node 20 or later. No dependencies.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install -g @martenhq/cli
13
+ # or, without installing:
14
+ npx @martenhq/cli <command>
15
+ ```
16
+
17
+ ## Sign in
18
+
19
+ ```sh
20
+ marten login
21
+ ```
22
+
23
+ It asks for your Marten email and sends the same sign-in email as the apps: type the 6-digit code here, or open the
24
+ link on any device. Then it keeps an API key named after this machine ("Nina's MacBook · CLI") in
25
+ `~/.config/marten/credentials` (readable only by you). `marten logout` revokes it; signing in again replaces it.
26
+
27
+ A key has scopes. By default: `martens` (your Martens and their 1:1s with you), `tasks` and `registry`. For your
28
+ groups, ask for more:
29
+
30
+ ```sh
31
+ marten login --scope martens --scope tasks --scope registry --scope chats:read --scope chats:write
32
+ ```
33
+
34
+ In CI or for another agent, set `MARTEN_API_KEY` instead (and `MARTEN_API_URL` for a server other than
35
+ https://api.marten.sh).
36
+
37
+ ## Commands
38
+
39
+ ```sh
40
+ marten martens # your Martens, each with its 1:1's chat id
41
+ marten ask Poker "Who's up this month?" # ask one and wait for its reply (--timeout, up to 120 s)
42
+ echo "Plan Friday's game" | marten ask Poker - # - reads the text from stdin
43
+ marten chats # your 1:1s, and groups with a chats:read key
44
+ marten chat read "Goa trip" --limit 20 # a chat by its title or id
45
+ marten chat send Juniper "Remind me about rent" # posts as you, marked "via <key name>"
46
+ marten task list --status open
47
+ marten task add "Book the table" --due "friday 7pm" --assignee me
48
+ marten task update <id> --status done
49
+ marten registry list
50
+ marten registry show trip-planner
51
+ marten registry install trip-planner # a Marten of your own; --group <chat> adds it to a group
52
+ marten whoami
53
+ marten --help # every command and option
54
+ ```
55
+
56
+ Times like `--due "friday 7pm"` are read in this machine's time zone unless you pass `--tz Europe/Berlin`, and task
57
+ times print in it too. A group needs `chats:read` to read and `chats:write` to post in (a task there posts its card).
58
+
59
+ ## For scripts: `--json` and exit codes
60
+
61
+ Every command takes `--json` and prints one JSON document on stdout. Errors go to stderr, as
62
+ `{"error":{"code","message"}}` with `--json`. Exit codes: `0` ok, `1` Marten refused or failed (the message says why:
63
+ `invalid_key`, `missing_scope`, `not_found`, `timeout`…), `2` a mistake in the command. Nothing asks a question except
64
+ `login`.
65
+
66
+ `marten ask` that's still waiting when its timeout is up exits 1 with your message's id; the Marten's answer lands in
67
+ the chat, where `marten chat read` finds it.
68
+
69
+ ## For agents
70
+
71
+ ```sh
72
+ marten setup claude # writes a Claude Code skill (~/.claude/skills/marten/SKILL.md) teaching it these commands
73
+ marten setup codex # adds a section to ~/.codex/AGENTS.md (replaced in place when run again)
74
+ ```
75
+
76
+ Or as MCP tools, over stdio:
77
+
78
+ ```sh
79
+ claude mcp add marten -- marten mcp
80
+ codex mcp add marten -- marten mcp
81
+ ```
82
+
83
+ The tools are the commands above: `marten_list_martens`, `marten_ask`, `marten_list_chats`, `marten_read_chat`,
84
+ `marten_send_message`, `marten_list_tasks`, `marten_add_task`, `marten_update_task`, `marten_registry_list`,
85
+ `marten_registry_show`, `marten_registry_install`. Each answers with the command's JSON.
86
+
87
+ ## From code
88
+
89
+ The same API is `@martenhq/sdk`: `npm install @martenhq/sdk`.
90
+
91
+ ## License
92
+
93
+ MIT