@martenhq/cli 0.0.0-stage → 0.1.1
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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +109 -2
- package/dist/marten.js +2230 -0
- package/package.json +21 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- `marten login --scope` adds to the default scopes (`martens`, `tasks`, `registry`) instead of replacing them, and
|
|
6
|
+
signing in again as the same person keeps what this machine's key could already do; `--reset-scopes` narrows it
|
|
7
|
+
back to the defaults. Another person signing in on the machine starts from the defaults.
|
|
8
|
+
- Signing in doesn't wait on the previous key's server: asking it the old key's scopes and revoking it give up after
|
|
9
|
+
5 seconds.
|
|
10
|
+
- Signing in again writes the new key first, then revokes the old one; a revoke that fails is a warning, not a
|
|
11
|
+
failed login. When the key can't be made (`too_many_keys`), the sign-in's session is ended anyway.
|
|
12
|
+
- A key `marten login` stored is only sent to the server it was made on: `MARTEN_API_URL` applies with
|
|
13
|
+
`MARTEN_API_KEY`, or when signing in.
|
|
14
|
+
- The credentials file is written to a new file and renamed into place (never through a link at its path), 0600, in
|
|
15
|
+
a folder that is set to 0700 even if it was there before. On Windows it's written as is.
|
|
16
|
+
- `marten mcp` answers `null`, non-object lines and batches with Invalid Request (-32600), and a line that fails can
|
|
17
|
+
no longer stop the server.
|
|
18
|
+
- Task statuses are `todo`, `in_progress` and `done` (`needs_review` is gone).
|
|
19
|
+
|
|
20
|
+
## 0.1.0
|
|
21
|
+
|
|
22
|
+
- First release: `login`/`logout`/`whoami`, `martens`, `ask`, `chats`, `chat read`/`send`, `task list`/`add`/
|
|
23
|
+
`update`, `registry list`/`show`/`install`, `mcp`, `setup claude|codex`, `--json` everywhere.
|
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,110 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @martenhq/cli
|
|
2
2
|
|
|
3
|
-
|
|
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; on Windows, by your user profile's permissions). `marten
|
|
26
|
+
logout` revokes it; signing in again replaces it and revokes the old one.
|
|
27
|
+
|
|
28
|
+
A key has scopes:
|
|
29
|
+
|
|
30
|
+
| Scope | Lets it |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `martens` (default) | list your Martens, read and post in their 1:1s with you, `ask` them |
|
|
33
|
+
| `tasks` (default) | tasks in your Martens' 1:1s (with `chats:read`, groups' tasks too) |
|
|
34
|
+
| `registry` (default) | browse the registry and install Martens for you |
|
|
35
|
+
| `chats:read` | read your groups and their tasks |
|
|
36
|
+
| `chats:write` | post as you in your groups, add or change tasks there, add Martens to them |
|
|
37
|
+
|
|
38
|
+
`--scope` adds to the defaults, and signing in again as the same person keeps what this machine's key could already
|
|
39
|
+
do. `--reset-scopes` starts from the defaults (plus any `--scope`), to narrow a key:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
marten login --scope chats:read --scope chats:write
|
|
43
|
+
marten login --reset-scopes
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Scopes limit what the key does, not what your Martens do: a key with `martens` talks to your own Martens, and they act
|
|
47
|
+
for you as they do when you ask them in the apps (they can read and post in groups you share with them, and use the
|
|
48
|
+
apps you've connected for them).
|
|
49
|
+
|
|
50
|
+
In CI or for another agent, set `MARTEN_API_KEY` instead, with `MARTEN_API_URL` for a server other than
|
|
51
|
+
https://api.marten.sh. A key `marten login` stored is only ever sent to the server it was made on (`MARTEN_API_URL`
|
|
52
|
+
applies to it only when signing in).
|
|
53
|
+
|
|
54
|
+
## Commands
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
marten martens # your Martens, each with its 1:1's chat id
|
|
58
|
+
marten ask Poker "Who's up this month?" # ask one and wait for its reply (--timeout, up to 120 s)
|
|
59
|
+
echo "Plan Friday's game" | marten ask Poker - # - reads the text from stdin
|
|
60
|
+
marten chats # your 1:1s, and groups with a chats:read key
|
|
61
|
+
marten chat read "Goa trip" --limit 20 # a chat by its title or id
|
|
62
|
+
marten chat send Juniper "Remind me about rent" # posts as you, marked "via <key name>"
|
|
63
|
+
marten task list --status open
|
|
64
|
+
marten task add "Book the table" --due "friday 7pm" --assignee me
|
|
65
|
+
marten task update <id> --status done
|
|
66
|
+
marten registry list
|
|
67
|
+
marten registry show trip-planner
|
|
68
|
+
marten registry install trip-planner # a Marten of your own; --group <chat> adds it to a group
|
|
69
|
+
marten whoami
|
|
70
|
+
marten --help # every command and option
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Times like `--due "friday 7pm"` are read in this machine's time zone unless you pass `--tz Europe/Berlin`, and task
|
|
74
|
+
times print in it too. A group needs `chats:read` to read and `chats:write` to post in (a task there posts its card).
|
|
75
|
+
|
|
76
|
+
## For scripts: `--json` and exit codes
|
|
77
|
+
|
|
78
|
+
Every command takes `--json` and prints one JSON document on stdout. Errors go to stderr, as
|
|
79
|
+
`{"error":{"code","message"}}` with `--json`. Exit codes: `0` ok, `1` Marten refused or failed (the message says why:
|
|
80
|
+
`invalid_key`, `missing_scope`, `not_found`, `timeout`…), `2` a mistake in the command. Nothing asks a question except
|
|
81
|
+
`login`.
|
|
82
|
+
|
|
83
|
+
`marten ask` that's still waiting when its timeout is up exits 1 with your message's id; the Marten's answer lands in
|
|
84
|
+
the chat, where `marten chat read` finds it.
|
|
85
|
+
|
|
86
|
+
## For agents
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
marten setup claude # writes a Claude Code skill (~/.claude/skills/marten/SKILL.md) teaching it these commands
|
|
90
|
+
marten setup codex # adds a section to ~/.codex/AGENTS.md (replaced in place when run again)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Or as MCP tools, over stdio:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
claude mcp add marten -- marten mcp
|
|
97
|
+
codex mcp add marten -- marten mcp
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The tools are the commands above: `marten_list_martens`, `marten_ask`, `marten_list_chats`, `marten_read_chat`,
|
|
101
|
+
`marten_send_message`, `marten_list_tasks`, `marten_add_task`, `marten_update_task`, `marten_registry_list`,
|
|
102
|
+
`marten_registry_show`, `marten_registry_install`. Each answers with the command's JSON.
|
|
103
|
+
|
|
104
|
+
## From code
|
|
105
|
+
|
|
106
|
+
The same API is `@martenhq/sdk`: `npm install @martenhq/sdk`.
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT
|