@mtreeai/msapling-cli 2.3.6-beta.4 → 2.3.6-beta.40
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/LICENSE +44 -0
- package/README.md +168 -168
- package/dist/index.js +10323 -4475
- package/package.json +66 -55
- package/dist/keytar-F4YAPN53.node +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MSapling CLI — Proprietary License
|
|
2
|
+
Copyright (c) 2026 MSapling / MTreeAI. All rights reserved.
|
|
3
|
+
|
|
4
|
+
This software, the source code in this repository, and the published
|
|
5
|
+
`@mtreeai/msapling-cli` npm package (collectively, "the Software") are the
|
|
6
|
+
proprietary property of MSapling / MTreeAI.
|
|
7
|
+
|
|
8
|
+
PERMITTED USE
|
|
9
|
+
-------------
|
|
10
|
+
You may:
|
|
11
|
+
1. Install and run the published binary distribution of the Software
|
|
12
|
+
("msapling" / "ms" CLI) for personal or internal-business use against
|
|
13
|
+
the official MSapling backend at https://api.msapling.com.
|
|
14
|
+
2. Configure the Software with your own API keys (BYOK) and local model
|
|
15
|
+
providers (Ollama, etc.) as supported by the Software's documented
|
|
16
|
+
features.
|
|
17
|
+
|
|
18
|
+
PROHIBITED USE
|
|
19
|
+
--------------
|
|
20
|
+
Without prior written permission from MSapling / MTreeAI you may not:
|
|
21
|
+
1. Copy, fork, mirror, redistribute, sublicense, or republish the Software
|
|
22
|
+
or any substantial portion of its source code or compiled artifacts.
|
|
23
|
+
2. Reverse-engineer, decompile, or disassemble the Software except to the
|
|
24
|
+
extent permitted by applicable law that cannot be contractually waived.
|
|
25
|
+
3. Use the Software to operate a competing service or to circumvent any
|
|
26
|
+
authentication, billing, rate-limiting, or tier-gating mechanism of the
|
|
27
|
+
MSapling backend.
|
|
28
|
+
4. Remove or alter any copyright notice, trademark, or proprietary legend
|
|
29
|
+
embedded in the Software.
|
|
30
|
+
|
|
31
|
+
NO WARRANTY
|
|
32
|
+
-----------
|
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
|
36
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
37
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING
|
|
38
|
+
FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
39
|
+
DEALINGS IN THE SOFTWARE.
|
|
40
|
+
|
|
41
|
+
CONTACT
|
|
42
|
+
-------
|
|
43
|
+
For licensing inquiries, partnership requests, or permission to redistribute:
|
|
44
|
+
https://msapling.com/support
|
package/README.md
CHANGED
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
# MSapling CLI
|
|
2
|
-
|
|
3
|
-
MSapling CLI is the React/TypeScript terminal client for the MSapling backend.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
Install the MSapling CLI globally via npm:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install -g @msapling
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
**Requirements:** Node.js
|
|
14
|
-
|
|
15
|
-
**Note:**
|
|
16
|
-
|
|
17
|
-
## First Run
|
|
18
|
-
|
|
19
|
-
Start the interactive REPL:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
msapling
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Inside the REPL, authenticate using one of these methods:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
/login your@email.com # Email + password login (with optional 2FA)
|
|
29
|
-
/login github # GitHub device flow (opens browser)
|
|
30
|
-
/login <token> # Paste an API token from msapling.com Settings
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
All methods store the token via the OS keychain (Windows DPAPI, macOS Keychain, or Linux libsecret).
|
|
34
|
-
|
|
35
|
-
Once logged in, start chatting:
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
/chat hello
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## CLI Subcommands (argv)
|
|
42
|
-
|
|
43
|
-
These are passed directly on the command line before the REPL starts:
|
|
44
|
-
|
|
45
|
-
| Command | Description |
|
|
46
|
-
|---------|-------------|
|
|
47
|
-
| *(none)* | Start interactive REPL |
|
|
48
|
-
| `--compact` | Start REPL in compact mode (thin separators, no footer) |
|
|
49
|
-
| `mcp serve` | Run as MCP stdio server (Claude Code / Cursor / Windsurf integration) |
|
|
50
|
-
| `--version` | Print version and exit |
|
|
51
|
-
| `--help` | Print usage and exit |
|
|
52
|
-
|
|
53
|
-
## Inside the REPL — Slash Commands
|
|
54
|
-
|
|
55
|
-
Once the REPL is running, type `/help` to see all available slash commands. Common ones:
|
|
56
|
-
|
|
57
|
-
| Slash Command | Description |
|
|
58
|
-
|---------------|-------------|
|
|
59
|
-
| `/login your@email.com` | Sign in with email + password (recommended for end users) |
|
|
60
|
-
| `/login github` | GitHub device flow (for developers) |
|
|
61
|
-
| `/login <token>` | Paste an API token from Settings → API Keys |
|
|
62
|
-
| `/logout` | Clear stored token |
|
|
63
|
-
| `/chat <message>` | Send a message and stream a response |
|
|
64
|
-
| `/swarm <prompt>` | Run parallel agent swarms |
|
|
65
|
-
| `/models` | List available models |
|
|
66
|
-
| `/cost` | Show usage and billing data |
|
|
67
|
-
| `/config` | View and edit configuration |
|
|
68
|
-
| `/help` | Show all slash-command help |
|
|
69
|
-
|
|
70
|
-
> **Note:** `chat`, `login`, `models`, `cost`, `swarm`, and `config` are REPL slash-commands (prefixed with `/`), not top-level argv subcommands. Run `msapling --help` to see the argv interface.
|
|
71
|
-
|
|
72
|
-
See `packages/cli/src/commands/index.ts` for the canonical slash-command list.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
The CLI is not meant to be a large standalone agent runtime. MSapling's backend is the source of truth for auth, projects, chats, model routing, usage, billing, MDrive, locks, and audit data. The website, mobile app, and CLI should all show and modify the same backend state.
|
|
79
|
-
|
|
80
|
-
## Product Direction
|
|
81
|
-
|
|
82
|
-
MSapling started as a multi-chat browser workspace: multiple AI chats, many model choices, BYOK, OpenRouter, and Ollama support in one UI.
|
|
83
|
-
|
|
84
|
-
The mobile app extends that shared workspace to one-chat-at-a-time usage and phone-first workflows such as sending a photo into a chat.
|
|
85
|
-
|
|
86
|
-
The CLI brings the same backend workspace to the terminal. It should be fast, low-resource, and useful without duplicating the backend.
|
|
87
|
-
|
|
88
|
-
## Architecture
|
|
89
|
-
|
|
90
|
-
```text
|
|
91
|
-
Website \
|
|
92
|
-
Mobile App -> MSapling Backend -> chats, projects, usage, billing, MDrive, locks
|
|
93
|
-
CLI /
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
The CLI should:
|
|
97
|
-
|
|
98
|
-
- authenticate with the backend
|
|
99
|
-
- read projects and chats from the backend
|
|
100
|
-
- stream chat responses from `/api/chat/message`
|
|
101
|
-
- display backend usage and quota data
|
|
102
|
-
- respect backend stream locks
|
|
103
|
-
- use backend MDrive/edit proposal flows
|
|
104
|
-
- keep local terminal work lightweight
|
|
105
|
-
|
|
106
|
-
The CLI should not:
|
|
107
|
-
|
|
108
|
-
- invent separate chat state
|
|
109
|
-
- compute billing locally
|
|
110
|
-
- simulate MDrive state
|
|
111
|
-
- bypass backend locks
|
|
112
|
-
- duplicate backend orchestration unless there is a clear reason
|
|
113
|
-
|
|
114
|
-
## Current State
|
|
115
|
-
|
|
116
|
-
This directory is a Bun monorepo scaffold using React and Ink.
|
|
117
|
-
|
|
118
|
-
Port useful behavior selectively. Do not port backend-like responsibilities.
|
|
119
|
-
|
|
120
|
-
Known current gaps:
|
|
121
|
-
|
|
122
|
-
- workspace package manifests are missing
|
|
123
|
-
- the Ink input loop is incomplete
|
|
124
|
-
- `Agent` is referenced but not implemented
|
|
125
|
-
- MDrive logic is simulated locally
|
|
126
|
-
- backend route contracts need to be aligned
|
|
127
|
-
- tests and build are not yet passing
|
|
128
|
-
|
|
129
|
-
## Near-Term Goal
|
|
130
|
-
|
|
131
|
-
Build a stable thin client:
|
|
132
|
-
|
|
133
|
-
1. Login and secure token storage.
|
|
134
|
-
2. Fetch backend project overview.
|
|
135
|
-
3. Open or create chats.
|
|
136
|
-
4. Stream backend chat responses.
|
|
137
|
-
5. Show shared chat history across website, app, and CLI.
|
|
138
|
-
6. Handle lock, quota, and auth errors clearly.
|
|
139
|
-
7. Add `/doctor`.
|
|
140
|
-
|
|
141
|
-
## Commands
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
bun install
|
|
145
|
-
bun run build
|
|
146
|
-
bun test
|
|
147
|
-
bun run start
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
These commands are target commands. They may not pass until the workspace manifests and dependencies are completed.
|
|
151
|
-
|
|
152
|
-
## Environment
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
MSAPLING_API_URL=https://api.msapling.com
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
For local development, point `MSAPLING_API_URL` at the local backend.
|
|
159
|
-
|
|
160
|
-
## Design Principle
|
|
161
|
-
|
|
162
|
-
Keep the CLI small.
|
|
163
|
-
|
|
164
|
-
The backend should do the heavy work. The CLI should make that backend fast and comfortable from a terminal.
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
**Full architecture overview:** see ARCHITECTURE.md (when published) or `packages/core/README.md`.
|
|
1
|
+
# MSapling CLI
|
|
2
|
+
|
|
3
|
+
MSapling CLI is the React/TypeScript terminal client for the MSapling backend.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Install the MSapling CLI globally via npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @mtreeai/msapling-cli@beta
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Requirements:** Node.js 20.10 or higher.
|
|
14
|
+
|
|
15
|
+
**Note:** This is a private/internal package (restricted access). Internal testers should `npm install -g @mtreeai/msapling-cli@beta`. See [@mtreeai/msapling-cli on npm](https://www.npmjs.com/package/@mtreeai/msapling-cli) for the latest version.
|
|
16
|
+
|
|
17
|
+
## First Run
|
|
18
|
+
|
|
19
|
+
Start the interactive REPL:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
msapling
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Inside the REPL, authenticate using one of these methods:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
/login your@email.com # Email + password login (with optional 2FA)
|
|
29
|
+
/login github # GitHub device flow (opens browser)
|
|
30
|
+
/login <token> # Paste an API token from msapling.com Settings
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
All methods store the token via the OS keychain (Windows DPAPI, macOS Keychain, or Linux libsecret).
|
|
34
|
+
|
|
35
|
+
Once logged in, start chatting:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
/chat hello
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## CLI Subcommands (argv)
|
|
42
|
+
|
|
43
|
+
These are passed directly on the command line before the REPL starts:
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| *(none)* | Start interactive REPL |
|
|
48
|
+
| `--compact` | Start REPL in compact mode (thin separators, no footer) |
|
|
49
|
+
| `mcp serve` | Run as MCP stdio server (Claude Code / Cursor / Windsurf integration) |
|
|
50
|
+
| `--version` | Print version and exit |
|
|
51
|
+
| `--help` | Print usage and exit |
|
|
52
|
+
|
|
53
|
+
## Inside the REPL — Slash Commands
|
|
54
|
+
|
|
55
|
+
Once the REPL is running, type `/help` to see all available slash commands. Common ones:
|
|
56
|
+
|
|
57
|
+
| Slash Command | Description |
|
|
58
|
+
|---------------|-------------|
|
|
59
|
+
| `/login your@email.com` | Sign in with email + password (recommended for end users) |
|
|
60
|
+
| `/login github` | GitHub device flow (for developers) |
|
|
61
|
+
| `/login <token>` | Paste an API token from Settings → API Keys |
|
|
62
|
+
| `/logout` | Clear stored token |
|
|
63
|
+
| `/chat <message>` | Send a message and stream a response |
|
|
64
|
+
| `/swarm <prompt>` | Run parallel agent swarms |
|
|
65
|
+
| `/models` | List available models |
|
|
66
|
+
| `/cost` | Show usage and billing data |
|
|
67
|
+
| `/config` | View and edit configuration |
|
|
68
|
+
| `/help` | Show all slash-command help |
|
|
69
|
+
|
|
70
|
+
> **Note:** `chat`, `login`, `models`, `cost`, `swarm`, and `config` are REPL slash-commands (prefixed with `/`), not top-level argv subcommands. Run `msapling --help` to see the argv interface.
|
|
71
|
+
|
|
72
|
+
See `packages/cli/src/commands/index.ts` for the canonical slash-command list.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
The CLI is not meant to be a large standalone agent runtime. MSapling's backend is the source of truth for auth, projects, chats, model routing, usage, billing, MDrive, locks, and audit data. The website, mobile app, and CLI should all show and modify the same backend state.
|
|
79
|
+
|
|
80
|
+
## Product Direction
|
|
81
|
+
|
|
82
|
+
MSapling started as a multi-chat browser workspace: multiple AI chats, many model choices, BYOK, OpenRouter, and Ollama support in one UI.
|
|
83
|
+
|
|
84
|
+
The mobile app extends that shared workspace to one-chat-at-a-time usage and phone-first workflows such as sending a photo into a chat.
|
|
85
|
+
|
|
86
|
+
The CLI brings the same backend workspace to the terminal. It should be fast, low-resource, and useful without duplicating the backend.
|
|
87
|
+
|
|
88
|
+
## Architecture
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Website \
|
|
92
|
+
Mobile App -> MSapling Backend -> chats, projects, usage, billing, MDrive, locks
|
|
93
|
+
CLI /
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The CLI should:
|
|
97
|
+
|
|
98
|
+
- authenticate with the backend
|
|
99
|
+
- read projects and chats from the backend
|
|
100
|
+
- stream chat responses from `/api/chat/message`
|
|
101
|
+
- display backend usage and quota data
|
|
102
|
+
- respect backend stream locks
|
|
103
|
+
- use backend MDrive/edit proposal flows
|
|
104
|
+
- keep local terminal work lightweight
|
|
105
|
+
|
|
106
|
+
The CLI should not:
|
|
107
|
+
|
|
108
|
+
- invent separate chat state
|
|
109
|
+
- compute billing locally
|
|
110
|
+
- simulate MDrive state
|
|
111
|
+
- bypass backend locks
|
|
112
|
+
- duplicate backend orchestration unless there is a clear reason
|
|
113
|
+
|
|
114
|
+
## Current State
|
|
115
|
+
|
|
116
|
+
This directory is a Bun monorepo scaffold using React and Ink.
|
|
117
|
+
|
|
118
|
+
Port useful behavior selectively. Do not port backend-like responsibilities.
|
|
119
|
+
|
|
120
|
+
Known current gaps:
|
|
121
|
+
|
|
122
|
+
- workspace package manifests are missing
|
|
123
|
+
- the Ink input loop is incomplete
|
|
124
|
+
- `Agent` is referenced but not implemented
|
|
125
|
+
- MDrive logic is simulated locally
|
|
126
|
+
- backend route contracts need to be aligned
|
|
127
|
+
- tests and build are not yet passing
|
|
128
|
+
|
|
129
|
+
## Near-Term Goal
|
|
130
|
+
|
|
131
|
+
Build a stable thin client:
|
|
132
|
+
|
|
133
|
+
1. Login and secure token storage.
|
|
134
|
+
2. Fetch backend project overview.
|
|
135
|
+
3. Open or create chats.
|
|
136
|
+
4. Stream backend chat responses.
|
|
137
|
+
5. Show shared chat history across website, app, and CLI.
|
|
138
|
+
6. Handle lock, quota, and auth errors clearly.
|
|
139
|
+
7. Add `/doctor`.
|
|
140
|
+
|
|
141
|
+
## Commands
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
bun install
|
|
145
|
+
bun run build
|
|
146
|
+
bun test
|
|
147
|
+
bun run start
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
These commands are target commands. They may not pass until the workspace manifests and dependencies are completed.
|
|
151
|
+
|
|
152
|
+
## Environment
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
MSAPLING_API_URL=https://api.msapling.com
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
For local development, point `MSAPLING_API_URL` at the local backend.
|
|
159
|
+
|
|
160
|
+
## Design Principle
|
|
161
|
+
|
|
162
|
+
Keep the CLI small.
|
|
163
|
+
|
|
164
|
+
The backend should do the heavy work. The CLI should make that backend fast and comfortable from a terminal.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
**Full architecture overview:** see ARCHITECTURE.md (when published) or `packages/core/README.md`.
|