@tinycloud/cli 1.2.3-beta.0 → 1.2.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,8 +10,9 @@ npm install -g @tinycloud/cli
10
10
 
11
11
  Requires Node.js >= 20.
12
12
 
13
- On Linux, iproute2 installs `/usr/sbin/tc` (traffic control), which can shadow
14
- this CLI on PATH. If the npm global prefix is root-owned, run
13
+ The package installs two identical commands: `tc` and `tinycloud`. On Linux,
14
+ iproute2 installs `/usr/sbin/tc` (traffic control), which can shadow `tc` on
15
+ PATH; `tinycloud` avoids that clash and accepts the same arguments. If the npm global prefix is root-owned, run
15
16
  `npm config set prefix ~/.local` before installing: Ubuntu's default PATH puts
16
17
  `~/.local/bin` before `/usr/sbin`, but `~/.profile` adds it only if the
17
18
  directory existed at login, so start a new login shell after the first
package/bin/tinycloud ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import("../dist/index.js");
@@ -403,6 +403,10 @@ function programName() {
403
403
  function cmd(rest) {
404
404
  return `${name} ${rest}`;
405
405
  }
406
+ function tcCmd(rest) {
407
+ const cli = name.endsWith(" courier") ? name.slice(0, -" courier".length) : "tc";
408
+ return `${cli} ${rest}`;
409
+ }
406
410
 
407
411
  // ../courier/dist/pairing.js
408
412
  var PEER_DELEGATION_EXPIRY = "7d";
@@ -1314,7 +1318,7 @@ function pendingSpaceError(profile) {
1314
1318
  return new CourierError("no-space", `OpenKey is still setting up your TinyCloud "${COURIER_SPACE}" space on ${profile.host}. This can take a few minutes. Run \`${cmd("init --resume")}\` shortly; no new approval is needed. If it still isn't ready after a few minutes, run \`${cmd("init")}\` to approve again, and OpenKey will retry the setup.`);
1315
1319
  }
1316
1320
  function noSpaceError(profile) {
1317
- return new CourierError("no-space", `Your TinyCloud "${COURIER_SPACE}" space is not set up on ${profile.host}, so the approved grant can't be used yet. Courier will not create it. If OpenKey auto-sign didn't host it, sign in once at the Share view (https://share.tinycloud.xyz) or, from a wallet profile, run \`tc space host ${COURIER_SPACE}\`. Then run \`${cmd("init --resume")}\`. No new approval is needed.`);
1321
+ return new CourierError("no-space", `Your TinyCloud "${COURIER_SPACE}" space is not set up on ${profile.host}, so the approved grant can't be used yet. Courier will not create it. If OpenKey auto-sign didn't host it, sign in once at the Share view (https://share.tinycloud.xyz) or, from a wallet profile, run \`${tcCmd(`space host ${COURIER_SPACE}`)}\`. Then run \`${cmd("init --resume")}\`. No new approval is needed.`);
1318
1322
  }
1319
1323
  function ownerGrant(payload, expiresAt) {
1320
1324
  return {
@@ -2123,8 +2127,9 @@ async function main(argv, opts = {}) {
2123
2127
  }
2124
2128
 
2125
2129
  // src/courier-entry.ts
2130
+ import { CLI_NAME } from "@tinycloud/operations/cli-name";
2126
2131
  function runCourier(argv) {
2127
- return main(argv, { prog: "tc courier" });
2132
+ return main(argv, { prog: `${CLI_NAME} courier` });
2128
2133
  }
2129
2134
  export {
2130
2135
  runCourier