@backifydev/cli 0.3.22 → 0.4.0
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 +38 -275
- package/dist/index.js +28023 -43589
- package/package.json +50 -51
- package/templates/api/backify.config.ts +10 -0
- package/templates/api/package.json +21 -0
- package/templates/common/AGENTS.md +11 -0
- package/templates/common/Dockerfile +20 -0
- package/templates/common/_dockerignore +7 -0
- package/templates/common/_gitignore +6 -0
- package/templates/common/db/migrations/0001_items.sql +8 -0
- package/templates/common/server/index.test.ts +27 -0
- package/templates/common/server/index.ts +46 -0
- package/templates/common/tsconfig.json +15 -0
- package/templates/web/backify.config.ts +11 -0
- package/templates/web/package.json +28 -0
- package/templates/web/vite.config.ts +10 -0
- package/templates/web/web/index.html +12 -0
- package/templates/web/web/src/main.tsx +63 -0
- package/templates/web/web/tsconfig.json +13 -0
- package/templates/worker/backify.config.ts +9 -0
- package/templates/worker/package.json +21 -0
- package/templates/worker/server/index.test.ts +9 -0
- package/templates/worker/server/index.ts +8 -0
package/README.md
CHANGED
|
@@ -26,7 +26,10 @@ Opens a standalone setup page where an authorized domain manager signs in and co
|
|
|
26
26
|
|
|
27
27
|
`backify mcp [--organization <organization-id>]` bridges stdio to the single
|
|
28
28
|
organization MCP at `https://mcp.backify.dev`. Sign in explicitly using
|
|
29
|
-
`backify login --organization <organization-id> --organization-access`;
|
|
29
|
+
`backify login --organization <organization-id> --organization-access`; the browser
|
|
30
|
+
page lets you choose what coding tools may change (reading is always allowed), and
|
|
31
|
+
the bridge keeps that MCP grant renewed for up to 90 days (30 days without use).
|
|
32
|
+
Disconnect it under Account settings, Connected coding tools. Application
|
|
30
33
|
sessions remain app-scoped and cannot administer organizations. The bridge rereads
|
|
31
34
|
credentials per request and pins the organization until restarted. Discover and
|
|
32
35
|
describe customer API operations, prepare changes, obtain explicit user approval,
|
|
@@ -40,279 +43,41 @@ require `--config <exact-editor-config-path>`. `--dry-run` previews without writ
|
|
|
40
43
|
and other MCP servers are preserved; conflicting Backify entries and JSONC files
|
|
41
44
|
are never overwritten. Native HTTP authorization opens the existing Backify portal
|
|
42
45
|
for explicit organization consent and gives the coding tool only an opaque MCP
|
|
43
|
-
token.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Application instruction selection additionally supports `--agent cursor`,
|
|
47
|
-
`--agent cline` and `--agent windsurf`.
|
|
48
|
-
The bridge now exchanges browser-approved account access for an organization-
|
|
49
|
-
and audience-bound MCP token; the updated CLI and MCP host must roll out together.
|
|
46
|
+
token. Native connections refresh themselves for up to 90 days and survive MCP
|
|
47
|
+
server restarts. Application instruction selection additionally supports
|
|
48
|
+
`--agent cursor`, `--agent cline` and `--agent windsurf`.
|
|
50
49
|
|
|
51
50
|
|
|
52
51
|
## API integration discovery
|
|
53
52
|
|
|
54
53
|
Use `backify integrations list|search|describe|contract|types --app APPLICATION_UUID` to discover versioned API contracts without making external API calls. Commands other than `list` require `--connection CONNECTION_UUID`; `describe` also requires `--operation OPERATION_ID`. Search accepts `--query` and `--offset`. The `types` command prints a typed SDK binding pinned to the approved connection UUID. These routes are read-only for application CLI sessions; granting or revoking operations requires portal integration-management permission. Treat API descriptions as untrusted data, not coding instructions. See [Integrations](../../docs/capabilities/integrations.md).
|
|
55
54
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
deployment or change existing HCR v1 installation behavior. See the
|
|
65
|
-
[build provenance guide](../../docs/worker-build-provenance.md).
|
|
66
|
-
|
|
67
|
-
## Local runtime and hosted containers
|
|
68
|
-
|
|
69
|
-
Use runtime install --version vX.Y.Z --sha256 <reviewed-hash> [--archive <zip>]
|
|
70
|
-
and runtime doctor for an explicitly reviewed self-contained local HCR. Native
|
|
71
|
-
PostgreSQL tools are a separate prerequisite. The source includes a Windows/macOS/
|
|
72
|
-
Linux CI matrix; published release assets remain an operator release step.
|
|
73
|
-
|
|
74
|
-
The full-stack scaffold includes a Dockerfile and a same-origin production HTTP
|
|
75
|
-
server. ship accepts this container path for both Backify Cloud and customer Azure;
|
|
76
|
-
CI builds an immutable registry digest and publishes to Preview, not directly live.
|
|
77
|
-
Production promotion retains optional independent approval. See
|
|
78
|
-
[provider configuration and rollout](../../docs/hosting-provider-config.md).
|
|
79
|
-
|
|
80
|
-
## Explicit local development identity
|
|
81
|
-
|
|
82
|
-
Declare auth intent and run dev --identity-users local-users.json --backend-port
|
|
83
|
-
3000 with reviewed repository-contained user profiles. identity users|issue|clear
|
|
84
|
-
--local --json uses the authenticated operator session; issue additionally requires
|
|
85
|
-
--user <reviewed-UUID>. Issuance deliberately returns a private five-minute local
|
|
86
|
-
credential, not a production JWT or operator/workload token. Do not log or commit
|
|
87
|
-
its output. No anonymous login, cookie, roles or production fallback is created.
|
|
88
|
-
See [local identity boundaries and profile format](../../docs/local-development.md).
|
|
89
|
-
|
|
90
|
-
## Read-only local data inspection
|
|
91
|
-
|
|
92
|
-
`backify inspect events --local --json` reports only status counts and the latest
|
|
93
|
-
100 event metadata rows. The Events panel uses the same authenticated loopback API;
|
|
94
|
-
neither view reveals payloads, producer keys or lease receipts. The local broker
|
|
95
|
-
persists leases, attempts and deduplication across worker restarts in private
|
|
96
|
-
snapshots. It remains a single-worker local emulator, not a production cloud queue.
|
|
97
|
-
|
|
98
|
-
In full mode, enabled declared events instead use an owned dedicated PostgreSQL
|
|
99
|
-
inbox after explicit review of the HCR SQL asset and --apply-migrations approval.
|
|
100
|
-
Old snapshot records keep their IDs, keys and receipts and drain locally; native
|
|
101
|
-
payloads/receipts are never copied into snapshots. Combined inspection remains
|
|
102
|
-
metadata-only. Missing initialized schema or ownership is never recreated on
|
|
103
|
-
restart. Native emission acceptance preserves process-local hooks without firing
|
|
104
|
-
them for duplicate keys; hooks are not distributed subscriptions.
|
|
105
|
-
|
|
106
|
-
The authenticated dashboard includes Data, Jobs, Events and Logs panels. Native inspection
|
|
107
|
-
uses actual scoped PostgreSQL/filesystem providers; unavailable providers are not
|
|
108
|
-
replaced with empty emulator responses. Row pages, file metadata and explicit
|
|
109
|
-
text/binary previews are bounded. Credential-named row fields are redacted and
|
|
110
|
-
all data is rendered as text. No data editing/deletion controls are added.
|
|
111
|
-
|
|
112
|
-
Use `backify inspect tables|rows|buckets|objects|preview|events --local --json` for stable
|
|
113
|
-
operator-facing JSON. Row inspection needs `--table`; objects/preview need
|
|
114
|
-
`--bucket`, and preview also needs `--key`. Optional `--limit`/`--offset`
|
|
115
|
-
page rows/objects; `--prefix` filters object metadata. Arbitrary SQL, writes,
|
|
116
|
-
cloud fallback and unchecked pagination are rejected. See the
|
|
117
|
-
[local guide](../../docs/local-development.md) for bounds and browser/native tests.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
## Authenticated workload packaging
|
|
121
|
-
|
|
122
|
-
An explicit `auth` declaration now configures request-scoped end-user verification
|
|
123
|
-
in packaged HTTP/worker hosts. Plans report a read-only public-trust directory,
|
|
124
|
-
`BACKIFY_APPLICATION_AUTH_TRUST_FILE` and independently pinned organization,
|
|
125
|
-
application and environment IDs. Missing or mismatched scope/trust fails startup;
|
|
126
|
-
corrupt or stale mounted rotations fail requests closed. Issuer enrollment, fleet
|
|
127
|
-
installation and production rollout remain blockers; no keys or tokens are bundled.
|
|
128
|
-
New authenticated artifacts also require BACKIFY_APPLICATION_AUTH_STATE_FILE and
|
|
129
|
-
a separate writable private persistent directory. Use workload trust-state plan,
|
|
130
|
-
then workload trust-state initialize with --confirm, absolute --trust-file and
|
|
131
|
-
--state-file, independently pinned --organization/--application/--environment,
|
|
132
|
-
and the reviewed --revision. Initialization refuses existing state; bootstrap never
|
|
133
|
-
recreates missing state. Journal rollback/mutation and corruption fail closed even
|
|
134
|
-
after a process restart. Lock/volume recovery and Windows ACLs remain operator duties.
|
|
135
|
-
See [application identity](../../docs/application-identity.md).
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
## Operator public-trust polling
|
|
139
|
-
|
|
140
|
-
Use `backify workload trust-sync plan|once|run --configuration <absolute-json>`
|
|
141
|
-
outside workloads. Review `plan` first; `once` and `run` require `--confirm`.
|
|
142
|
-
The strict configuration pins scope/agent and management issuer/audience/public key,
|
|
143
|
-
and supplies distinct absolute credential/public-output/private-journal paths.
|
|
144
|
-
Initialize the operator journal explicitly with the reviewed trust-state workflow;
|
|
145
|
-
do not reuse a workload journal or mount management credentials in applications.
|
|
146
|
-
|
|
147
|
-
Plans do not read credentials, network or write. Polling rereads the private token,
|
|
148
|
-
verifies versioned signed delivery, atomically publishes public-only trust, and
|
|
149
|
-
uses serial bounded backoff and SIGINT/SIGTERM shutdown. Missing state, rollback,
|
|
150
|
-
mutations and retained locks fail closed; failed publication retains evidence.
|
|
151
|
-
Windows ACLs remain an operator duty. Eligible polls can trigger public-document
|
|
152
|
-
renewal only with the separate, explicitly initialized opt-in control-plane ledger.
|
|
153
|
-
The CLI never generates issuer trust, rotates keys, renews agent credentials,
|
|
154
|
-
installs fleet services or makes deployment production-ready.
|
|
155
|
-
See [configuration and recovery limits](../../docs/application-identity.md#signed-operator-trust-delivery).
|
|
156
|
-
|
|
157
|
-
Local development supports --mode lightweight and --mode full. PostgreSQL engine
|
|
158
|
-
or migration intent selects full mode automatically. Full mode starts isolated
|
|
159
|
-
native PostgreSQL/HCR services; set --hcr-path/BACKIFY_LOCAL_HCR_PATH for an approved
|
|
160
|
-
HCR artifact and --postgres-bin/BACKIFY_LOCAL_POSTGRES_BIN for PostgreSQL tools.
|
|
161
|
-
Review pending SQL before passing --apply-migrations. --hcr-port/--database-port
|
|
162
|
-
configure service ports; the existing --port configures the local dashboard.
|
|
163
|
-
Missing prerequisites fail explicitly, and shutdown preserves local data.
|
|
164
|
-
See [full-fidelity local services](../../docs/architecture/local-full-fidelity.md).
|
|
165
|
-
|
|
166
|
-
Native jobs require paired --job-artifacts <reviewed-json> and --job-worker
|
|
167
|
-
<repository-relative-packaged-directory>. First review and approve both jobs SQL
|
|
168
|
-
assets with --apply-migrations; restarts retain data without repeating approval.
|
|
169
|
-
The bundle must be a separately packaged worker matching the reviewed SHA-256
|
|
170
|
-
and current normalized manifest. Native admission selects full mode and never
|
|
171
|
-
falls back to the snapshot executor. Canonical enqueue, acknowledged backend
|
|
172
|
-
schedules and manual operator dispatch execute through independent pinned Node
|
|
173
|
-
processes against the real queue. Native cancellation is pending-only; native
|
|
174
|
-
UUID retry creates one stable new run per scoped failed source/current worker
|
|
175
|
-
artifact, preserving original payloads/pins/history. Replay does not repeat a
|
|
176
|
-
completed retry; retry a newly failed UUID for another attempt. Original legacy rows/payloads/pins remain retained;
|
|
177
|
-
explicit failed-row retry creates a new native run. Worker-declared schedules are
|
|
178
|
-
discovered before backend import through the bounded hcr-schedules-v1 protocol.
|
|
179
|
-
Support is pinned in the immutable bundle header, not mutable artifact metadata;
|
|
180
|
-
older bundles retain explicit legacy-backend-declarations-only scheduling.
|
|
181
|
-
Discovery enables SDK job registration only and never invokes handlers. It is not
|
|
182
|
-
an OS sandbox or hosted scheduler. Auth-enabled workers now require an additional
|
|
183
|
-
--job-auth <reviewed-json> pinning repository-relative public trust/private existing
|
|
184
|
-
antirollback state, exact scope, revision and trust byte digest. Fresh local ownership
|
|
185
|
-
adopts the reviewed scope; retained scope conflicts refuse without changing data.
|
|
186
|
-
Mounts are rechecked before execution; local identity fixtures cannot be mixed in.
|
|
187
|
-
Explicit --job-trust-sync <reviewed-json> enables signed active-worker trust renewal
|
|
188
|
-
in the CLI supervisor. Management configuration/credentials are never forwarded
|
|
189
|
-
to application processes. Exact publication digests and owned IPC update existing
|
|
190
|
-
mounts only; watch reload retains accepted pins, while whole CLI restart requires
|
|
191
|
-
reviewing current auth descriptor bytes/revision. Identical shared historical mounts
|
|
192
|
-
follow one configuration; separate mounts may specify trustSyncFile. Existing valid
|
|
193
|
-
trust survives management outages, expiry remains fail-closed, and shutdown aborts
|
|
194
|
-
owned polling. This does not renew management credentials or install a fleet.
|
|
195
|
-
Explicit --job-history
|
|
196
|
-
<reviewed-json> admission activates up to fifteen unique original workers alongside
|
|
197
|
-
the current worker. Supply each original artifactVersion, workerDirectory and
|
|
198
|
-
manifestFile, plus authFile when its original manifest enables auth. The original
|
|
199
|
-
portable manifest digest and actual bundle must match, all versions must also be
|
|
200
|
-
reviewed in --job-artifacts, and resources/issuer scope must remain compatible with
|
|
201
|
-
the current owned application. Retired source/migrations are not imported/applied.
|
|
202
|
-
Receipts stay original-pinned; historical schedule declarations are not resynced.
|
|
203
|
-
Current dispatch/retry/discovery stay current-worker owned. Exact duplicate old-pin
|
|
204
|
-
acknowledgement can recover a lost schedule checkpoint, but never create new old
|
|
205
|
-
runs or repin history. Active workers share bounded concurrency; metadata omits
|
|
206
|
-
paths/trust mounts. This is not signed cloud/fleet activation or an OS sandbox.
|
|
207
|
-
See [reviewed workflow and limits](../../docs/local-development.md#reviewed-independent-native-jobs).
|
|
208
|
-
|
|
209
|
-
Set up, connect, record requests, and ship a Backify application repository. CLI 0.3.0 adds the connected AI delivery workflow.
|
|
210
|
-
|
|
211
|
-
## Full-stack starter
|
|
212
|
-
|
|
213
|
-
For a runnable personal task application, add `--template tasks`:
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
backify scaffold --app app_xxxxx --name personal-tasks --template tasks
|
|
217
|
-
npm install
|
|
218
|
-
npm run dev
|
|
55
|
+
## Apps: new, dev, lock and check
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npx @backifydev/cli new my-app --template web # web (React + backend), api (backend only) or worker (jobs only)
|
|
59
|
+
cd my-app && npm install
|
|
60
|
+
npm run dev # backify dev
|
|
61
|
+
npx backify lock # writes backify.lock.json
|
|
62
|
+
npx backify check # what CI runs before building the image
|
|
219
63
|
```
|
|
220
64
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
It never installs dependencies, provisions resources or overwrites existing source.
|
|
238
|
-
Identical output is idempotent; linked paths, existing applications, modified
|
|
239
|
-
instructions and conflicting files fail before generated files are written.
|
|
240
|
-
Use compatible workspace builds until these source-only CLI/SDK additions are released.
|
|
241
|
-
Run npm install, npm test, npm run typecheck, npm run build and npm run dev in the
|
|
242
|
-
generated project. The same-origin /api proxy avoids exposing workload tokens to React.
|
|
243
|
-
The liveness endpoint is public; private business APIs require trusted end-user
|
|
244
|
-
authorization, which is deliberately not fabricated by this starter.
|
|
245
|
-
See [local workflow and browser verification](../../docs/local-development.md).
|
|
246
|
-
|
|
247
|
-
## Independent OCI workloads
|
|
248
|
-
|
|
249
|
-
Explicit canonical job producers use optional BACKIFY_JOB_ARTIFACT_SHA256 and
|
|
250
|
-
BACKIFY_JOB_BINDING host configuration. The target worker digest is independent
|
|
251
|
-
of the HTTP bundle digest. A binding without a pin refuses before application
|
|
252
|
-
code loads. Plans keep deploymentReady false and require reviewed HCR worker
|
|
253
|
-
bindings plus the additive producer SQL; packaging never installs SQL or
|
|
254
|
-
automatically activates registered artifacts. Unconfigured enqueue and legacy
|
|
255
|
-
schedules remain unchanged. See [durable jobs](../../docs/hcr-jobs.md).
|
|
256
|
-
|
|
257
|
-
backify workload plan --kind http|worker emits a non-mutating JSON plan. Workers
|
|
258
|
-
require --entry pointing to a declaration-only module. backify workload package
|
|
259
|
-
also requires --base-image with an approved digest-pinned Node 22+ image reference;
|
|
260
|
-
it writes an isolated generated context without replacing customer Dockerfiles.
|
|
261
|
-
Bundle/artifact pins, private mounted workload credentials and unsupported-provider
|
|
262
|
-
checks fail closed. This does not build images, enroll identities or deploy apps.
|
|
263
|
-
See [workload contracts and limits](../../docs/architecture/oci-workloads.md).
|
|
264
|
-
|
|
265
|
-
## Local full-stack workflow
|
|
266
|
-
|
|
267
|
-
The current source includes portable YAML validation, isolated server workers,
|
|
268
|
-
source/manifest watching, persistent local state, job/schedule inspection and an
|
|
269
|
-
authenticated loopback dashboard:
|
|
270
|
-
|
|
271
|
-
~~~sh
|
|
272
|
-
backify validate --json
|
|
273
|
-
backify dev --open
|
|
274
|
-
backify dev --frontend web --frontend-port 5173 --backend-port 3000 --json
|
|
275
|
-
backify dev --frontend web --frontend-adapter static --frontend-port 5173 --json
|
|
276
|
-
backify status --local --json
|
|
277
|
-
backify jobs list --local
|
|
278
|
-
backify jobs run --local --name daily-report
|
|
279
|
-
backify logs --local
|
|
280
|
-
backify test --json
|
|
281
|
-
~~~
|
|
282
|
-
|
|
283
|
-
Declare a Node entrypoint in backify.yaml. The SDK local runtime is installed before
|
|
284
|
-
application code loads. The CLI adds .backify/ to the ignore file; never commit its
|
|
285
|
-
records, files or queued payloads. Local mode does not use cloud credentials.
|
|
286
|
-
Full mode starts separate PostgreSQL/HCR services and applies only explicitly
|
|
287
|
-
approved SQL. Lightweight mode retains the document emulator. Optional --frontend
|
|
288
|
-
supervises an already-installed Vite frontend inside the repository; --backend-port
|
|
289
|
-
injects PORT, which application servers must honor. Vite keeps the application
|
|
290
|
-
configuration/HMR but cannot disable mandatory strict filesystem checks or private
|
|
291
|
-
state/secret exclusions. Canonical-path checks also refuse linked/junction access.
|
|
292
|
-
No frontend receives runtime
|
|
293
|
-
credentials. JSON dev lifecycle uses stdout; child diagnostics use stderr. Agents
|
|
294
|
-
may stop an IPC-launched CLI with backify-stop. See [local development and limits](../../docs/local-development.md).
|
|
295
|
-
These additions have not been published to npm.
|
|
296
|
-
|
|
297
|
-
For encrypted development secrets, declare capabilities.secrets, create a key in
|
|
298
|
-
an existing private directory outside the repository, and supply values only via stdin:
|
|
299
|
-
|
|
300
|
-
~~~sh
|
|
301
|
-
backify secrets local init --key-file /private/backify-local.key
|
|
302
|
-
backify secrets local set SERVICE_TOKEN --key-file /private/backify-local.key --stdin
|
|
303
|
-
backify secrets local list --key-file /private/backify-local.key
|
|
304
|
-
backify dev --local-secrets-key /private/backify-local.key
|
|
305
|
-
~~~
|
|
306
|
-
|
|
307
|
-
The ignored vault contains authenticated AES-256-GCM ciphertext only. The external
|
|
308
|
-
key stays outside builds/snapshots; plaintext reaches only the backend through IPC.
|
|
309
|
-
SDK logs redact values, but arbitrary console output/application writes do not.
|
|
310
|
-
Retained vaults fail closed without their key. Restart/rebuild to reload changes.
|
|
311
|
-
Windows private ACLs remain the operator's responsibility. Non-empty local vaults
|
|
312
|
-
with packaged native job workers refuse until a reviewed worker secret broker exists.
|
|
313
|
-
The opt-in static adapter requires index.html rather than Vite/package installation
|
|
314
|
-
and provides protected assets, nested live reload and public backend configuration;
|
|
315
|
-
it does not compile source or implement SSR. See the linked local guide for limits.
|
|
65
|
+
An app is one repository and one container image that runs as process roles (`web`, `worker`, `migrate`). Routes, jobs, schedules and event handlers are declared in server code with `@backifydev/sdk/app`; `backify.config.ts` holds buckets, auth providers, secret names and allowed hosts. See the [runtime contract](../../docs/architecture/app-runtime-contract.md).
|
|
66
|
+
|
|
67
|
+
`backify dev` runs the app like production on one machine:
|
|
68
|
+
- a private PostgreSQL cluster in `.backify/dev/postgres` with the platform's `migrate`, `runtime` and `inspect` roles (PostgreSQL 16+ must be installed; set `BACKIFY_POSTGRES_BIN` if it is not found);
|
|
69
|
+
- migrations through the migrate role, then the web and worker roles, rebuilt and restarted when server code or migrations change;
|
|
70
|
+
- the Vite dev server for web apps;
|
|
71
|
+
- a local gateway on one port with development sign-in at `/.backify/auth/login`, verified user tokens forwarded to the backend, `/files/{bucket}` for public buckets, and a local broker for storage (files in `.backify/dev/storage`), mail (saved to `.backify/dev/mail`) and outbound HTTP limited to `http.allow`. AI and integrations are available in preview environments only.
|
|
72
|
+
|
|
73
|
+
Local secret values go in `.backify/secrets.local.json` (`{ "NAME": "value" }`); never commit them.
|
|
74
|
+
|
|
75
|
+
`backify lock` bundles the server entry and runs it once in describe mode, with no credentials, platform variables or database, to collect declarations. It writes `backify.lock.json`: routes with auth and an OpenAPI document, jobs, schedules, event subscriptions, migration digests and capabilities. It refuses to write the file when:
|
|
76
|
+
- a declaration is not at module top level, or uses a computed name, path, cron or auth;
|
|
77
|
+
- code uses a capability that `backify.config.ts` does not configure.
|
|
78
|
+
|
|
79
|
+
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).
|
|
80
|
+
|
|
316
81
|
|
|
317
82
|
## Connected delivery
|
|
318
83
|
|
|
@@ -331,11 +96,11 @@ npx @backifydev/cli ship
|
|
|
331
96
|
|
|
332
97
|
Authenticated application commands recover automatically from a known expired credential or an API 401: they open browser approval, replace the saved application credential, and retry the rejected request once. Permission errors (403), network failures, and service errors do not trigger sign-in or write retries. Use `--no-browser` for unattended work. With `--json`, authentication failures include `code: "authentication_required"` and `reauthenticationCommand: "backify connect --reauth"`. A coding agent should ask its user to sign in before starting explicit recovery. The callback accepts only the selected authorization origin and matching random state/application/organization, is bound to `127.0.0.1`, and closes after approval or a five-minute timeout. Browser local-network access may need approval. A remotely hosted or headless coding tool needs a browser on the CLI host that can reach this loopback listener; this flow does not add remote device-code authentication.
|
|
333
98
|
|
|
334
|
-
`init` installs `@backifydev/sdk`,
|
|
99
|
+
`init` installs `@backifydev/sdk`, updates `app.id`, `instructionVersion` and coding-tool metadata in `backify.config.ts`, writes `BACKIFY.md`, and maintains only the selected coding tool's Backify block. Use `--agent codex` (`AGENTS.md`), `--agent claude` (`CLAUDE.md`), `--agent copilot` (`.github/copilot-instructions.md`), `--agent gemini` (`GEMINI.md`), `--agent cursor`/`--agent windsurf` (`AGENTS.md`), or `--agent cline` (`.clinerules/backify.md`). The CLI remembers the selection for `init`, `sync`, and `doctor`; new projects default to Codex. For any other tool, pass `--instruction-file <relative-path>` to use its native instruction or rule file, including nested paths; this is remembered too. It preserves other instructions and does not create or modify other tools' files.
|
|
335
100
|
|
|
336
101
|
The app configuration stores `instructionVersion`, matching the version declared in each managed block and its immutable guide at `https://agent.backify.dev/v<number>`. The agent root always serves the latest guide as plain text. `doctor` detects version/content drift and malformed markers. Use `npx @backifydev/cli@latest sync` to explicitly upgrade all blocks and the configuration together; unrelated configuration and unmanaged instructions remain unchanged.
|
|
337
102
|
|
|
338
|
-
|
|
103
|
+
For a new application, start with `backify new <name> --template web|api|worker` before connecting. `init` installs the selected coding tool instructions into that app. Existing older workspaces using `backify.json` remain readable until a deliberate migration. Existing manifests are preserved; in a non-empty application or monorepo, run `init` from the appropriate JavaScript/TypeScript package directory.
|
|
339
104
|
|
|
340
105
|
See the [agent setup guide](https://agent.backify.dev/).
|
|
341
106
|
|
|
@@ -345,7 +110,7 @@ Copy the application's setup prompt from Backify. It contains only the public ap
|
|
|
345
110
|
|
|
346
111
|
`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.
|
|
347
112
|
|
|
348
|
-
`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
|
|
113
|
+
`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.
|
|
349
114
|
|
|
350
115
|
`disconnect` revokes that user's application CLI sessions. `logout` removes local credentials only. Prompt histories and local reports remain subject to application permissions. Deploy the matching API and publish CLI 0.3.0 before enabling this flow in production.
|
|
351
116
|
|
|
@@ -358,10 +123,9 @@ containers remain an advanced hosting path. Doctor and local reports expose
|
|
|
358
123
|
advisory support tiers without rejecting existing stacks or claiming verified SDK
|
|
359
124
|
integration. See [application support](../../docs/application-support.md).
|
|
360
125
|
|
|
361
|
-
Container delivery
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
support for those languages. Generated GitHub workflows verify the exact production
|
|
126
|
+
Container delivery uses a repository-root Dockerfile and committed backify.lock.json.
|
|
127
|
+
The SDK entrypoint runs web, worker and migrate roles. Local Docker is not required
|
|
128
|
+
for backify dev. Hosting a custom language does not imply SDK support for it. Generated GitHub workflows verify the exact production
|
|
365
129
|
image before registry publication. See [application build verification](../../docs/application-build-contract.md)
|
|
366
130
|
for supported layouts, diagnostics, limitations and rollout requirements.
|
|
367
131
|
|
|
@@ -373,8 +137,7 @@ JSON reports distinguish failed and unverified checks, network/HTTP failure clas
|
|
|
373
137
|
|
|
374
138
|
The CLI cannot grant agent permissions: follow the supported native authorization mechanism described in [the central guide](https://agent.backify.dev), retry after approval and verify. Without approval support or after denial, report minimum required access and switch or configure environments; never bypass restrictions. The ordinary `doctor` command retains its repository instruction checks. Local probes do not verify the real application or replace reading capability documentation.
|
|
375
139
|
|
|
376
|
-
## Safe SDK upgrades
|
|
140
|
+
## Safe SDK upgrades
|
|
377
141
|
|
|
378
142
|
Run backify upgrade from a clean npm app checkout to choose the latest stable compatible SDK, validate with application checks, and restore the previous locked dependencies on failure. Pre-1.0 updates stay within the installed minor. Package upgrades preserve the repository's instruction version; older versioned guides remain supported by newer CLIs.
|
|
379
143
|
|
|
380
|
-
With reviewed --identity-users fixtures and the Vite or static frontend adapter, local sign-in uses the frontend's /.backify/auth/login. Read captured magic links using backify identity inbox --local and confirm in the requesting browser. No real email is sent. See [application maintenance](../../docs/application-maintenance.md) for prerequisites and emulation limits.
|