@backifydev/cli 0.4.3 → 0.4.5

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
@@ -12,7 +12,8 @@ Some steps must be done by a person in the browser under their own Backify permi
12
12
  backify signup # without an account: sign up, choose a plan and approve this CLI's access
13
13
  backify github connect # install or choose the Backify GitHub App
14
14
  backify azure connect --subscription <id> --region swedencentral
15
- backify azure reconnect|update-agent|uninstall|remove --connection <cloud-connection-id>
15
+ backify azure reconnect|update-runtime|uninstall|remove --connection <cloud-connection-id>
16
+ backify azure runtime-upgrade --connection <cloud-connection-id> [--json] # phase, versions, verification, canary outcome, end state
16
17
  backify task start approval --set approvalId=<id>
17
18
  backify task start confirm.destructive --set action=workspace.delete --set targetId=<workspace-id>
18
19
  backify task get|wait|open <task-id>
@@ -21,9 +22,11 @@ backify members add ada@example.com bo@example.com --app <application-id>="Appli
21
22
  backify members list --status invited | backify members invitations | backify members join-links | backify members domains
22
23
  ```
23
24
 
25
+ `update-runtime` approves the upgrade Backify proposed and verified: applications are not redeployed and the previous version is kept until the upgrade is committed. If an upgrade is already in progress it exits 0 and prints the current phase.
26
+
24
27
  These commands use the organization access from `backify login --organization <id> --organization-access`. `backify ops run` does the same automatically: when Backify answers `409 human_task_required` for an operation only a person may perform, it requests the named task with the identifiers from the request and waits. Use `--no-browser`, `--no-wait` and `--timeout <seconds>`, then resume with `backify task wait <task-id>`.
25
28
 
26
- Exit codes: 0 means the person completed the task, 2 means it is still waiting, and 1 means it was declined, expired or failed. The kinds are `github.install`, `azure.connect`, `azure.elevate`, `azure.agent_update`, `azure.uninstall`, `azure.remove`, `approval`, `sso.test_signin`, `entra.app_setup`, `entra.shared_consent`, `integration.adopt`, `integration.account`, `auth.setup`, `confirm.destructive`, `domain.confirm` and `signup`.
29
+ Exit codes: 0 means the person completed the task, 2 means it is still waiting, and 1 means it was declined, expired or failed. The kinds are `github.install`, `azure.connect`, `azure.elevate`, `azure.runtime_update`, `azure.uninstall`, `azure.remove`, `approval`, `sso.test_signin`, `entra.app_setup`, `entra.shared_consent`, `integration.adopt`, `integration.account`, `auth.setup`, `confirm.destructive`, `domain.confirm` and `signup`.
27
30
 
28
31
  Payment and plan changes after signup stay in the portal; `backify billing` shows the status.
29
32
 
@@ -43,7 +46,7 @@ Use `--no-browser` to open the printed review URL manually, `--no-wait` to retur
43
46
  backify domains connect app.example.com --environment production
44
47
  ```
45
48
 
46
- Requests a Backify task and opens its page at `/tasks/<task-id>`, where an authorized domain manager signs in and confirms the hostname and environment; omit either to choose on the page. The command returns as soon as the domain is confirmed (exit code 0, `confirmed: true`) with the expected `https://<hostname>` and what happens next. It does not wait for DNS: after the user adds the records shown on the page, Backify verifies them automatically, issues managed HTTPS and starts routing. Use `--no-browser`, `--no-wait` or `--timeout <seconds>`, and read the current status with `backify domains connect --request TASK_UUID`. Exit code 2 means not yet confirmed or blocked. The CLI never changes DNS or approves the domain itself.
49
+ Requests a Backify task and opens its page at `/tasks/<task-id>`, where an authorized domain manager signs in and confirms the hostname and environment; omit either to choose on the page. `--environment` accepts one of the application's activated environments (`backify environments` lists them in release order: prototype, preview, production). The command returns as soon as the domain is confirmed (exit code 0, `confirmed: true`) with the expected `https://<hostname>` and what happens next. It does not wait for DNS: after the user adds the records shown on the page, Backify verifies them automatically, issues managed HTTPS and starts routing. Use `--no-browser`, `--no-wait` or `--timeout <seconds>`, and read the current status with `backify domains connect --request TASK_UUID`. Exit code 2 means not yet confirmed or blocked. The CLI never changes DNS or approves the domain itself.
47
50
 
48
51
  ## Coding-tool MCP bridge
49
52
 
@@ -138,6 +141,68 @@ Local secret values go in `.backify/secrets.local.json` (`{ "NAME": "value" }`);
138
141
  A public POST/PUT/PATCH/DELETE route produces a warning. `backify lock --check` and `backify check` fail when the committed lockfile no longer matches the code; `check` first runs the app's `typecheck`, `lint`, `test` and `build` scripts (`--lockfile-only` skips them).
139
142
 
140
143
 
144
+ ## Reading stored logs
145
+
146
+ ```sh
147
+ backify logs history --environment <prototype|preview|production|UUID> [--stream console|system|audit] [--since <30m|24h|7d> | --from <ISO> --to <ISO>] [--contains <text>] [--limit <n>] [--all] [--json] [--app <application>]
148
+ ```
149
+
150
+ Reads logs stored in the environment's hosting. An environment kind is resolved to its ID through `backify environments`; it must be activated. The default is the console stream for the last hour with 200 lines per page (`--limit` takes 1 to 1000). Use `--since` or an explicit `--from`/`--to`, not both. Lines print oldest first, followed by a line for lines dropped because the environment went over its daily log budget and one for the earliest entry still stored, when they apply. `--all` follows older pages up to 20 and says so when that cap is reached. `--json` prints the merged API result. Unknown options are errors. Reading history is recorded in the audit log. A 409 means the environment has no stored logs or its hosting is not reachable.
151
+
152
+ ## Environments and the release flow
153
+
154
+ ```sh
155
+ backify environments
156
+ backify environments add <preview|prototype> [--yes]
157
+ backify environments remove <preview|prototype> --confirm <application-slug>
158
+ backify environments placement
159
+ backify environments placement <environment> --target <deployment-target-id|default> [--check] [--yes]
160
+ backify environments move <environment> --target <deployment-target-id> --window-start <ISO> --window-end <ISO> [--check] [--yes]
161
+ backify environments move status <environment>
162
+ backify environments move start|abort <environment> [--yes]
163
+ backify environments move confirm <environment> --active <deployment-target-id> [--yes]
164
+ backify environments move-back <environment> --window-start <ISO> --window-end <ISO> --confirm <application-slug>
165
+ backify release-flow [--json]
166
+ backify promote [--tested] [--yes]
167
+ backify hosting [--json]
168
+ backify rollback <deployment-id> [--yes]
169
+ ```
170
+
171
+ An application always has production; preview and prototype are optional, usage-billed environments. Releases move prototype -> preview -> production through the activated environments only. `environments` lists every kind in release order with its state, hostname and billing. `environments add` prints the billing and hostname and asks y/N on a terminal; without a terminal it needs `--yes`. `environments remove` takes the environment offline and removes it from the release flow; its database, files, secrets and configuration are kept and adding it again restores them. It requires `--confirm <application-slug>` and is refused without it. Production cannot be added or removed.
172
+
173
+ `release-flow` shows each activated environment's current release, its checks (passed, failed, running, waiting, skipped, pending) with durations and details, and the promotion to the next environment with what blocks it. `promote` promotes the earliest stage whose promotion is ready to the next activated environment. When the promotion is blocked it reports `blockedBy` and exits 2 without calling the promote API. A promotion into production names the application, release commit and target and needs confirmation (y/N, or `--yes` without a terminal); `--tested` confirms you tested the release when the publish rules require it. `environments move` moves an environment that already has data to another hosting target in a maintenance window of 15 minutes to 24 hours that starts within 30 days. It runs the checks and exits 2 without changing anything if one fails (`--check` only checks), then requests the move, which another person approves on the organization's Approvals page. `move status` shows the current or latest move with phase, state, window, approval, verification and what is retained. `move start` puts the environment into maintenance for the window, `move abort` returns it to its current hosting, and `move confirm` is only for a move whose switch outcome is unknown: name the target you checked is serving. Each is refused with a clear message when the move does not offer that action, and asks y/N on a terminal or needs `--yes`. `environments move-back` requests moving an environment back to the hosting target its latest completed move left, while that target still keeps its copy (30 days by default); the copy is reused and checked, the move needs approval like any other, and it is confirmed with the application slug. It is refused by name when the copy is no longer kept or was removed, the environment runs another release than it moved with, a handoff or another move is under way, or the environment has moved since.
174
+
175
+ `environments placement` also shows where each workload of the live release runs (static files, web, worker, migrations on static serving or Consumption), the regional foundation (shared, dedicated, private or adopted, and whether production and non-production run apart) and, when the live release cannot run on the target, why. Failed checks print their message and code; `--json` passes `workloads`, `workloadConformance` and `foundation` through.
176
+
177
+ `hosting` shows the target, environments and infrastructure resources. A stateful resource that is no longer declared is marked `KEPT since <time>`: it stays with its data until a separately authorized deletion, and the command never deletes it (`--json` carries `retainedAt`). `rollback <deployment-id>` rolls production back after a y/N prompt or `--yes`. A rollback restores compatible web revisions and worker configuration only; it never restores or rewinds the database, so restore a backup separately. The prompt, the result and `--json` (`databaseRecovery: "separate"`, `notice`) all say so.
178
+
179
+ All commands take `--app <application>` and `--json`; with `--json`, refusals report `code` (for example `confirmation_required` or `testing_required`). The same operations are available in the portal and the Backify MCP.
180
+
181
+ ## Where sign-in data lives
182
+
183
+ ```sh
184
+ backify auth identity [--app <application>] [--json]
185
+ backify auth identity move --environment <name|id> --confirm <application-slug> [--app <application>] [--json]
186
+ ```
187
+
188
+ An application's users, roles, passkeys and sessions live either with Backify or in each environment's own database. `auth identity` shows, per environment, where they live, how many role or session changes are still waiting for the environment's Runtime (usually applied within about 30 seconds, and kept waiting while the Runtime is unreachable) and whether the latest move is running or failed, with the reason. `auth identity move` moves one environment's sign-in data into its own database; it needs permission to manage access. While the data is moved, sign-in for that environment and user management for the application pause. It cannot be moved back. Afterwards, sign-in for the environment keeps working if Backify is unavailable. The command changes nothing until `--confirm` equals the application slug (without it, it prints the slug and the consequences and exits 1 with `code: "confirmation_required"`), refuses an environment that is already moved or moving, returns once the move has started and does not wait; run `auth identity` again to follow it. With `--json`, refusals report `code`. The same operations are available in the portal (Authentication, Sign-in setup) and the Backify MCP.
189
+
190
+ ## Handing an application over
191
+
192
+ ```sh
193
+ backify handoff [status]
194
+ backify handoff check
195
+ backify handoff request --confirm <application-slug>
196
+ backify handoff start|abort [--yes]
197
+ backify handoff package [--out <directory>]
198
+ backify handoff replacements
199
+ backify handoff replacements add --environment <name|id|kind> --kind <mail|ai|integration|auth-provider> --subject <subject> [--setting key=value ...] --secret-name <vault secret name> --consent
200
+ backify handoff replacements verify <id>
201
+ backify handoff replacements remove <id> [--yes]
202
+ ```
203
+
204
+ A handoff gives you the application to run independently in your own Azure and removes the access Backify holds. `status` shows the state, phase, what would be handed over, the hosts (TLS, DNS, health and who serves them), the steps only you can do and how far access removal has come (removed and verified). `check` runs the checks and lists what would be handed over; it exits 2 when the application cannot be handed off yet and names the failed checks. `request --confirm <application-slug>` runs the checks again and then requests the handoff, which another person approves on the organization's Approvals page; it never sends the request while a check fails. `start` begins an approved handoff (and resumes a stopped one) and `abort` stops it before it is delivered; each is refused when the handoff does not offer it and asks y/N on a terminal or needs `--yes`. `package` prints the handoff package manifest; with `--out` it writes every file under that directory, creates it, refuses a path that would leave it and checks each file's SHA-256 against the manifest, failing on a mismatch. Before the handoff, everything Backify hosts for the application (mail, AI, an integration credential, a sign-in provider's secret) needs your own replacement. `replacements` lists what is recorded with its state (waiting for check, verified, could not be verified and why); `replacements add` records one for an environment (its ID or kind) with the public settings as repeated `--setting key=value` (`port` is a number, AI deployments are `deployments.<model>=<deployment>`) and `--secret-name`, the name of the secret in your environment's vault. The secret itself is never accepted on the command line: store it in the vault and pass only its name; a `--secret`, `--password` or `--token` style flag is refused. Without `--consent`, `add` changes nothing, exits non-zero and says what consent means: that the secret and settings are yours and replace what Backify hosts. Your environment then checks the replacement; `verify` asks for a new check and `remove` (asks y/N or needs `--yes`) makes the dependency count as hosted by Backify again. Once a handoff is delivered, every change to the application in Backify is refused. With `--json`, refusals report `code`. The same operations are available in the portal (Settings, Hand over application).
205
+
141
206
  ## Connected delivery
142
207
 
143
208
  ```sh
@@ -169,7 +234,7 @@ Copy the application's setup prompt from Backify. It contains only the public ap
169
234
 
170
235
  `pull` checks the connected application, repository, branch, and repository root, then fetches GitHub using a short-lived scoped credential. It fast-forwards only a clean, non-diverged branch. Incoming updates blocked by local changes, untracked files, or diverged history return a blocked result and a nonzero exit code; nothing is stashed, reset, rebased, or force-pushed. Connecting an existing repository runs this update automatically, and the agent guide requires it before editing each new user request. It is not a background watcher.
171
236
 
172
- `ship` runs configured checks, verifies the repository/branch, and pushes already-committed source using a short-lived repository-scoped GitHub App credential. It never stages, commits, force-pushes, or fabricates preview testing. By default it waits for the exact healthy preview and returns its URL without requesting production publication. Plain requests such as “Now deploy” and approval to merge and retry remain preview-only; production requires an explicit user request to deploy to production. Instruction version 10 (CLI 0.3.12) makes this distinction explicit in installed guidance. Promote the preview in the portal, or explicitly run `ship --production-deploy` to request publication through existing policy and permissions. Required testing/approval returns a pending state and preview URL, not a false successful production deployment. The legacy `--preview-only` flag remains supported but cannot be combined with `--production-deploy`. Use `--timeout <seconds>` to change the default 1200-second wait. Applications must currently be at the repository root. CI checks the committed lockfile, builds and verifies one image, then uploads a release. The web role serves port 8080; web apps also upload a static frontend. Local Docker is not required for backify dev.
237
+ `ship` runs configured checks, verifies the repository/branch, and pushes already-committed source using a short-lived repository-scoped GitHub App credential. It never stages, commits, force-pushes, or fabricates testing. By default it waits for the exact healthy release in the application's earliest activated environment (prototype, then preview, then production) and returns its `environment` and URL. When production is the application's only environment, a plain `ship` therefore deploys to production; check `backify environments` and tell the user where the release lands before shipping. `ship --production-deploy` is the explicit request to go all the way to production: it promotes the release one activated environment at a time and applies the publish rules on the step into production (required testing, approval and organization policies) through existing permissions. Required testing, approval or a blocked promotion returns a pending state (`testing-required`, `awaiting-approval`, `promotion-blocked` with `blockedBy`) and the URL of the environment the release reached, not a false successful production deployment. `--preview-only` stops after the first environment and cannot be combined with `--production-deploy`. `--dry-run` lists the push, checks, the release flow, the entry environment and the planned promotions without side effects. Use `--timeout <seconds>` to change the default 1200-second wait. Applications must currently be at the repository root. CI checks the committed lockfile, builds and verifies one image, then uploads a release. The web role serves port 8080; web apps also upload a static frontend. Local Docker is not required for backify dev.
173
238
 
174
239
  `workflow refresh` brings the repository's Backify build workflow up to date. A connected repository keeps the workflow it received when it was connected; after a Backify update changes that workflow, or when a build fails in a workflow step your code does not control, run it from the application folder. Backify regenerates the workflow and commits it to the connected branch only when the repository's copy differs. The result's `changed` says whether it committed; when it did, run `pull` before the next push. It needs permission to manage the application's source.
175
240