@tinycloud/cli 1.5.0-beta.27 → 1.5.0-beta.29
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 +144 -137
- package/bin/tinycloud +9 -0
- package/dist/courier-entry.js +1328 -8
- package/dist/courier-entry.js.map +1 -1
- package/dist/index.js +1462 -59
- package/dist/index.js.map +1 -1
- package/dist/legacy-entry.js +2705 -980
- package/dist/legacy-entry.js.map +1 -1
- package/package.json +8 -8
- package/skills/{tc-cli → tinycloud-cli}/AUTH.md +17 -23
- package/skills/tinycloud-cli/INSTALL.md +36 -0
- package/skills/{tc-cli → tinycloud-cli}/REFERENCE.md +91 -97
- package/skills/{tc-cli → tinycloud-cli}/SDK.md +1 -1
- package/skills/{tc-cli → tinycloud-cli}/SKILL.md +29 -32
- package/skills/{tc-cli → tinycloud-cli}/release.json +1 -1
- package/skills/tc-cli/INSTALL.md +0 -35
package/README.md
CHANGED
|
@@ -1,51 +1,49 @@
|
|
|
1
1
|
# @tinycloud/cli
|
|
2
2
|
|
|
3
|
-
Self-sovereign storage from the terminal. `
|
|
3
|
+
Self-sovereign storage from the terminal. `tinycloud` is the command-line interface for [TinyCloud](https://tinycloud.xyz) — manage data, delegations, spaces, and nodes without leaving your shell.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install -g @tinycloud/cli
|
|
8
|
+
npm install -g @tinycloud/cli@1.5.0-beta.20
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Requires Node.js >= 20.
|
|
12
12
|
|
|
13
|
-
The package
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
install. Run `hash -r` if `tc` already ran in the same shell. Verify with
|
|
20
|
-
`command -v tc`, or call `"$(npm prefix --global)/bin/tc"` when in doubt.
|
|
13
|
+
The package exposes `tinycloud` as its preferred command and keeps `tc` as a
|
|
14
|
+
deprecated compatibility alias at the same entry. Both names accept the same
|
|
15
|
+
commands and flags, with identical exit codes and stdout. A POSIX `tc` executable
|
|
16
|
+
link emits one deprecation notice on stderr, never stdout. On Linux,
|
|
17
|
+
`/usr/sbin/tc` is iproute2's traffic-control tool. Verify the pinned install
|
|
18
|
+
with `tinycloud --version`.
|
|
21
19
|
|
|
22
20
|
## Agent skills
|
|
23
21
|
|
|
24
|
-
The package ships the general `
|
|
25
|
-
`skills/
|
|
26
|
-
See [skill installation](skills/
|
|
22
|
+
The package ships the general `tinycloud-cli` skill and its references in
|
|
23
|
+
`skills/tinycloud-cli`, and the `courier` skill for `tinycloud courier` in `skills/courier`.
|
|
24
|
+
See [skill installation](skills/tinycloud-cli/INSTALL.md) for a
|
|
27
25
|
pinned, cross-agent installation with OpenCode, Codex and Claude Code, and
|
|
28
|
-
[authentication](skills/
|
|
26
|
+
[authentication](skills/tinycloud-cli/AUTH.md) for device login and relaying the
|
|
29
27
|
approval code to the owner.
|
|
30
28
|
|
|
31
29
|
## Courier
|
|
32
30
|
|
|
33
|
-
`
|
|
31
|
+
`tinycloud courier …` runs [Courier](https://github.com/TinyCloudLabs/js-sdk/tree/master/packages/courier#readme), agent-to-agent threads
|
|
34
32
|
over TinyCloud, bundled from `@tinycloud/courier` (beta). It takes the same
|
|
35
33
|
arguments as the standalone `courier` bin and keeps its own agent identity in
|
|
36
|
-
`$COURIER_HOME` (default `~/.courier`), not in a
|
|
34
|
+
`$COURIER_HOME` (default `~/.courier`), not in a tinycloud profile, so put every flag
|
|
37
35
|
after `courier`:
|
|
38
36
|
|
|
39
37
|
```bash
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
tinycloud courier init --paste --handle alice # the owner approves in OpenKey; paste the XXXX-XXXX code
|
|
39
|
+
tinycloud courier inbox
|
|
40
|
+
tinycloud courier --help
|
|
43
41
|
```
|
|
44
42
|
|
|
45
43
|
## Operations coverage
|
|
46
44
|
|
|
47
|
-
The migrated `
|
|
48
|
-
uses delegated authority by default. `
|
|
45
|
+
The migrated `tinycloud secrets get` path is owned by `@tinycloud/operations` and
|
|
46
|
+
uses delegated authority by default. `tinycloud auth import` is partially migrated:
|
|
49
47
|
the request-bound active-session v1 path is canonical, while legacy delegation
|
|
50
48
|
and permission input forms remain Commander-owned. The complete registration
|
|
51
49
|
ledger is checked in `../operations/coverage.json` and checked against the
|
|
@@ -61,51 +59,50 @@ fallback for delegated execution.
|
|
|
61
59
|
|
|
62
60
|
```bash
|
|
63
61
|
# Set up a profile and generate keys
|
|
64
|
-
|
|
62
|
+
tinycloud init
|
|
65
63
|
|
|
66
64
|
# Authenticate via browser
|
|
67
|
-
|
|
65
|
+
tinycloud auth login
|
|
68
66
|
|
|
69
67
|
# Authenticate on a remote/headless machine: the owner approves an explicit
|
|
70
68
|
# manifest on their phone (URL + code printed to stderr). Use a new profile
|
|
71
69
|
# name if it already exists; keep the user's existing profiles.
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
tinycloud init --name publisher --key-only
|
|
71
|
+
tinycloud --profile publisher auth login --device --manifest builtin:share-publishing
|
|
74
72
|
|
|
75
73
|
# Same Share publishing scope, as a shortcut (on the dedicated profile)
|
|
76
|
-
|
|
74
|
+
tinycloud --profile publisher enable share
|
|
77
75
|
|
|
78
76
|
# Selected profile, owner, host and space (JSON; does not test access)
|
|
79
|
-
|
|
77
|
+
tinycloud context
|
|
80
78
|
|
|
81
79
|
# Store and retrieve data
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
tinycloud kv put greeting "Hello, world"
|
|
81
|
+
tinycloud kv get greeting
|
|
82
|
+
tinycloud kv list
|
|
85
83
|
|
|
86
84
|
# Manage network-encrypted secrets on the default network
|
|
87
|
-
|
|
88
|
-
printf '%s' "$ANTHROPIC_API_KEY" |
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
tinycloud secrets network init
|
|
86
|
+
printf '%s' "$ANTHROPIC_API_KEY" | tinycloud secrets put ANTHROPIC_API_KEY --stdin
|
|
87
|
+
tinycloud secrets get ANTHROPIC_API_KEY
|
|
88
|
+
tinycloud secrets run ANTHROPIC_API_KEY -- python train.py # the value only in the command's environment
|
|
91
89
|
|
|
92
90
|
# Ask the owner for a secret an agent needs, then wait for it
|
|
93
|
-
# (call TinyCloud's CLI by absolute path: a bare
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"$TC_BIN" --profile agent secrets wait OPENAI_API_KEY --timeout 9m --json # 0 ready, 8 pending
|
|
91
|
+
# (call TinyCloud's CLI by absolute path when using tc: a bare tc can be iproute2's /usr/sbin/tc)
|
|
92
|
+
tinycloud --profile agent secrets request OPENAI_API_KEY --json # offline; prints the owner's link
|
|
93
|
+
tinycloud --profile agent secrets wait OPENAI_API_KEY --timeout 9m --json # 0 ready, 8 pending
|
|
97
94
|
|
|
98
95
|
# Manage spaces
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
tinycloud space list
|
|
97
|
+
tinycloud space create
|
|
101
98
|
|
|
102
99
|
# Grant access to another user
|
|
103
|
-
|
|
100
|
+
tinycloud delegation create --to did:pkh:eip155:1:0x...
|
|
104
101
|
```
|
|
105
102
|
|
|
106
103
|
## Home feed
|
|
107
104
|
|
|
108
|
-
`
|
|
105
|
+
`tinycloud feed` uses separate owner-provisioned SQLite databases for each agent's
|
|
109
106
|
cards/handling and the owner's append-only responses. Owner registry and view
|
|
110
107
|
state live separately. SDK consumers use the same contract from
|
|
111
108
|
`@tinycloud/sdk-services/feed` with existing SQL database handles; see the
|
|
@@ -121,10 +118,10 @@ Create a separate agent profile and set `AGENT_DID` to its printed DID. Use the
|
|
|
121
118
|
same node as the owner:
|
|
122
119
|
|
|
123
120
|
```bash
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
tinycloud profile create feed-agent --posture delegate-session --operator agent
|
|
122
|
+
tinycloud --profile owner feed connect --agent writer --to "$AGENT_DID" --label Writer \
|
|
126
123
|
--space applications > feed-grant.json
|
|
127
|
-
|
|
124
|
+
tinycloud --profile feed-agent auth import feed-grant.json
|
|
128
125
|
```
|
|
129
126
|
|
|
130
127
|
`connect` reserves a stable token/DID/resource binding, provisions both schemas,
|
|
@@ -144,8 +141,8 @@ Publish `card.json` from the agent profile:
|
|
|
144
141
|
```
|
|
145
142
|
|
|
146
143
|
```bash
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
tinycloud --profile feed-agent feed publish --agent writer --file card.json
|
|
145
|
+
tinycloud --profile feed-agent feed watch --agent writer --recipient agent-runtime \
|
|
149
146
|
--runner '["node","agent-handler.js"]'
|
|
150
147
|
```
|
|
151
148
|
|
|
@@ -157,10 +154,10 @@ profile in another terminal, or answer the card through Home:
|
|
|
157
154
|
```
|
|
158
155
|
|
|
159
156
|
```bash
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
tinycloud --profile owner feed respond --agent writer --file response.json
|
|
158
|
+
tinycloud --profile feed-agent feed responses --agent writer --after 0
|
|
159
|
+
tinycloud --profile feed-agent feed handling --agent writer --file handling.json
|
|
160
|
+
tinycloud --profile owner feed show card-draft-01 --agent writer
|
|
164
161
|
```
|
|
165
162
|
|
|
166
163
|
For an explicit outbound note to that agent, save a separate `message.json`:
|
|
@@ -170,7 +167,7 @@ For an explicit outbound note to that agent, save a separate `message.json`:
|
|
|
170
167
|
```
|
|
171
168
|
|
|
172
169
|
```bash
|
|
173
|
-
|
|
170
|
+
tinycloud --profile owner feed message --agent writer --file message.json
|
|
174
171
|
```
|
|
175
172
|
|
|
176
173
|
Messages also work on information cards with `needsResponse: false`. They do not
|
|
@@ -190,8 +187,8 @@ JSON envelope, for example:
|
|
|
190
187
|
Include it on the **first** save, instead of the plain `respond` command above:
|
|
191
188
|
|
|
192
189
|
```bash
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
tinycloud --profile owner feed respond --agent writer --file response.json --payload-file payload.json
|
|
191
|
+
tinycloud --profile feed-agent feed payload --agent writer --response response-draft-01 \
|
|
195
192
|
--card card-draft-01 --revision 1 --issuance issuance-draft-01
|
|
196
193
|
```
|
|
197
194
|
|
|
@@ -251,56 +248,56 @@ execution is not promised.
|
|
|
251
248
|
|
|
252
249
|
| Command | Description |
|
|
253
250
|
|---------|-------------|
|
|
254
|
-
| `
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
266
|
-
| `
|
|
267
|
-
| `
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
| `
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
| `
|
|
293
|
-
| `
|
|
294
|
-
| `
|
|
295
|
-
| `
|
|
251
|
+
| `tinycloud init` | Set up a profile and generate keys |
|
|
252
|
+
| `tinycloud auth login` | Authenticate via browser |
|
|
253
|
+
| `tinycloud auth login --device --manifest <file>` | Approve exactly a manifest's permissions on another device (phone) |
|
|
254
|
+
| `tinycloud auth login --manifest <file>` | Browser OpenKey login scoped to a manifest |
|
|
255
|
+
| `tinycloud enable share` | Device login with the built-in Share publishing manifest (use a dedicated profile) |
|
|
256
|
+
| `tinycloud context` | Show the selected profile, owner, host, space and session state |
|
|
257
|
+
| `tinycloud auth status` | Show authentication status |
|
|
258
|
+
| `tinycloud auth whoami` | Show current identity |
|
|
259
|
+
| `tinycloud auth request --preset apps-agent [--app <id>]... [--write]` | Request access for an agent to the user's installed apps: read-only by default, for one app, several, or all. `--write --app <id>` also lets the agent change that app's data: write its `knowledge/` and `prefs/` files and add, change or delete its table rows. For the Health Log app's catalog database, it can also create, change and drop tables (nodes before 1.21.6 do not enforce that split). It cannot change the app's code, manifest or install record |
|
|
260
|
+
| `tinycloud knowledge list` | List the installed apps that have a knowledge bundle |
|
|
261
|
+
| `tinycloud knowledge read <app_id> [concept]` | Read an app's knowledge index, or one concept with its frontmatter parsed |
|
|
262
|
+
| `tinycloud apps install <app_id>` | Install a pinned catalog app into the applications space of the profile it runs under (the owner's, for a delegate profile, through its grant): each file is verified against its pinned digest, the pinned DDL runs only if every statement is allowed, and knowledge notes are created create-only. Notes you have edited are left as they are and reported (exit 0) |
|
|
263
|
+
| `tinycloud kv get <key>` | Retrieve a value |
|
|
264
|
+
| `tinycloud kv put <key> <value>` | Store a value |
|
|
265
|
+
| `tinycloud kv list` | List all keys |
|
|
266
|
+
| `tinycloud sql query <sql>` | Run a SQLite SELECT query |
|
|
267
|
+
| `tinycloud sql execute <sql>` | Run a SQLite write or schema statement |
|
|
268
|
+
| `tinycloud sql export` | Export a SQLite database file |
|
|
269
|
+
| `tinycloud feed` | Connect an agent, publish cards, save responses, record handling, and watch for runtime handoff; see [Home feed](#home-feed) |
|
|
270
|
+
| `tinycloud space list` | List your spaces |
|
|
271
|
+
| `tinycloud space create` | Create a new space |
|
|
272
|
+
| `tinycloud delegation create` | Grant access to another user |
|
|
273
|
+
| `tinycloud delegation list` | List delegations |
|
|
274
|
+
| `tinycloud delegation revoke <cid>` | Revoke a delegation. From a delegate profile, revoke one its own key issued. |
|
|
275
|
+
| `tinycloud share` | Share data with another user |
|
|
276
|
+
| `tinycloud node` | Manage TinyCloud nodes |
|
|
277
|
+
| `tinycloud profile list` | List profiles |
|
|
278
|
+
| `tinycloud profile show` | Show profile details |
|
|
279
|
+
| `tinycloud profile create` | Create a new profile |
|
|
280
|
+
| `tinycloud vault` | Manage encrypted KV vaults |
|
|
281
|
+
| `tinycloud secrets` | Manage network-encrypted secrets |
|
|
282
|
+
| `tinycloud secrets network show` | Show a secrets decryption network |
|
|
283
|
+
| `tinycloud secrets network init` | Create or fetch the default secrets network |
|
|
284
|
+
| `tinycloud secrets network grant` | Grant `tinycloud.encryption/decrypt` on a secrets network |
|
|
285
|
+
| `tinycloud secrets run` | Run a command with secrets in its environment |
|
|
286
|
+
| `tinycloud secrets request` | Print a Secret Manager link asking the owner to add secrets (offline) |
|
|
287
|
+
| `tinycloud secrets wait` | Wait until secrets exist and are readable (never signs in; needs a stored session; exit 8 pending, 130 interrupted) |
|
|
288
|
+
| `tinycloud secrets manage` | Print or open the Secret Manager page, `{url, opened}` |
|
|
289
|
+
| `tinycloud vars` | Manage environment variables |
|
|
290
|
+
| `tinycloud doctor` | Run diagnostic checks |
|
|
291
|
+
| `tinycloud completion` | Generate shell completions |
|
|
292
|
+
| `tinycloud courier` | Agent-to-agent threads over TinyCloud (beta; see [Courier](#courier)) |
|
|
296
293
|
|
|
297
294
|
Secret names are env-style uppercase identifiers such as `FIREFLIES_API_KEY`.
|
|
298
|
-
`
|
|
299
|
-
`urn:tinycloud:encryption:<ownerDid>:<network>` identifier. `
|
|
295
|
+
`tinycloud secrets network show` accepts either a short network name or a full
|
|
296
|
+
`urn:tinycloud:encryption:<ownerDid>:<network>` identifier. `tinycloud secrets
|
|
300
297
|
network grant` takes the short name, resolves the network, and grants
|
|
301
298
|
`tinycloud.encryption/decrypt`.
|
|
302
299
|
|
|
303
|
-
`
|
|
300
|
+
`tinycloud apps install` re-creates the pinned views on every run (reported as
|
|
304
301
|
`viewsRecreated`). Knowledge notes whose bytes differ from the pinned version
|
|
305
302
|
are left as you edited them and listed under `conflicts` (JSON); the command
|
|
306
303
|
still exits 0 and installs the rest. If the schema fails after notes were
|
|
@@ -310,55 +307,55 @@ is safe.
|
|
|
310
307
|
### Running a command with secrets
|
|
311
308
|
|
|
312
309
|
```bash
|
|
313
|
-
|
|
310
|
+
tinycloud secrets run NAME... [--map NAME=ENV_VAR]... [--scope S] [--space S] [--delegation SOURCE] [--private-key HEX] -- <command> [args...]
|
|
314
311
|
|
|
315
|
-
|
|
316
|
-
|
|
312
|
+
tinycloud secrets run ANTHROPIC_API_KEY OPENAI_API_KEY -- python train.py
|
|
313
|
+
tinycloud secrets run --map ANTHROPIC_KEY=ANTHROPIC_API_KEY -- node server.js
|
|
317
314
|
```
|
|
318
315
|
|
|
319
|
-
`
|
|
316
|
+
`tinycloud secrets run` reads every named secret as `tinycloud secrets get` does, then
|
|
320
317
|
starts `<command>` directly, without a shell, with each value in its
|
|
321
318
|
environment: under the secret's name, or under `ENV_VAR` for `--map
|
|
322
319
|
NAME=ENV_VAR`. A value replaces an inherited variable of the same name.
|
|
323
|
-
|
|
320
|
+
tinycloud doesn't pass its own `TC_PRIVATE_KEY` to the command. To give the command
|
|
324
321
|
a key from a secret, use `--map NAME=TC_PRIVATE_KEY`.
|
|
325
322
|
Everything after the first `--`, including any further `--`, goes to the
|
|
326
|
-
command unchanged. The command uses
|
|
323
|
+
command unchanged. The command uses tinycloud's stdin, stdout and stderr; tinycloud itself
|
|
327
324
|
writes nothing to stdout, and its own messages go to stderr.
|
|
328
325
|
|
|
329
326
|
Name at least one secret, as an argument or with `--map`. `ENV_VAR` must
|
|
330
327
|
match `[A-Za-z_][A-Za-z0-9_]*`, and two secrets cannot be mapped to the same
|
|
331
328
|
variable (exit 2). If any secret cannot be read, the command does not start
|
|
332
|
-
and
|
|
333
|
-
Otherwise
|
|
334
|
-
SIGINT, SIGTERM, SIGHUP, SIGKILL, SIGALRM or SIGUSR2,
|
|
329
|
+
and tinycloud exits with the code and error `tinycloud secrets get` gives for that secret.
|
|
330
|
+
Otherwise tinycloud exits with the command's exit code. If the command was ended by
|
|
331
|
+
SIGINT, SIGTERM, SIGHUP, SIGKILL, SIGALRM or SIGUSR2, tinycloud ends by the same
|
|
335
332
|
signal (or exits with 128 plus the signal number if that signal doesn't end
|
|
336
|
-
|
|
337
|
-
128 plus the signal number instead, so
|
|
333
|
+
tinycloud). If any other signal ended it, such as SIGQUIT or SIGSEGV, tinycloud exits with
|
|
334
|
+
128 plus the signal number instead, so tinycloud does not cause a core dump
|
|
338
335
|
(SIGUSR1 and SIGPIPE are left out too: Node uses SIGUSR1 for its inspector
|
|
339
336
|
and ignores SIGPIPE).
|
|
340
337
|
|
|
341
|
-
SIGINT, SIGTERM, SIGHUP and SIGQUIT sent to
|
|
338
|
+
SIGINT, SIGTERM, SIGHUP and SIGQUIT sent to tinycloud go to the command. When tinycloud
|
|
342
339
|
runs in the foreground of a terminal, it doesn't pass on SIGINT, SIGQUIT or
|
|
343
340
|
SIGHUP: the terminal already sends them (Ctrl-C, Ctrl-\, hangup) to the
|
|
344
|
-
command, so the command normally gets each one once.
|
|
341
|
+
command, so the command normally gets each one once. tinycloud checks whether it's
|
|
345
342
|
in the foreground using `/proc`, or `ps` where `/proc` isn't available. If
|
|
346
|
-
neither works, it passes the signals on. When
|
|
343
|
+
neither works, it passes the signals on. When tinycloud runs in the background, it
|
|
347
344
|
passes them on, so a signal sent to the whole job (for example `kill -INT
|
|
348
345
|
%1`) can reach the command twice.
|
|
349
346
|
|
|
350
|
-
From a script, stop the command by sending SIGTERM to
|
|
347
|
+
From a script, stop the command by sending SIGTERM to tinycloud's process ID. tinycloud
|
|
351
348
|
passes it on, waits for the command to exit, then exits the way the command
|
|
352
349
|
did (the command's own exit code if it handles SIGTERM itself). If the
|
|
353
|
-
command ignores SIGTERM,
|
|
350
|
+
command ignores SIGTERM, tinycloud keeps waiting.
|
|
354
351
|
|
|
355
352
|
A command that does not exist exits 127; one that cannot be executed, or
|
|
356
353
|
cannot be started for another reason, exits 126. These cases print one plain
|
|
357
|
-
line on stderr, even with `--json`: `
|
|
354
|
+
line on stderr, even with `--json`: `tinycloud secrets run: <command>: command not
|
|
358
355
|
found`, `…: permission denied` or `…: cannot run (<error code>)`.
|
|
359
356
|
|
|
360
|
-
Limits: `
|
|
361
|
-
history and
|
|
357
|
+
Limits: `tinycloud secrets run` keeps values out of the command line, your shell
|
|
358
|
+
history and tinycloud's own output. It doesn't hide them from the command: the
|
|
362
359
|
command, and anything it starts, receives the values and can print, log or
|
|
363
360
|
pass them on. Other programs running as the same user can often read a
|
|
364
361
|
process's environment too.
|
|
@@ -380,7 +377,7 @@ process's environment too.
|
|
|
380
377
|
Replication is off by default. `--replication` enables it for one invocation;
|
|
381
378
|
`--no-replication` overrides `TC_REPLICATION=1`, and `--replication-debug`
|
|
382
379
|
writes diagnostics to stderr. Save explicit login prefixes with
|
|
383
|
-
`
|
|
380
|
+
`tinycloud auth login --replication-prefix notes/`; saved prefixes are reapplied on
|
|
384
381
|
later logins and rotation. Prefixes are folders (`notes/`) or `/` for the
|
|
385
382
|
whole space. Whole-space replication requires `kv-sync-root` support and
|
|
386
383
|
`--replication-allow-secrets`, because it includes `vault/`. Replication needs
|
|
@@ -401,7 +398,7 @@ Chromium browsers that enforce Local Network Access without granting it (headles
|
|
|
401
398
|
Chromium cannot show the prompt), may block the HTTPS page's plain-HTTP loopback
|
|
402
399
|
callback: use an interactive CLI terminal and paste the same one-line code shown
|
|
403
400
|
by OpenKey, or start with
|
|
404
|
-
`
|
|
401
|
+
`tinycloud auth login --method openkey --replication-prefix notes/ --owner DID --paste`
|
|
405
402
|
for a headless terminal. Non-TTY `--no-popup` cannot accept a paste; if that
|
|
406
403
|
callback fails, it exits nonzero at the five-minute expiry with a `--paste`
|
|
407
404
|
retry hint and discards the candidate key. Restarting requires a new approval
|
|
@@ -409,10 +406,20 @@ and cannot reuse the old signed code. Ctrl-C, SIGINT or SIGTERM before approval
|
|
|
409
406
|
arrives cancels the OpenKey handoff (best effort) and exits 130 `CANCELLED`
|
|
410
407
|
without saving a key or session.
|
|
411
408
|
|
|
412
|
-
|
|
409
|
+
Normal OpenKey login prints a short approval link on stderr and waits. Relay it
|
|
410
|
+
to the owner from a headless or remote CLI; no localhost callback or pasted code
|
|
411
|
+
is needed. `--no-popup` skips opening a local browser, not automatic result
|
|
412
|
+
retrieval. The CLI verifies the encrypted result, durably saves it, then
|
|
413
|
+
acknowledges delivery. Re-run the same command after an interruption to resume.
|
|
414
|
+
The one-hour request expiry is independent of the requested grant lifetime and
|
|
415
|
+
result retention. Normal login keeps its seven-day default; onboarding requests
|
|
416
|
+
30 days explicitly. `--paste` remains an explicit manual fallback with a
|
|
417
|
+
five-minute, single-use return code, not the automatic short-link transport.
|
|
418
|
+
|
|
419
|
+
Use `tinycloud replica report` for read-only aggregates of persisted replication events
|
|
413
420
|
and identity partitions. Live replica status is unavailable there. Report
|
|
414
421
|
`--purge` and `--clear-pending` refuse with exit 2 `REPORT_READ_ONLY`.
|
|
415
|
-
`
|
|
422
|
+
`tinycloud replica reset --replica <name> --purge` is a partial alternative for a
|
|
416
423
|
named local replica only. Flag-owned purge and pending clearing have no
|
|
417
424
|
equivalent yet (TC-1309). On macOS and Windows, `replica reset --purge` and
|
|
418
425
|
`auth logout` with a legacy `replicas/` tree refuse local removal rather than
|
|
@@ -451,7 +458,7 @@ flag-owned replicas untouched; startup finishes the legacy removal if it is
|
|
|
451
458
|
interrupted. If an earlier sign-out was interrupted, logout reports it and a
|
|
452
459
|
second `auth logout` completes it. A gate that no longer matches its logout
|
|
453
460
|
record (for example, restored from an older copy) refuses logout; switch the
|
|
454
|
-
default profile if needed, then run `
|
|
461
|
+
default profile if needed, then run `tinycloud profile delete <name>` and sign in
|
|
455
462
|
again.
|
|
456
463
|
|
|
457
464
|
`auth logout`, `auth rotate`, and replica-enabled `auth login` that replaces the
|
|
@@ -460,20 +467,20 @@ unexpired shares, or cannot be read, the command refuses with exit 5
|
|
|
460
467
|
(`SHARE_HISTORY_UNEXPIRED` or `SHARE_HISTORY_UNAVAILABLE`) and changes nothing.
|
|
461
468
|
Pass `--force` to proceed anyway; `auth logout --revoke` also skips the check. A
|
|
462
469
|
plain re-login that keeps the key is not checked, and local-owner profiles are not
|
|
463
|
-
checked. `
|
|
470
|
+
checked. `tinycloud share history recover` moves an unreadable history file aside to
|
|
464
471
|
`share-history-v2.json.unreadable-<UTC timestamp>` and reports the new path. It
|
|
465
472
|
never deletes or overwrites a file. If the file exists but cannot be read,
|
|
466
473
|
recover exits 1 with `SHARE_HISTORY_RECOVER_FAILED` and moves nothing.
|
|
467
474
|
|
|
468
|
-
`
|
|
469
|
-
`
|
|
475
|
+
`tinycloud auth grants list` labels the signed-in delegation CID `(current session)`.
|
|
476
|
+
`tinycloud delegation revoke <cid>` still accepts any eligible exact CID, but when
|
|
470
477
|
`<cid>` is the current session it requires `--yes` or an interactive confirmation
|
|
471
478
|
before contacting the node. An exact-CID success then runs the same durable
|
|
472
479
|
local sign-out and key shred as `auth logout`; revoking another CID leaves the
|
|
473
480
|
session intact.
|
|
474
481
|
|
|
475
482
|
B-int release acceptance must
|
|
476
|
-
verify the OpenKey `
|
|
483
|
+
verify the OpenKey `tinycloud auth request --grant` fallback against a real OpenKey
|
|
477
484
|
using a test account and no production writes: approve the request, confirm the
|
|
478
485
|
grant is stored, start a fresh process, and verify the saved prefixes are
|
|
479
486
|
replayed and the covered read is served locally. If OpenKey rejects explicit
|
|
@@ -481,7 +488,7 @@ replayed and the covered read is served locally. If OpenKey rejects explicit
|
|
|
481
488
|
|
|
482
489
|
## Output Modes
|
|
483
490
|
|
|
484
|
-
`
|
|
491
|
+
`tinycloud` auto-detects your terminal:
|
|
485
492
|
|
|
486
493
|
- **Interactive (TTY)** — human-friendly output with colors, tables, and status icons
|
|
487
494
|
- **Piped / redirected** — structured JSON for scripting
|
|
@@ -489,29 +496,29 @@ replayed and the covered read is served locally. If OpenKey rejects explicit
|
|
|
489
496
|
|
|
490
497
|
```bash
|
|
491
498
|
# Human-friendly table
|
|
492
|
-
|
|
499
|
+
tinycloud kv list
|
|
493
500
|
|
|
494
501
|
# JSON for scripting
|
|
495
|
-
|
|
496
|
-
|
|
502
|
+
tinycloud kv list --json
|
|
503
|
+
tinycloud kv list | jq '.[]'
|
|
497
504
|
```
|
|
498
505
|
|
|
499
506
|
## Diagnostics
|
|
500
507
|
|
|
501
508
|
```bash
|
|
502
|
-
|
|
509
|
+
tinycloud doctor
|
|
503
510
|
```
|
|
504
511
|
|
|
505
512
|
Checks Node.js version, profile configuration, keys, session status, node connectivity (with latency), and space availability. Outputs actionable guidance for any failing checks.
|
|
506
513
|
|
|
507
514
|
## Profiles
|
|
508
515
|
|
|
509
|
-
`
|
|
516
|
+
`tinycloud` supports multiple profiles for different environments:
|
|
510
517
|
|
|
511
518
|
```bash
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
519
|
+
tinycloud profile create staging --host https://staging.tinycloud.xyz
|
|
520
|
+
tinycloud profile list
|
|
521
|
+
tinycloud kv list --profile staging
|
|
515
522
|
```
|
|
516
523
|
|
|
517
524
|
### Pointing a profile at a self-hosted OpenKey
|
|
@@ -529,7 +536,7 @@ profile JSON directly:
|
|
|
529
536
|
}
|
|
530
537
|
```
|
|
531
538
|
|
|
532
|
-
`
|
|
539
|
+
`tinycloud auth login --method openkey` and `tinycloud auth request` honor this for the
|
|
533
540
|
profile. Set `TC_OPENKEY_HOST` to override per invocation without editing the
|
|
534
541
|
file.
|
|
535
542
|
|
package/bin/tinycloud
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { basename } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
if (basename(process.argv[1] ?? "") === "tc") {
|
|
7
|
+
process.stderr.write("tc is now tinycloud; tc will keep working for now.\n");
|
|
8
|
+
}
|
|
9
|
+
// Both installed names share one entry and canonical command/error guidance.
|
|
10
|
+
process.argv[1] = fileURLToPath(import.meta.url);
|
|
11
|
+
|
|
3
12
|
import("../dist/index.js");
|