@easybits.cloud/cli 0.6.0 → 0.6.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 +19 -6
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,9 @@ Requires Node 22+.
|
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
easybits login # opens your browser (OAuth2 + PKCE); session renews itself
|
|
20
|
+
easybits login --no-browser # only print the sign-in URL
|
|
20
21
|
easybits login - < key.txt # or save an API key, read from stdin (never in argv)
|
|
22
|
+
printenv EB_KEY | easybits login --with-token # same as -
|
|
21
23
|
easybits usage
|
|
22
24
|
easybits logout
|
|
23
25
|
```
|
|
@@ -25,7 +27,8 @@ easybits logout
|
|
|
25
27
|
Running a command without a session in a terminal starts the login automatically;
|
|
26
28
|
without a terminal (agents, CI) it exits `3`. Precedence: `EASYBITS_API_KEY` env var >
|
|
27
29
|
`--token <key>` > browser session > saved API key. Keys: https://www.easybits.cloud/dash/developer.
|
|
28
|
-
In CI and agents, `EASYBITS_API_KEY` needs no login at all.
|
|
30
|
+
In CI and agents, `EASYBITS_API_KEY` needs no login at all. `EASYBITS_URL` points the CLI at
|
|
31
|
+
another server (default `https://www.easybits.cloud`; `baseUrl` in `~/.easybitsrc` works too).
|
|
29
32
|
|
|
30
33
|
## Commands
|
|
31
34
|
|
|
@@ -33,9 +36,10 @@ In CI and agents, `EASYBITS_API_KEY` needs no login at all.
|
|
|
33
36
|
# Sandboxes (alias: sb)
|
|
34
37
|
easybits sandboxes ls
|
|
35
38
|
easybits sandboxes create --template node --name scratch --dotenv .env
|
|
39
|
+
easybits sandboxes create --size m --timeout 1800 --no-wait # size s|m|l|xl (plan-gated)
|
|
36
40
|
easybits sandboxes get sb_abc123
|
|
37
41
|
easybits sandboxes exec sb_abc123 -- npm test
|
|
38
|
-
easybits sandboxes logs sb_abc123 --unit myapp --lines 100
|
|
42
|
+
easybits sandboxes logs sb_abc123 --unit myapp --lines 100 --since "10 min ago" --grep ERROR
|
|
39
43
|
easybits sandboxes files ls sb_abc123 /data/work
|
|
40
44
|
easybits sandboxes files read sb_abc123 /etc/os-release
|
|
41
45
|
easybits sandboxes files write sb_abc123 /data/work/app.js ./app.js
|
|
@@ -47,8 +51,8 @@ easybits sandboxes destroy sb_abc123 --yes
|
|
|
47
51
|
# Hosting: permanent machines (alias: deploy)
|
|
48
52
|
easybits machines ls
|
|
49
53
|
easybits machines deploy sb_abc123 -m "v1.2"
|
|
50
|
-
easybits machines releases sb_abc123
|
|
51
|
-
easybits machines logs sb_abc123 --grep ERROR
|
|
54
|
+
easybits machines releases sb_abc123 --limit 5
|
|
55
|
+
easybits machines logs sb_abc123 --lines 100 --grep ERROR
|
|
52
56
|
easybits machines rollback sb_abc123 rel_789
|
|
53
57
|
easybits machines secrets ls sb_abc123
|
|
54
58
|
easybits machines secrets set sb_abc123 --dotenv .env.production # - reads stdin
|
|
@@ -72,6 +76,7 @@ easybits db rm leads --yes
|
|
|
72
76
|
easybits agents ls
|
|
73
77
|
easybits agents create --template goose --name helper --dotenv .env
|
|
74
78
|
easybits agents message ag_123 "hello"
|
|
79
|
+
easybits agents message ag_123 "and now?" --session ses_456 # continue a conversation
|
|
75
80
|
easybits agents destroy ag_123 --yes
|
|
76
81
|
|
|
77
82
|
# Files, websites, account
|
|
@@ -79,6 +84,7 @@ easybits files ls
|
|
|
79
84
|
easybits files upload ./report.pdf
|
|
80
85
|
easybits files delete FILE_ID --yes
|
|
81
86
|
easybits websites ls
|
|
87
|
+
easybits providers # storage provider (Tigris by default)
|
|
82
88
|
easybits usage
|
|
83
89
|
|
|
84
90
|
# MCP, SSH, docs
|
|
@@ -86,6 +92,7 @@ easybits config # MCP config (streamable HTTP)
|
|
|
86
92
|
easybits mcp # MCP config (stdio)
|
|
87
93
|
easybits ssh-key # public key for sandbox SSH
|
|
88
94
|
easybits docs cli # a docs section as markdown (--en for English)
|
|
95
|
+
easybits docs --open # open the docs in your browser
|
|
89
96
|
```
|
|
90
97
|
|
|
91
98
|
Every command has help with examples: `easybits <command> <subcommand> --help`
|
|
@@ -94,7 +101,7 @@ Every command has help with examples: `easybits <command> <subcommand> --help`
|
|
|
94
101
|
**Destructive commands** (`db rm`, `agents destroy`, `sandboxes destroy`, `domains rm`,
|
|
95
102
|
`files delete`) ask before acting in a terminal: `[y/N]`, or typing the name/id for
|
|
96
103
|
irreversible ones (a database, an agent, a permanent sandbox). Without a terminal they
|
|
97
|
-
never prompt
|
|
104
|
+
never prompt — and neither do they with `--json`: pass `--yes` / `-y`, or they exit `2`.
|
|
98
105
|
|
|
99
106
|
**Secrets** go in a dotenv file or on stdin, never in argv (visible in `ps` and shell
|
|
100
107
|
history): `--dotenv <path>` (`KEY=VALUE` lines, `-` = stdin) on `sandboxes create|exec|resume`,
|
|
@@ -116,12 +123,18 @@ Host *.ghosty
|
|
|
116
123
|
- `--json`: stdout is JSON only, errors included: `{"error":"…","code":3,"hint":"…"}` (`code` = exit code).
|
|
117
124
|
- Exit codes: `0` ok · `1` API error · `2` usage error · `3` no session, expired or rejected.
|
|
118
125
|
- Login for a person: `easybits login --json` prints `{"event":"login_url","url":…}` first (show it to them), then `{"event":"logged_in","email":…}`.
|
|
119
|
-
- Destructive commands need `--yes` (no TTY means no prompt: exit `2` with the exact command to rerun).
|
|
126
|
+
- Destructive commands need `--yes`, also with `--json` (no TTY or `--json` means no prompt: exit `2` with the exact command to rerun).
|
|
120
127
|
- `sandboxes exec` without `--json` exits with the remote command's code; with `--json` it exits 0 and reports `exitCode`.
|
|
121
128
|
- Skill: `npx skills add https://easybits.cloud` (includes `easybits-cli`).
|
|
122
129
|
|
|
123
130
|
Full reference: https://www.easybits.cloud/docs#cli · https://www.easybits.cloud/en/docs/cli.md
|
|
124
131
|
|
|
132
|
+
## Changes in 0.6.1
|
|
133
|
+
|
|
134
|
+
- Help: `--yes` is no longer listed as a global flag; it lives on each destructive command
|
|
135
|
+
(and the global help says it is required without a terminal or with `--json`).
|
|
136
|
+
- `easybits init` suggests `machines secrets set <id> --dotenv …` instead of `KEY=VALUE` in argv.
|
|
137
|
+
|
|
125
138
|
## Changes in 0.6.0
|
|
126
139
|
|
|
127
140
|
- **Breaking for scripts:** `db rm`, `agents destroy`, `sandboxes destroy`, `domains rm` and
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ var KIND_HINTS = {
|
|
|
59
59
|
SandboxHostTimeout: "The operation may still be running. Check `easybits sb get <id>` and retry in a few minutes.",
|
|
60
60
|
SandboxHostError: "The sandbox host failed. Retry; if it persists, contact support.",
|
|
61
61
|
SQL_ERROR: "Fix the SQL statement.",
|
|
62
|
-
DATABASE_STORAGE_MISSING: "This database has no storage; its data is unavailable. Delete it (easybits db rm) and create a new one.",
|
|
62
|
+
DATABASE_STORAGE_MISSING: "This database has no storage; its data is unavailable. Delete it (easybits db rm <db> --yes) and create a new one.",
|
|
63
63
|
DATABASE_BACKEND_ERROR: "The database backend failed. Retry in a moment."
|
|
64
64
|
};
|
|
65
65
|
function toCliError(err) {
|
|
@@ -573,7 +573,7 @@ import { basename, extname } from "path";
|
|
|
573
573
|
// src/prompt.ts
|
|
574
574
|
import { createInterface } from "readline/promises";
|
|
575
575
|
var YES_OPTION = {
|
|
576
|
-
yes: { type: "boolean", short: "y", description: "Skip the confirmation (required without a terminal)" }
|
|
576
|
+
yes: { type: "boolean", short: "y", description: "Skip the confirmation (required without a terminal or with --json)" }
|
|
577
577
|
};
|
|
578
578
|
function sameCommand() {
|
|
579
579
|
const argv2 = process.argv.slice(2).map((a) => /^[\w@%+=:,./-]+$/.test(a) ? a : `'${a.replace(/'/g, `'\\''`)}'`);
|
|
@@ -877,7 +877,7 @@ One-time setup left:
|
|
|
877
877
|
|
|
878
878
|
3. If your app uses secret env vars:
|
|
879
879
|
|
|
880
|
-
easybits machines secrets set SANDBOX_ID
|
|
880
|
+
easybits machines secrets set SANDBOX_ID --dotenv .env.production
|
|
881
881
|
|
|
882
882
|
From then on, every push to main deploys.`));
|
|
883
883
|
}
|
|
@@ -1767,10 +1767,14 @@ ${hits.map((h) => ` ${prefix}${h}`).join("\n")}`;
|
|
|
1767
1767
|
var GLOBAL_FLAGS = `Global flags:
|
|
1768
1768
|
--json Machine output: JSON on stdout, errors included
|
|
1769
1769
|
--token <key> API key for this call (prefer EASYBITS_API_KEY: argv leaks to ps)
|
|
1770
|
-
-y, --yes On rm/destroy: skip the confirmation (required without a TTY)
|
|
1771
1770
|
-h, --help Help (also: easybits <command> --help)
|
|
1772
1771
|
-v, --version Print the CLI version
|
|
1773
1772
|
|
|
1773
|
+
Deletes (sandboxes destroy, agents destroy, db rm, domains rm, files delete) ask first;
|
|
1774
|
+
without a terminal or with --json pass -y/--yes, or they exit 2.
|
|
1775
|
+
|
|
1776
|
+
Env: EASYBITS_API_KEY (API key), EASYBITS_URL (API server, default https://www.easybits.cloud)
|
|
1777
|
+
|
|
1774
1778
|
Exit codes: 0 ok, 1 API error, 2 usage error, 3 not logged in or bad key`;
|
|
1775
1779
|
var COL = 17;
|
|
1776
1780
|
function globalHelp(version) {
|
|
@@ -1826,7 +1830,7 @@ var BANNER = " \x1B[38;2;244;245;251m\u2860\u2812\u2812\u28E4\x1B[38;
|
|
|
1826
1830
|
|
|
1827
1831
|
// src/index.ts
|
|
1828
1832
|
import { EasybitsError as EasybitsError2 } from "@easybits.cloud/sdk";
|
|
1829
|
-
var VERSION = true ? "0.6.
|
|
1833
|
+
var VERSION = true ? "0.6.1" : "dev";
|
|
1830
1834
|
var GLOBAL_OPTIONS = {
|
|
1831
1835
|
json: { type: "boolean" },
|
|
1832
1836
|
token: { type: "string" },
|
package/package.json
CHANGED