@mtreeai/msapling-cli 2.3.6-beta.34 → 2.3.6-beta.36
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 +168 -168
- package/dist/index.js +8 -7
- package/package.json +1 -1
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`.
|
package/dist/index.js
CHANGED
|
@@ -11936,8 +11936,8 @@ function formatTable(results) {
|
|
|
11936
11936
|
const model = r.model.slice(0, 39).padEnd(40);
|
|
11937
11937
|
const ttft = r.ttft_ms != null ? r.ttft_ms.toFixed(0).padStart(9) : " - ";
|
|
11938
11938
|
const tps = r.tps != null ? r.tps.toFixed(1).padStart(7) : " - ";
|
|
11939
|
-
const tok = r.total_tokens.toString().padStart(8);
|
|
11940
|
-
const cost = r.cost_usd.toFixed(5).padStart(9);
|
|
11939
|
+
const tok = (r.total_tokens ?? 0).toString().padStart(8);
|
|
11940
|
+
const cost = (typeof r.cost_usd === "number" ? r.cost_usd : 0).toFixed(5).padStart(9);
|
|
11941
11941
|
const err = r.error ? ` \u26A0 ${r.error}` : "";
|
|
11942
11942
|
return `${model} ${ttft} ${tps} ${tok} ${cost}${err}`;
|
|
11943
11943
|
});
|
|
@@ -12370,7 +12370,7 @@ var init_version = __esm({
|
|
|
12370
12370
|
description: "Show version information for CLI and core packages",
|
|
12371
12371
|
category: "debug",
|
|
12372
12372
|
handler: async (_args, context) => {
|
|
12373
|
-
const cliVersion = true ? "2.3.6-beta.
|
|
12373
|
+
const cliVersion = true ? "2.3.6-beta.36" : "(dev)";
|
|
12374
12374
|
const coreVersion = true ? "2.3.2" : "(dev)";
|
|
12375
12375
|
const runtime = process.version;
|
|
12376
12376
|
context.addMessage("system", "MSapling Version Info");
|
|
@@ -12379,7 +12379,7 @@ var init_version = __esm({
|
|
|
12379
12379
|
context.addMessage("system", row2("Core (@msapling/core)", coreVersion));
|
|
12380
12380
|
context.addMessage("system", row2("Runtime (Node/Bun)", runtime));
|
|
12381
12381
|
try {
|
|
12382
|
-
const ts = "2026-06-02T15:
|
|
12382
|
+
const ts = "2026-06-02T15:16:34.864Z";
|
|
12383
12383
|
if (ts && ts !== "__BUILD_TIMESTAMP__") {
|
|
12384
12384
|
context.addMessage("system", row2("Build Timestamp", ts));
|
|
12385
12385
|
}
|
|
@@ -13111,11 +13111,12 @@ var init_budget = __esm({
|
|
|
13111
13111
|
try {
|
|
13112
13112
|
const data = await context.client.getBillingBuckets();
|
|
13113
13113
|
context.addMessage("system", "Budget Buckets:");
|
|
13114
|
+
const n = (v) => typeof v === "number" && Number.isFinite(v) ? v : Number(v) || 0;
|
|
13114
13115
|
if (data && typeof data === "object") {
|
|
13115
13116
|
for (const [key, val] of Object.entries(data)) {
|
|
13116
13117
|
const bucket = val;
|
|
13117
|
-
const remaining = bucket
|
|
13118
|
-
const limit = bucket
|
|
13118
|
+
const remaining = n(bucket?.remaining ?? bucket?.balance);
|
|
13119
|
+
const limit = n(bucket?.limit ?? bucket?.cap);
|
|
13119
13120
|
context.addMessage("system", ` - ${key}: $${remaining.toFixed(4)} / $${limit.toFixed(4)}`);
|
|
13120
13121
|
}
|
|
13121
13122
|
} else {
|
|
@@ -17896,7 +17897,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
17896
17897
|
var Header = () => /* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, marginBottom: 1, children: [
|
|
17897
17898
|
/* @__PURE__ */ jsxs(Text, { bold: true, color: "cyan", children: [
|
|
17898
17899
|
"\u25CF MSapling CLI v",
|
|
17899
|
-
"2.3.6-beta.
|
|
17900
|
+
"2.3.6-beta.36"
|
|
17900
17901
|
] }),
|
|
17901
17902
|
/* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: "Platinum Tier Architecture" }) })
|
|
17902
17903
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtreeai/msapling-cli",
|
|
3
|
-
"version": "2.3.6-beta.
|
|
3
|
+
"version": "2.3.6-beta.36",
|
|
4
4
|
"description": "MSapling CLI — React/Ink terminal client for the MSapling backend (chat, projects, MDrive, agent tools). Proprietary; redistribution prohibited.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "MSapling Team",
|