muse-cli 0.2.0__tar.gz
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.
- muse_cli-0.2.0/.gitignore +16 -0
- muse_cli-0.2.0/LICENSE +21 -0
- muse_cli-0.2.0/PKG-INFO +195 -0
- muse_cli-0.2.0/README.md +158 -0
- muse_cli-0.2.0/docs/PROTOCOL.md +79 -0
- muse_cli-0.2.0/pyproject.toml +85 -0
- muse_cli-0.2.0/skills/muse-cli/SKILL.md +102 -0
- muse_cli-0.2.0/src/muse_cli/__init__.py +3 -0
- muse_cli-0.2.0/src/muse_cli/__main__.py +3 -0
- muse_cli-0.2.0/src/muse_cli/cli.py +538 -0
- muse_cli-0.2.0/src/muse_cli/desc0.bin +0 -0
- muse_cli-0.2.0/src/muse_cli/desc1.bin +0 -0
- muse_cli-0.2.0/src/muse_cli/gateway.py +336 -0
- muse_cli-0.2.0/src/muse_cli/routes.json +1410 -0
muse_cli-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nik Ships
|
|
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.
|
muse_cli-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: muse-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Command-line client for your personal muse.ai AI agent: chat, automate, and manage side chats, feed, goals, ideas, and sessions from the terminal. No browser needed.
|
|
5
|
+
Project-URL: Homepage, https://github.com/nikships/muse-cli
|
|
6
|
+
Project-URL: Documentation, https://github.com/nikships/muse-cli#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/nikships/muse-cli
|
|
8
|
+
Project-URL: Issues, https://github.com/nikships/muse-cli/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/nikships/muse-cli/releases
|
|
10
|
+
Project-URL: Protocol Notes, https://github.com/nikships/muse-cli/blob/main/docs/PROTOCOL.md
|
|
11
|
+
Author-email: Nik <mntechsurvey@gmail.com>
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: agent,agent-skill,ai,ai-agent,ai-assistant,automation,chat,chatbot,cli,command-line,llm,muse,muse-ai,muse-cli,muse.ai,noise-protocol,personal-ai,personal-assistant,terminal,websocket
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Classifier: Topic :: Communications :: Chat
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
30
|
+
Classifier: Topic :: Terminals
|
|
31
|
+
Classifier: Topic :: Utilities
|
|
32
|
+
Requires-Python: >=3.10
|
|
33
|
+
Requires-Dist: curl-cffi>=0.11
|
|
34
|
+
Requires-Dist: noiseprotocol>=0.3
|
|
35
|
+
Requires-Dist: protobuf>=5.0
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
|
|
40
|
+
# muse-cli
|
|
41
|
+
|
|
42
|
+
Talk to your personal muse.ai AI agent from the terminal.
|
|
43
|
+
|
|
44
|
+
[](https://pypi.org/project/muse-cli/)
|
|
45
|
+
[](https://pypi.org/project/muse-cli/)
|
|
46
|
+
[](https://pepy.tech/project/muse-cli)
|
|
47
|
+
[](https://github.com/nikships/muse-cli/blob/main/LICENSE)
|
|
48
|
+
[](https://github.com/nikships/muse-cli/stargazers)
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
## What is this?
|
|
55
|
+
|
|
56
|
+
A command-line client for your personal muse.ai AI agent: chat from the terminal, automate it with scripts, and manage side chats, feed, goals, ideas, and sessions without opening a browser. It speaks the app's own gateway protocol directly: HTTPS auth, then an encrypted Noise-XX WebSocket to your personal VM.
|
|
57
|
+
|
|
58
|
+
- **Chat from the shell:** send a message and get the agent's reply back as JSON.
|
|
59
|
+
- **Script it:** every command prints JSON, so it pipes into `jq`, cron jobs, and other AI agents.
|
|
60
|
+
- **Full coverage:** named commands for the common tasks, plus a `raw` escape hatch for all 258 gateway methods.
|
|
61
|
+
- **Agent-ready:** ships an agent skill so coding agents can drive your muse.ai agent for you.
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
uv tool install muse-cli # or: pipx install muse-cli / pip install muse-cli
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then log in and check the connection:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# 1. Log in to https://muse.ai/ in Chrome
|
|
73
|
+
# 2. Export your session (one time; re-run when it expires):
|
|
74
|
+
muse-cli auth export
|
|
75
|
+
|
|
76
|
+
muse-cli status
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Want the agent skill too? The installer sets up the CLI and copies the skill
|
|
80
|
+
to `~/.agents/skills/muse-cli`:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
curl -fsSL https://raw.githubusercontent.com/nikships/muse-cli/main/install.sh | bash
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Upgrade with `uv tool upgrade muse-cli`, remove with `uv tool uninstall muse-cli`.
|
|
87
|
+
|
|
88
|
+
The command is `muse-cli`, not `muse`, because `muse` clashes with Muse Code
|
|
89
|
+
on many machines.
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
muse-cli threads # main chat + side chats
|
|
95
|
+
muse-cli history --limit 5 # recent messages
|
|
96
|
+
muse-cli history --thread <session-id> --limit 5 # one side chat
|
|
97
|
+
muse-cli send "summarize my unread" --wait 120 # send + wait for the reply
|
|
98
|
+
muse-cli watch --timeout 60 # tail live agent events
|
|
99
|
+
|
|
100
|
+
muse-cli feed --limit 5
|
|
101
|
+
muse-cli feed-react <unit-id> love
|
|
102
|
+
muse-cli goals
|
|
103
|
+
muse-cli ideas
|
|
104
|
+
muse-cli idea-exec <idea-id> # agent acts on the idea
|
|
105
|
+
|
|
106
|
+
muse-cli session-start --title "trip planning" # new side chat
|
|
107
|
+
muse-cli session-rename <id> "new title"
|
|
108
|
+
muse-cli session-archive <id> # also: pin, unpin, unarchive, delete
|
|
109
|
+
muse-cli seen <thread-id>
|
|
110
|
+
muse-cli wake
|
|
111
|
+
muse-cli raw <method> --body '{}' # escape hatch: any of 258 gateway methods
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Every command prints JSON. Your VM is auto-discovered from your session, and a
|
|
115
|
+
random device id is generated on first run.
|
|
116
|
+
|
|
117
|
+
Pipe it into other tools:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
muse-cli send "what's on my calendar today?" | jq -r .reply.text
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## How it works
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+

|
|
128
|
+
|
|
129
|
+
See [docs/PROTOCOL.md](https://github.com/nikships/muse-cli/blob/main/docs/PROTOCOL.md)
|
|
130
|
+
for the full protocol notes, including the method table and the server quirks
|
|
131
|
+
found during reverse engineering.
|
|
132
|
+
|
|
133
|
+
## Documentation
|
|
134
|
+
|
|
135
|
+
| Resource | Description |
|
|
136
|
+
|----------|-------------|
|
|
137
|
+
| [skills/muse-cli/SKILL.md](https://github.com/nikships/muse-cli/blob/main/skills/muse-cli/SKILL.md) | Agent skill: install check, auth setup, command reference |
|
|
138
|
+
| [docs/PROTOCOL.md](https://github.com/nikships/muse-cli/blob/main/docs/PROTOCOL.md) | Gateway protocol reference: auth chain, Noise transport, framing, method quirks |
|
|
139
|
+
| [routes.json](https://github.com/nikships/muse-cli/blob/main/src/muse_cli/routes.json) | All 258 gateway methods with paths and services |
|
|
140
|
+
| `muse-cli raw --help` | Escape hatch for calling any gateway method directly |
|
|
141
|
+
|
|
142
|
+
## Development
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
git clone https://github.com/nikships/muse-cli.git
|
|
146
|
+
cd muse-cli
|
|
147
|
+
uv run muse-cli --help
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
muse-cli/
|
|
152
|
+
assets/ README artwork (generated with Muse Image)
|
|
153
|
+
docs/PROTOCOL.md protocol reference for re-derivation
|
|
154
|
+
skills/muse-cli/ agent skill
|
|
155
|
+
src/muse_cli/
|
|
156
|
+
cli.py argument parsing and all commands
|
|
157
|
+
gateway.py gateway client (auth, Noise transport, subscriptions)
|
|
158
|
+
routes.json 258 gateway methods extracted from the web client
|
|
159
|
+
desc0.bin protobuf descriptors for the wire framing
|
|
160
|
+
desc1.bin
|
|
161
|
+
install.sh CLI + skill installer
|
|
162
|
+
pyproject.toml
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Setup notes
|
|
166
|
+
|
|
167
|
+
- `auth export` reads cookies from a running Chrome via
|
|
168
|
+
[agent-browser](https://github.com/nikships/foundry) (`npm i -g agent-browser`).
|
|
169
|
+
No Chrome? Copy your `muse.ai` cookies into `~/.config/muse-cli/cookies.txt`
|
|
170
|
+
by hand (Netscape jar or `name=value; ...` format, needs `hatch_sess`).
|
|
171
|
+
- Cookies live at `~/.config/muse-cli/cookies.txt` (mode 600). Access and
|
|
172
|
+
gateway tokens are fetched fresh on every run, nothing long-lived is stored.
|
|
173
|
+
- Respect muse.ai's terms and rate limits. Internal APIs are unversioned and
|
|
174
|
+
can change; if calls fail, re-derive from a fresh app bundle.
|
|
175
|
+
|
|
176
|
+
## Contributing
|
|
177
|
+
|
|
178
|
+
Issues and PRs welcome. If the protocol drifts, the most useful contribution
|
|
179
|
+
is a note of which method broke and the new server error text.
|
|
180
|
+
|
|
181
|
+
<a href="https://github.com/nikships/muse-cli/graphs/contributors">
|
|
182
|
+
<img src="https://contrib.rocks/image?repo=nikships/muse-cli" />
|
|
183
|
+
</a>
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
|
|
187
|
+
MIT. See [LICENSE](https://github.com/nikships/muse-cli/blob/main/LICENSE).
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
<div align="center">
|
|
192
|
+
|
|
193
|
+
[](https://star-history.com/#nikships/muse-cli&Date)
|
|
194
|
+
|
|
195
|
+
</div>
|
muse_cli-0.2.0/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# muse-cli
|
|
4
|
+
|
|
5
|
+
Talk to your personal muse.ai AI agent from the terminal.
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/muse-cli/)
|
|
8
|
+
[](https://pypi.org/project/muse-cli/)
|
|
9
|
+
[](https://pepy.tech/project/muse-cli)
|
|
10
|
+
[](https://github.com/nikships/muse-cli/blob/main/LICENSE)
|
|
11
|
+
[](https://github.com/nikships/muse-cli/stargazers)
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
## What is this?
|
|
18
|
+
|
|
19
|
+
A command-line client for your personal muse.ai AI agent: chat from the terminal, automate it with scripts, and manage side chats, feed, goals, ideas, and sessions without opening a browser. It speaks the app's own gateway protocol directly: HTTPS auth, then an encrypted Noise-XX WebSocket to your personal VM.
|
|
20
|
+
|
|
21
|
+
- **Chat from the shell:** send a message and get the agent's reply back as JSON.
|
|
22
|
+
- **Script it:** every command prints JSON, so it pipes into `jq`, cron jobs, and other AI agents.
|
|
23
|
+
- **Full coverage:** named commands for the common tasks, plus a `raw` escape hatch for all 258 gateway methods.
|
|
24
|
+
- **Agent-ready:** ships an agent skill so coding agents can drive your muse.ai agent for you.
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv tool install muse-cli # or: pipx install muse-cli / pip install muse-cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then log in and check the connection:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# 1. Log in to https://muse.ai/ in Chrome
|
|
36
|
+
# 2. Export your session (one time; re-run when it expires):
|
|
37
|
+
muse-cli auth export
|
|
38
|
+
|
|
39
|
+
muse-cli status
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Want the agent skill too? The installer sets up the CLI and copies the skill
|
|
43
|
+
to `~/.agents/skills/muse-cli`:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
curl -fsSL https://raw.githubusercontent.com/nikships/muse-cli/main/install.sh | bash
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Upgrade with `uv tool upgrade muse-cli`, remove with `uv tool uninstall muse-cli`.
|
|
50
|
+
|
|
51
|
+
The command is `muse-cli`, not `muse`, because `muse` clashes with Muse Code
|
|
52
|
+
on many machines.
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
muse-cli threads # main chat + side chats
|
|
58
|
+
muse-cli history --limit 5 # recent messages
|
|
59
|
+
muse-cli history --thread <session-id> --limit 5 # one side chat
|
|
60
|
+
muse-cli send "summarize my unread" --wait 120 # send + wait for the reply
|
|
61
|
+
muse-cli watch --timeout 60 # tail live agent events
|
|
62
|
+
|
|
63
|
+
muse-cli feed --limit 5
|
|
64
|
+
muse-cli feed-react <unit-id> love
|
|
65
|
+
muse-cli goals
|
|
66
|
+
muse-cli ideas
|
|
67
|
+
muse-cli idea-exec <idea-id> # agent acts on the idea
|
|
68
|
+
|
|
69
|
+
muse-cli session-start --title "trip planning" # new side chat
|
|
70
|
+
muse-cli session-rename <id> "new title"
|
|
71
|
+
muse-cli session-archive <id> # also: pin, unpin, unarchive, delete
|
|
72
|
+
muse-cli seen <thread-id>
|
|
73
|
+
muse-cli wake
|
|
74
|
+
muse-cli raw <method> --body '{}' # escape hatch: any of 258 gateway methods
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Every command prints JSON. Your VM is auto-discovered from your session, and a
|
|
78
|
+
random device id is generated on first run.
|
|
79
|
+
|
|
80
|
+
Pipe it into other tools:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
muse-cli send "what's on my calendar today?" | jq -r .reply.text
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## How it works
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
See [docs/PROTOCOL.md](https://github.com/nikships/muse-cli/blob/main/docs/PROTOCOL.md)
|
|
93
|
+
for the full protocol notes, including the method table and the server quirks
|
|
94
|
+
found during reverse engineering.
|
|
95
|
+
|
|
96
|
+
## Documentation
|
|
97
|
+
|
|
98
|
+
| Resource | Description |
|
|
99
|
+
|----------|-------------|
|
|
100
|
+
| [skills/muse-cli/SKILL.md](https://github.com/nikships/muse-cli/blob/main/skills/muse-cli/SKILL.md) | Agent skill: install check, auth setup, command reference |
|
|
101
|
+
| [docs/PROTOCOL.md](https://github.com/nikships/muse-cli/blob/main/docs/PROTOCOL.md) | Gateway protocol reference: auth chain, Noise transport, framing, method quirks |
|
|
102
|
+
| [routes.json](https://github.com/nikships/muse-cli/blob/main/src/muse_cli/routes.json) | All 258 gateway methods with paths and services |
|
|
103
|
+
| `muse-cli raw --help` | Escape hatch for calling any gateway method directly |
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
git clone https://github.com/nikships/muse-cli.git
|
|
109
|
+
cd muse-cli
|
|
110
|
+
uv run muse-cli --help
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
muse-cli/
|
|
115
|
+
assets/ README artwork (generated with Muse Image)
|
|
116
|
+
docs/PROTOCOL.md protocol reference for re-derivation
|
|
117
|
+
skills/muse-cli/ agent skill
|
|
118
|
+
src/muse_cli/
|
|
119
|
+
cli.py argument parsing and all commands
|
|
120
|
+
gateway.py gateway client (auth, Noise transport, subscriptions)
|
|
121
|
+
routes.json 258 gateway methods extracted from the web client
|
|
122
|
+
desc0.bin protobuf descriptors for the wire framing
|
|
123
|
+
desc1.bin
|
|
124
|
+
install.sh CLI + skill installer
|
|
125
|
+
pyproject.toml
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Setup notes
|
|
129
|
+
|
|
130
|
+
- `auth export` reads cookies from a running Chrome via
|
|
131
|
+
[agent-browser](https://github.com/nikships/foundry) (`npm i -g agent-browser`).
|
|
132
|
+
No Chrome? Copy your `muse.ai` cookies into `~/.config/muse-cli/cookies.txt`
|
|
133
|
+
by hand (Netscape jar or `name=value; ...` format, needs `hatch_sess`).
|
|
134
|
+
- Cookies live at `~/.config/muse-cli/cookies.txt` (mode 600). Access and
|
|
135
|
+
gateway tokens are fetched fresh on every run, nothing long-lived is stored.
|
|
136
|
+
- Respect muse.ai's terms and rate limits. Internal APIs are unversioned and
|
|
137
|
+
can change; if calls fail, re-derive from a fresh app bundle.
|
|
138
|
+
|
|
139
|
+
## Contributing
|
|
140
|
+
|
|
141
|
+
Issues and PRs welcome. If the protocol drifts, the most useful contribution
|
|
142
|
+
is a note of which method broke and the new server error text.
|
|
143
|
+
|
|
144
|
+
<a href="https://github.com/nikships/muse-cli/graphs/contributors">
|
|
145
|
+
<img src="https://contrib.rocks/image?repo=nikships/muse-cli" />
|
|
146
|
+
</a>
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT. See [LICENSE](https://github.com/nikships/muse-cli/blob/main/LICENSE).
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
<div align="center">
|
|
155
|
+
|
|
156
|
+
[](https://star-history.com/#nikships/muse-cli&Date)
|
|
157
|
+
|
|
158
|
+
</div>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Protocol notes
|
|
2
|
+
|
|
3
|
+
How `muse` talks to the muse.ai personal gateway. Derived from the web app's
|
|
4
|
+
own client bundle and verified live. Internal APIs are unversioned and can
|
|
5
|
+
change without notice; if calls start failing, re-derive from a fresh bundle
|
|
6
|
+
(HAR capture + the `derive-client` workflow).
|
|
7
|
+
|
|
8
|
+
## Layers
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
muse CLI
|
|
12
|
+
│ HTTPS (browser TLS fingerprint via curl-impersonated requests)
|
|
13
|
+
▼
|
|
14
|
+
muse.ai cookies → POST /api/auth/check → access_token
|
|
15
|
+
POST /api/hatch/token {vmAddress, vmName} → hatch token
|
|
16
|
+
GET /api/session → assigned VM id (auto-discovered)
|
|
17
|
+
│ wss://hatch.metaaivm.com/v1/noise?vm_id=..&auth_token=..
|
|
18
|
+
│ Noise_XX_25519_AESGCM_SHA256, empty payloads both ways
|
|
19
|
+
▼
|
|
20
|
+
personal VM gateway
|
|
21
|
+
│ protobuf envelopes (descriptors in desc0.bin / desc1.bin)
|
|
22
|
+
│ request/response + newline-JSON event subscriptions
|
|
23
|
+
▼
|
|
24
|
+
chat / feed / goals / ideas / sessions / ...
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Details
|
|
28
|
+
|
|
29
|
+
- **Gateway host:** the shared `hatch.metaaivm.com`, not the per-VM hostname.
|
|
30
|
+
Plain TLS to the per-VM host is reset at the edge; a Chrome fingerprint
|
|
31
|
+
(curl_cffi `impersonate="chrome"`) is required.
|
|
32
|
+
- **Handshake:** standard Noise XX. This account negotiates standard mode
|
|
33
|
+
(empty msg3). An attested/RV mode with SNP attestation and HMAC proofs
|
|
34
|
+
exists in the client for other configurations.
|
|
35
|
+
- **Framing:** `NoiseTransportFrame{chunk_id(i64), chunk_index, total_chunks,
|
|
36
|
+
payload}` protobuf → Noise transport encrypt → one WS binary frame each.
|
|
37
|
+
- **Request:** `ServiceRequest{service, payload =
|
|
38
|
+
ServiceFrame{stream_id, request =
|
|
39
|
+
ApplicationRequest{verb, path, headers, body, end_body}}}`. Stream ids start
|
|
40
|
+
at 1. Services: daemon 0, sentinel 1, vault 2, authd 3.
|
|
41
|
+
- **Response:** `ServiceResponse{payload = ServiceFrame{... response =
|
|
42
|
+
ApplicationResponse{status, headers, body, end_body}}}` plus `body_chunk`
|
|
43
|
+
frames until `end_body`.
|
|
44
|
+
- **Subscriptions** (`chat.subscribe`, `chat.stream`, ...): same envelope, the
|
|
45
|
+
server streams `application/x-ndjson` records in body chunks.
|
|
46
|
+
- **Method table:** `routes.json` (258 methods extracted from the web bundle).
|
|
47
|
+
|
|
48
|
+
## Server quirks learned from live errors
|
|
49
|
+
|
|
50
|
+
- `chat.history`: GET query params only; `transcript_mode` is rejected, omit
|
|
51
|
+
it; `session_id` scopes to a side chat; `limit` works. History events use
|
|
52
|
+
`event_name` (`message.user` / `message.assistant`), carry the text in both
|
|
53
|
+
top-level and `payload.display_text`, and are the source of truth.
|
|
54
|
+
- Genuine assistant replies have an **empty `reply_to_message_id`**; proactive
|
|
55
|
+
pushes (Telegram drafts, background task updates) are self-referential
|
|
56
|
+
there. That is how `send` tells a reply apart from background chatter.
|
|
57
|
+
- Live `chat.subscribe` events use **different shapes** (`delta.text_append`
|
|
58
|
+
with `message_seq` + text chunks, `delta.message_done` with the full
|
|
59
|
+
transcript) and only cover main-chat traffic: threaded replies never arrive
|
|
60
|
+
as live events, just a `sessions.updated` snippet. `send` therefore polls
|
|
61
|
+
history instead of watching the stream. The `chat.stream` response stream
|
|
62
|
+
itself carries only the send echo, then ends.
|
|
63
|
+
- `/api/session` can return 200 `{"status":"unavailable",
|
|
64
|
+
"vm_resolution_issue":{"kind":"retryable"}}` while the VM restarts. The
|
|
65
|
+
client raises a clean error (not KeyError); retry, or wake a known VM id
|
|
66
|
+
via `MUSE_VM_ID=<id> muse-cli wake`.
|
|
67
|
+
- Concurrent `_read_frame` calls from two threads split frames and corrupt
|
|
68
|
+
the stateful Noise decrypt (fatal BAD_DECRYPT). `Gateway` serializes
|
|
69
|
+
receives with a lock as a backstop, but callers must still keep exactly
|
|
70
|
+
one frame consumer at a time (`send` makes sequential unary calls only).
|
|
71
|
+
- `session.start`: `{method: "/api/session/start", params: {origin: "fresh",
|
|
72
|
+
lifecycle: "persistent", title?}}`.
|
|
73
|
+
- `session.rename`: flat `{session_id, title}`. pin/unpin/archive/unarchive/
|
|
74
|
+
delete: `{method: "/api/session/<op>", session_id}`.
|
|
75
|
+
- `api.idea-cards.execute`: `{ideaCardId, mode: "full"}` plus path param.
|
|
76
|
+
- POSTs to muse.ai need browser `Sec-Fetch-*` headers or they return 403.
|
|
77
|
+
- `auth export` must focus a muse.ai tab before reading cookies (the export
|
|
78
|
+
follows the active tab) and must never overwrite a working jar without a
|
|
79
|
+
`hatch_sess` in the new one.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "muse-cli"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Command-line client for your personal muse.ai AI agent: chat, automate, and manage side chats, feed, goals, ideas, and sessions from the terminal. No browser needed."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Nik", email = "mntechsurvey@gmail.com" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"muse",
|
|
16
|
+
"muse.ai",
|
|
17
|
+
"muse-ai",
|
|
18
|
+
"muse-cli",
|
|
19
|
+
"ai",
|
|
20
|
+
"ai-agent",
|
|
21
|
+
"ai-assistant",
|
|
22
|
+
"personal-ai",
|
|
23
|
+
"personal-assistant",
|
|
24
|
+
"agent",
|
|
25
|
+
"chatbot",
|
|
26
|
+
"chat",
|
|
27
|
+
"llm",
|
|
28
|
+
"cli",
|
|
29
|
+
"terminal",
|
|
30
|
+
"command-line",
|
|
31
|
+
"automation",
|
|
32
|
+
"agent-skill",
|
|
33
|
+
"noise-protocol",
|
|
34
|
+
"websocket",
|
|
35
|
+
]
|
|
36
|
+
classifiers = [
|
|
37
|
+
"Development Status :: 4 - Beta",
|
|
38
|
+
"Environment :: Console",
|
|
39
|
+
"Intended Audience :: Developers",
|
|
40
|
+
"Intended Audience :: End Users/Desktop",
|
|
41
|
+
"Operating System :: OS Independent",
|
|
42
|
+
"Programming Language :: Python",
|
|
43
|
+
"Programming Language :: Python :: 3",
|
|
44
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
45
|
+
"Programming Language :: Python :: 3.10",
|
|
46
|
+
"Programming Language :: Python :: 3.11",
|
|
47
|
+
"Programming Language :: Python :: 3.12",
|
|
48
|
+
"Programming Language :: Python :: 3.13",
|
|
49
|
+
"Programming Language :: Python :: 3.14",
|
|
50
|
+
"Topic :: Communications :: Chat",
|
|
51
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
52
|
+
"Topic :: Terminals",
|
|
53
|
+
"Topic :: Utilities",
|
|
54
|
+
]
|
|
55
|
+
dependencies = [
|
|
56
|
+
"curl_cffi>=0.11",
|
|
57
|
+
"noiseprotocol>=0.3",
|
|
58
|
+
"protobuf>=5.0",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[project.urls]
|
|
62
|
+
Homepage = "https://github.com/nikships/muse-cli"
|
|
63
|
+
Documentation = "https://github.com/nikships/muse-cli#readme"
|
|
64
|
+
Repository = "https://github.com/nikships/muse-cli"
|
|
65
|
+
Issues = "https://github.com/nikships/muse-cli/issues"
|
|
66
|
+
Changelog = "https://github.com/nikships/muse-cli/releases"
|
|
67
|
+
"Protocol Notes" = "https://github.com/nikships/muse-cli/blob/main/docs/PROTOCOL.md"
|
|
68
|
+
|
|
69
|
+
[project.scripts]
|
|
70
|
+
muse-cli = "muse_cli.cli:main"
|
|
71
|
+
|
|
72
|
+
[tool.hatch.version]
|
|
73
|
+
path = "src/muse_cli/__init__.py"
|
|
74
|
+
|
|
75
|
+
[tool.hatch.build.targets.wheel]
|
|
76
|
+
packages = ["src/muse_cli"]
|
|
77
|
+
|
|
78
|
+
[tool.hatch.build.targets.sdist]
|
|
79
|
+
include = [
|
|
80
|
+
"src/muse_cli",
|
|
81
|
+
"docs",
|
|
82
|
+
"skills",
|
|
83
|
+
"README.md",
|
|
84
|
+
"LICENSE",
|
|
85
|
+
]
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: muse-cli
|
|
3
|
+
description: Manage a personal muse.ai agent from the terminal (send messages, read chats, watch live events, feed/goals/ideas/sessions). Use when asked to message, check, or automate someone's Muse personal AI, work with muse.ai chats/threads/feed/goals outside the browser, or when the muse-cli tool itself needs installing or auth setup.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# muse-cli: drive a muse.ai personal agent from the terminal
|
|
7
|
+
|
|
8
|
+
Assume a bare machine: only this skill is present. No repo clone, no
|
|
9
|
+
dependencies, no auth. Work top to bottom; stop at the first step that
|
|
10
|
+
fails and report it.
|
|
11
|
+
|
|
12
|
+
The `muse-cli` package (on PyPI) talks to the muse.ai personal gateway
|
|
13
|
+
directly. No browser needed after the one-time cookie export. Every command
|
|
14
|
+
prints JSON.
|
|
15
|
+
|
|
16
|
+
## 1. Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
curl -fsSL https://raw.githubusercontent.com/nikships/muse-cli/main/install.sh | bash
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This installs the CLI from PyPI with `uv tool install muse-cli` (its own
|
|
23
|
+
isolated environment) and this skill (to `~/.agents/skills/muse-cli`). CLI
|
|
24
|
+
only? `uv tool install muse-cli`, `pipx install muse-cli`, or
|
|
25
|
+
`pip install muse-cli` all work. The command is `muse-cli` (`muse` clashes
|
|
26
|
+
with Muse Code, don't use it). Verify before continuing:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
command -v muse-cli
|
|
30
|
+
muse-cli --help >/dev/null && echo cli-ok # proves the install + deps resolve
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 2. Auth
|
|
34
|
+
|
|
35
|
+
The user must be logged in to https://muse.ai/ in Chrome first. Then:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
muse-cli auth export # saves muse.ai cookies to ~/.config/muse-cli/cookies.txt (0600)
|
|
39
|
+
test -s ~/.config/muse-cli/cookies.txt && echo auth-ok
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`auth export` pulls cookies from a running Chrome via
|
|
43
|
+
[agent-browser](https://github.com/nikships/foundry) (`npm i -g agent-browser`
|
|
44
|
+
if it is missing). No Chrome? Copy the `muse.ai` cookies by hand (DevTools →
|
|
45
|
+
Application → Cookies; needs `hatch_sess`) into
|
|
46
|
+
`~/.config/muse-cli/cookies.txt` as Netscape-jar or `name=value; ...` text.
|
|
47
|
+
|
|
48
|
+
Access and gateway tokens are fetched fresh on every run; only cookies
|
|
49
|
+
persist. When commands later fail with `auth error`, cookies expired:
|
|
50
|
+
re-run `auth export`.
|
|
51
|
+
|
|
52
|
+
## 3. Verify end to end
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
muse-cli status # VM id, chat count, unread, identity: install + auth proven
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Everyday commands
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
muse-cli threads # main chat + side chats (session_ids)
|
|
62
|
+
muse-cli history --limit 5 # recent main-chat messages
|
|
63
|
+
muse-cli history --thread <session-id> --limit 5 # one side chat
|
|
64
|
+
muse-cli send "message" --wait 120 # send + wait for the reply
|
|
65
|
+
muse-cli send "message" --thread <session-id> --wait 0 # fire and forget to a side chat
|
|
66
|
+
muse-cli watch --timeout 60 # tail live agent events
|
|
67
|
+
muse-cli feed --limit 5
|
|
68
|
+
muse-cli goals
|
|
69
|
+
muse-cli ideas
|
|
70
|
+
muse-cli unread
|
|
71
|
+
muse-cli seen <thread-id>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Management (visible side effects, confirm with the user first when destructive):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
muse-cli feed-react <unit-id> love
|
|
78
|
+
muse-cli idea-exec <idea-id> # the agent acts on the idea (real work)
|
|
79
|
+
muse-cli session-start --title "x" # new side chat
|
|
80
|
+
muse-cli session-rename <id> "title" # also: pin, unpin, archive, unarchive, delete
|
|
81
|
+
muse-cli wake
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Escape hatch
|
|
85
|
+
|
|
86
|
+
`muse-cli raw <method> --body '{...}' [--param k=v]` calls any of the 258
|
|
87
|
+
gateway methods in `routes.json`. Prefer the named commands above; use raw
|
|
88
|
+
only for methods with no wrapper.
|
|
89
|
+
|
|
90
|
+
## Gotchas
|
|
91
|
+
|
|
92
|
+
- `send` returns `{"sent": true, "reply": {...}}`, polling history until the
|
|
93
|
+
reply lands (up to `--wait`). If `reply` is missing, the agent was slower
|
|
94
|
+
than the wait: the message still landed, confirm with `history`. The reply
|
|
95
|
+
is matched as a genuine answer, not background chatter.
|
|
96
|
+
- `send --wait 0` is fire-and-forget (no polling).
|
|
97
|
+
- `history` without `--thread` reads the main chat only.
|
|
98
|
+
- The gateway API is unversioned. Whole classes of calls failing at once means
|
|
99
|
+
the protocol drifted: see `docs/PROTOCOL.md` for the re-derivation notes,
|
|
100
|
+
don't guess at crypto or framing.
|
|
101
|
+
- Respect rate limits. Writes (send, react, execute, session ops) act as the
|
|
102
|
+
user in their agent: announce them before running, never loop them.
|