@lizard-build/cli 4.0.58 → 4.0.60

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.
@@ -230,6 +230,17 @@ lizard billing --json # plan, trial, usage this month, Bil
230
230
 
231
231
  There is no shell into a running service (`lizard ssh` answers 403); for a sandbox use `lizard sandbox exec`. Metrics options and `lizard run` in detail: `lizard skills get core --ref deploys --json`.
232
232
 
233
+ ## Lizard Git
234
+
235
+ Lizard Git (git.lizard.build) hosts repositories with issues, pull requests, reviews, CI (`.lizard/workflows/*.yml`, GitHub Actions syntax), releases and webhooks. `lizard git ...` signs in with the same Lizard login; a scoped API key is refused there. Commands take `-R owner/name` (or just `name` for yours) and otherwise use the Lizard Git remote of the current checkout.
236
+
237
+ - **Repos**: `lizard git repo create <name> --private [--readme] --json`, `repo list|view|edit|delete --yes|fork|star`. Plain git: `lizard git setup` (credential helper, once), then `lizard git clone <repo>` or `git push`. `lizard git whoami` shows the Lizard Git login.
238
+ - **Without a clone**: `lizard git ls [path] [-r]`, `cat <path> [--ref]`, `log`, `show <sha>`, `search <text>`, `commit -m <msg> -a <file[:path]> [--delete <path>] [-b <branch>] [--expect <sha>]` (server-side commit; `--expect` fails with 409 if the branch moved), `land <head> --onto main`, `branch list|create|delete`.
239
+ - **Issues / PRs**: `lizard git issue create -t <title> -b <body> [-l label] [-a login]`, `issue list|view|comment|edit|close|reopen`. `lizard git pr create -t <title> [-H branch] [-B base] [--draft] [-r reviewer]` (head defaults to the current branch), `pr view|diff|commits|checks [--watch]|review --approve|--request-changes|--comment [--line path:line=text]|ready|merge [--squash|--rebase] [-d]|checkout|close`. You can't approve your own PR. `Fixes #N` in a merged PR closes the issue.
240
+ - **CI**: `lizard git run list|view <n>|logs <n> [-f] [-j job]|watch <n>|cancel|rerun|approve|artifacts <n>|download <n> <name> [-x dir]`, `workflow list`, `workflow run ci.yml -f key=value [--watch]` (needs `on: workflow_dispatch`). Secrets: `lizard git secret set NAME` (value from stdin or `-b`), `secret list|delete`. `run watch` and `pr checks` exit `1` when something failed.
241
+ - **Admin**: `lizard git protect set main --require-pr --approvals 1 --checks ci/test --block-force-push [--enforce-admins]`, `protect list|delete`; `collaborator add <login> --role read|write|admin` (they accept with `lizard git invitation accept <id>`), `collaborator list|role|remove`; `webhook create <url> -e push,pull_request --secret s`, `webhook list|edit|ping|deliveries|redeliver|delete`; `label ...`; `release create v1.0.0 -t <title> -n <notes> -a <file>`, `release list|view|edit|upload|download|delete`; `commit-status set <sha> -s success -c <context>`; `notification list|read`; `token create <name> [--repo r] [--read-only]` (a limited lzg_ token; use it as `LIZARD_GIT_TOKEN` or the git password).
242
+ - From code, the SDK has the same: `lizard.git.repos`, `.issues`, `.pulls`, `.actions`, `.releases`, ... (see the `sdk` reference).
243
+
233
244
  ## Response format
234
245
 
235
246
  After an operation, return:
@@ -77,7 +77,7 @@ lizard sandbox files rm <id> <path>
77
77
 
78
78
  Prices are per hour, billed per second while the sandbox runs, flat by size: measured CPU/RAM is not charged, and disk and egress are included. A paused sandbox costs nothing. Attached volumes bill separately. `--size` cannot be combined with `--snapshot`: a snapshot restores at the size it was captured at (see [private snapshots](#snapshots-and-pauseresume)).
79
79
 
80
- Sandboxes run as Firecracker microVMs, each with its own kernel. A sandbox that attaches an existing pod-backed volume, or restores an older pod snapshot, runs as a Kubernetes pod instead; a Firecracker start that fails without a volume also falls back to a pod. The create JSON's `runtime` says which.
80
+ Lizard Sandboxes run as Firecracker microVMs, each with its own kernel. If a sandbox cannot start, creation fails with an error.
81
81
 
82
82
  An account runs at most 5 sandboxes at once on a trial and 100 after its first paid invoice (paused ones don't count), with limits on starts per minute, hour and day. Enterprise accounts have a cap per workspace instead (50 by default). Over a limit the API answers 429 `SANDBOX_LIMIT_REACHED` or `SANDBOX_RATE_LIMITED` (with `retryAfterS`).
83
83
 
@@ -158,12 +158,12 @@ lizard sandbox create --volume <name> # attach at create
158
158
 
159
159
  A volume attaches to one sandbox at a time (409 `Volume is already attached to another sandbox`); a paused sandbox keeps its volume. A workspace holds 200 GB of volumes by default (`volume_quota_exceeded`). For a deployed service's volume, see `lizard volume create <name> --service <svc>` in the core guide.
160
160
 
161
- `volume resize` is online: an attached sandbox keeps running, and its `/workspace` shows the new size right away. A volume grown while detached gets the new size when a sandbox next mounts it. Firecracker volumes (the default) only grow; asking for less fails with `volume_shrink_unsupported`. A Kubernetes volume can also shrink if at least 10% of the new size stays free (`volume_too_full_to_shrink` otherwise). The size limit (`volume_too_large`) and the workspace's volume quota apply as at create. `The volume is not ready` (HTTP 409) right after create means retry in a few seconds.
161
+ `volume resize` is online: an attached sandbox keeps running, and its `/workspace` shows the new size right away. A volume grown while detached gets the new size when a sandbox next mounts it. A volume grows but does not shrink: asking for less fails with `volume_shrink_unsupported`. Older volumes are the exception: they can shrink if at least 10% of the new size stays free (`volume_too_full_to_shrink` otherwise). The size limit (`volume_too_large`) and the workspace's volume quota apply as at create. `The volume is not ready` (HTTP 409) right after create means retry in a few seconds.
162
162
 
163
163
  ## Snapshots and pause/resume
164
164
 
165
165
  - `lizard sandbox snapshot <sandbox-id> --name my-app` saves files and running memory. You and the members of its project can list, restore and delete it; only you change its scope. By default it restores into any of your projects and workspaces; `--scope workspace` keeps it to the sandbox's workspace and `--scope project` to its project, and `sandbox snapshot-scope <id> <user|workspace|project>` changes that later. A Firecracker snapshot is ready as soon as the capture ends; the command waits until ready; `--no-wait` returns the queued capture.
166
- - `lizard sandbox restore <snapshot-id> [--project <project>] [--timeout <ms>]` starts a new sandbox from it (five-minute lifetime by default), in the snapshot's project unless `--project` names another. `--volume <volume>` mounts a volume at `/workspace` in the restored sandbox (Firecracker snapshots of a sandbox that had no volume attached; the volume must be in the snapshot's region). `sandbox create --snapshot <id> --project <project> [--volume <volume>]` also works. Restores stay in the snapshot's region. A Firecracker snapshot restores at its source's size and bills flat at that size; a pod snapshot runs on the machine it was captured on and bills by measured usage. `--size` with `--snapshot` is an error.
166
+ - `lizard sandbox restore <snapshot-id> [--project <project>] [--timeout <ms>]` starts a new sandbox from it (five-minute lifetime by default), in the snapshot's project unless `--project` names another. `--volume <volume>` mounts a volume at `/workspace` in the restored sandbox (Firecracker snapshots of a sandbox that had no volume attached; the volume must be in the snapshot's region). `sandbox create --snapshot <id> --project <project> [--volume <volume>]` also works. Restores stay in the snapshot's region. A snapshot restores at its source's size and bills flat at that size. `--size` with `--snapshot` is an error.
167
167
  - `lizard sandbox snapshots --project <project>` lists a project's snapshots; `--mine` lists every snapshot you took. `sandbox snapshot-rm <id>` deletes the snapshot; sandboxes already started from it keep running.
168
- - `lizard sandbox pause <id>` snapshots and stops a Firecracker VM (a pod sandbox is checkpointed with CRIU), stops billing, and freezes its remaining lifetime. `sandbox resume <id>` restores the same sandbox ID, files, processes, memory, published ports, and remaining lifetime. Resume is a cold restore. Both support `--no-wait`.
169
- - Disconnect clients and terminals and stop workspace writes before capturing or pausing. On a pod sandbox, active TCP connections and unsupported CRIU process state cause a clear failure. To reuse one snapshot across sandboxes that each keep their own data, snapshot a sandbox with no volume attached and pass `--volume` on each restore; a snapshot taken with a volume attached cannot take a different one.
168
+ - `lizard sandbox pause <id>` snapshots and stops a Firecracker VM, stops billing, and freezes its remaining lifetime. `sandbox resume <id>` restores the same sandbox ID, files, processes, memory, published ports, and remaining lifetime. Resume is a cold restore. Both support `--no-wait`.
169
+ - Disconnect clients and terminals and stop workspace writes before capturing or pausing. To reuse one snapshot across sandboxes that each keep their own data, snapshot a sandbox with no volume attached and pass `--volume` on each restore; a snapshot taken with a volume attached cannot take a different one.
@@ -15,6 +15,7 @@ Use Lizard SDK when the user's own code creates and drives sandboxes or manages
15
15
  - [Desktop (computer use)](#desktop-computer-use)
16
16
  - [Sandboxes for your own users](#sandboxes-for-your-own-users)
17
17
  - [Platform APIs](#platform-apis)
18
+ - [Lizard Git from code](#lizard-git-from-code)
18
19
  - [Billing from code](#billing-from-code)
19
20
  - [Errors](#errors)
20
21
 
@@ -207,6 +208,15 @@ Keep `project.id`: every user's project is named `default`, so the name is ambig
207
208
 
208
209
  The same client manages the rest of Lizard: `projects`, `services` (deploy, inspect, scale, run commands), `addons` (managed databases), `secrets`, `domains`, `storage` (S3 objects), `github`, `metrics`, `workspaces`, `apiKeys` / `api_keys`, `regions`, `billing` and `volumes`. `whoami()` returns the identity behind the key. `platform` is the raw HTTP client for endpoints without a method. A config change that saved but failed to deploy raises `ConfigApplyError`: read its `result` before retrying.
209
210
 
211
+ ## Lizard Git from code
212
+
213
+ `lizard.git` reaches Lizard Git (git.lizard.build) with the same key, which must have no scopes. Repositories are `"owner/name"`. Groups: `repos` (create, refs, tree, `file`, `raw`, `commits`, `commitFiles` / `commit_files` with `expect` and an idempotency key, `land`, `archive`, `cloneUrl`), `issues`, `pulls` (`create`, `ready`, `review`, `approve`, `lineComment`, `checks`, `merge`), `actions` (`runs`, `run`, `wait`, `fullLog`, `followLog`, `artifacts`, `downloadArtifact`, `dispatch`, `rerun`, `cancel`, `approve`; `actions.secrets`), `collaborators`, `webhooks`, `branchRules` / `branch_rules`, `labels`, `releases` (with `uploadAsset`), `statuses`, `notifications`, `tokens`. `me()` is the Lizard Git login. Set `LIZARD_GIT_URL` (or `gitUrl` / `git_url`) for another server.
214
+
215
+ ```ts
216
+ await lizard.git.repos.commitFiles('me/app', { branch: 'main', message: 'CI', files: [{ path: '.lizard/workflows/ci.yml', content: yaml }] })
217
+ const run = await lizard.git.actions.wait('me/app', (await lizard.git.actions.runs('me/app')).runs[0].number)
218
+ ```
219
+
210
220
  ## Billing from code
211
221
 
212
222
  `billing.subscription()` returns the plan, trial and this month's usage; `billing.startCheckout()` / `start_checkout()` returns a Stripe Checkout URL for the trial or Pro, which the user finishes in a browser. `startProNow`, `cancel` and `resume` change what the account pays: call them only when the account owner asks.