/** * One archive member (structurally an `ArchiveEntry`): its in-archive path and * the serialized signed `type:"content"` envelope written there. */ interface SeedContentFile { /** `content/-.json` (page 1-based, contiguous). */ name: string; /** The serialized signed `type:"content"` envelope. */ content: string; } /** A seed value the schema says is not public, and where it came from. */ interface NonPublicSeedValue { table: string; column: string; value: string; /** * Whether a static build can actually be searched for this value. * * `false` for a value below {@link MIN_SCANNABLE_LENGTH}, and for a non-string * one. Those are collected rather than dropped (issue #45): being too short to * search for is not the same as being safe, and the author is the only one who * can judge which it is. The scanner skips them; the deploy path reports them. */ scannable: boolean; } interface ParsedArgs { command: string | undefined; /** * The verb of a noun-verb command (`sandbox deploy`, `profile me`): here * `command` is the noun and `subcommand` is the verb. * Undefined for the single-token verbs (`compile`/`export`/`lock`/…). */ subcommand: string | undefined; file: string | undefined; out: string | undefined; /** All non-flag arguments after the command (file is positionals[0]). */ positionals: string[]; /** `--lock` / `--lock=`: opt into creating a lock file. */ lock: boolean; /** The `--lock=` override (default: `xano.lock` beside the entry). */ lockPath: string | undefined; /** * `--entry=`: the workspace entry the lock sits beside, for the `lock` * subcommands that take no entry file of their own (`rename`/`adopt`). * * Distinct from `--lock`, which names the lock FILE directly. This names the * entry and lets the default be DERIVED the way `export --lock` and `prune` * derive it — so the caller still supplied the anchor and nothing is guessed. */ entryPath: string | undefined; /** `--frozen-lock`: hard-fail if the export would change the lock (CI). */ frozenLock: boolean; /** * `--strict`: promote every export/deploy WARNING to a hard failure — the * build diagnostics (a `bulk.update` that zero-fills omitted columns, an * `ignoreEmpty` that drops its predicate; issue #15) as well as the CLI's own * preflights (unresolvable filter names, issue #106; a stale `--emit` * manifest). Warnings print either way; `--strict` decides whether a printed * one still ships. */ strict: boolean; /** `--yes`/`-y`: confirm destructive lock maintenance non-interactively. */ yes: boolean; /** `push --bundle `: upload an already-exported bundle instead of a file entry. */ bundle: string | undefined; /** `--reset`: accepted but redundant — every deploy is a full replace now. */ reset: boolean; /** * `--dest`: which environment to address. * * The parser accepts all three because `test` reads all three. `workspace` is * refused by the commands that WRITE (`deploy`, `release`) at dispatch, with * the explanation — not here, where the message could only say "bad value" * for something that is a deliberate product boundary rather than a typo. */ dest: "sandbox" | "ephemeral" | "workspace" | undefined; /** `test --kind unit|workflow`: narrow to one test family (default: both). */ kind: "unit" | "workflow" | undefined; /** `test run-all --concurrency `: how many tests to run at once (default 1). */ concurrency: number | undefined; /** `deploy --test`: run the environment's tests after the deploy lands. */ test: boolean; /** `deploy --expires-hours `: ephemeral create-time TTL (1–72, default 1 server-side). */ expiresHours: number | undefined; /** * `routes --emit `: write the generated route module there instead of * printing the table. Plain data + one interpolator, importing nothing, so a * frontend gets the typed path/verb contract without the SDK runtime. */ emit: string | undefined; /** `deploy --static `: archive this directory and deploy it to the sandbox's static host. */ static: string | undefined; /** * `deploy --static-env KEY=VALUE` (repeatable): public config baked into EVERY * html document of the static build as `window.` globals. The backend URL is * wired in automatically as `window.XANO_HOST`; these override/extend it. * Served to the browser verbatim — public values only, never secrets. */ staticEnv: Record; /** * `deploy --static-host `: the static-host NAME to deploy the frontend * to (default `default`). Give each app a distinct host so deploys don't share * and overwrite one `default` host — the shared host is why a first post-deploy * load can serve a *previous* app's cached `index.html`. */ staticHost: string | undefined; /** * `deploy --static-routing spa|multipage`: override how the host resolves URLs * within the build. Normally unset — the shape is inferred from the bundle. * Set it for a single-document site that wants real 404s, or a bundle carrying * a stray `.html` that should still route entirely client-side. */ staticRouting: "spa" | "multipage" | undefined; /** `--origin `: Xano control-plane OAuth host. Default: $XANO_ORIGIN, then https://app.xano.com. */ authHost: string | undefined; /** `--config `: explicit credential file. Default: $XANO_CONFIG, then ./.xano/auth.json. */ authFile: string | undefined; /** * `--local`: use the project-local `./.xano/auth.json` cache instead of the * shared `~/.xanots/auth.json` one (the default). `login --local` writes * there; other commands read it. Without `--local`, reads still prefer an * existing project-local cache before falling back to the global one, so a * `--local` project keeps working without repeating the flag. */ local: boolean; /** * `ephemeral list --all-workspaces`: enumerate ephemeral tenants across every * workspace on the instance, not just the token's parent workspace. */ allWorkspaces: boolean; /** `ephemeral impersonate --guest`/`-g`: mint a read-only guest session (browse only). */ guest: boolean; /** `ephemeral impersonate --url-only`/`-u`: print the dashboard URL instead of opening a browser. */ urlOnly: boolean; /** `marketplace details --prompt`: print the add-on's agent prompt alone, for piping. */ prompt: boolean; /** `login --port `: fixed loopback callback port (default: an ephemeral port). */ port: number | undefined; /** `login --scope ""`: OAuth scopes to request (default: the built-in xano-cli set). */ scope: string | undefined; /** `validate --runtime`: after import + round-trip, run each deployed function and report. */ runtime: boolean; /** `validate --capture`: write each round-tripped function's fetched JSON (candidate fixtures). */ capture: boolean; /** `validate --verbose`: print full diffs / raw engine detail instead of a projected summary. */ verbose: boolean; /** `validate --instance `: override XANO_VALIDATE_INSTANCE for this run. */ instance: string | undefined; /** `sandbox export --format `: which artifact to emit (validated at parse time). */ format: "json" | "multidoc" | undefined; /** `sandbox export --path

`: output location (`-` for stdout; a dir or a full file path). */ path: string | undefined; /** `sandbox export --name `: output basename override (default `sandbox`). Also the `init`/`codegen` app name (default: target dir basename). */ name: string | undefined; /** * `init`/`codegen` `--ai ` (repeatable, comma-separated): AI-assistant instruction * files to scaffold (`claude`/`codex`/`cursor`/`none`). Empty = prompt in a TTY, * else write none. Validated in the init command, not at parse time. */ ai: string[]; /** * `init`/`codegen` `--framework `: which frontend to scaffold * (`react`/`svelte`). Undefined = prompt in a TTY, else the default. * Validated in `frontend-presets.ts`, not at parse time. */ framework: string | undefined; /** `init`/`codegen` `--force`: scaffold into a non-empty target directory (overwrite our own files). */ force: boolean; /** `init`/`codegen` `--no-install`: skip the post-scaffold `npm install`. For `codegen` this also means the round trip cannot be verified, since loading the tree needs its dependencies. */ noInstall: boolean; /** * `deploy --no-verify`: skip the post-deploy liveness checks. Everything is * still deployed; XanoTS just doesn't wait to confirm it came up — neither * that the edge is serving *this* static build (via `X-Xano-Canonical`) nor * that the workspace's microservices reached a ready state. Useful for fast * iterative deploys or when the deployed URL isn't reachable from the CLI host. */ noVerify: boolean; /** * `deploy --require-microservices`: fail the deploy when a microservice has * not reported ready by the end of the wait, not just when the engine says it * is broken. A microservice the engine reports as FAILED already exits * non-zero without this — the flag is what turns "still starting" into a * failure too, which is the reading CI wants. */ requireMicroservices: boolean; /** * `codegen --report `: how the findings are rendered. * * `grouped` (the default) prints one line per distinct root cause with a count * and a collapsed object list; `full` prints every site; `json` prints the * findings as data for a CI gate to read. The findings themselves are the same * set in all three — this chooses the rendering, never what is reported. */ report: string | undefined; /** * `deploy --allow-seed-in-static`: publish a static build even when it * contains seed values the schema declares non-public. The refusal exists * because the alternative is serving them at a public URL; this is the escape * hatch for a workspace whose seed is deliberately demo data. */ allowSeedInStatic: boolean; /** * `release --dry-run`: print what the release WOULD change and exit without * sending it. A destructive release previews anyway; this is how you preview * one that isn't, or preview without being prompted. */ dryRun: boolean; /** * `release --prune`: also delete objects in the target workspace that your * project no longer defines. Without it a release only adds and updates, so * something deleted from your code lingers in the workspace. */ prune: boolean; /** * `release --reset-data`: empty every table the bundle carries before * importing. Pair with `--seed` to reload the bundle's rows afterwards; * alone it leaves the tables empty. */ resetData: boolean; /** * `release --seed`: write the bundle's table rows into the workspace. Off by * default, so a release cannot overwrite live data you did not ask it to. */ seed: boolean; /** * `release --replace`: the OLD behavior — wipe the workspace (objects, table * data and history) and import the bundle in its place, instead of merging. * Named rather than implicit so it can never be reached by accident. */ replace: boolean; /** * `--json`: force the machine-readable JSON on stdout even at a terminal. * Absent, the format is inferred from stdout being a TTY. Read through * `isMachineOutput` (output.ts) — never by re-checking `isTTY` at a call site. */ json: boolean; /** * `deploy --open`: open the deployed URL in the default browser once it lands. * Honors `XANO_NO_BROWSER` like every other launch, since it shares the same * helper. */ open: boolean; /** * Leading-dash tokens the parser doesn't recognize. They are collected HERE * rather than falling into {@link positionals} so an unknown flag can never be * resolved as the entry `` — the issue #173 failure mode, where * `xanots deploy --help` was imported as a module path and died in Node's * loader with a message about a missing file named `--help`. */ unknownFlags: string[]; } declare function parseArgs(argv: string[]): ParsedArgs; /** * A resolved help request: the deepest command path present, or the topic word * that `xanots help ` named and the registry does not know. */ interface HelpRequest { command?: string; subcommand?: string; /** Set only for `xanots help ` — see {@link resolveHelpRequest}. */ unknownTopic?: string; } /** * Resolve a help request straight from the RAW argv, before any flag parsing. * * Deliberately pre-parse: `parseArgs` throws on removed flags and malformed * values, so resolving help afterwards would mean `xanots deploy --profile x * --help` died on the flag error instead of printing the help the user asked * for. Returns the deepest command path present (`{}` for global help), or * undefined when no help was requested. */ declare function resolveHelpRequest(argv: string[]): HelpRequest | undefined; declare function loadDefault(file: string): Promise; /** * Resolve this package's version for `xanots version`. Walks up from the running * module to the package root's `package.json` (`dist/cli.js` → `../`, the * `src/emit/cli.ts` source → `../../`), matching on the package NAME so a stray * ancestor `package.json` can't shadow it. Best-effort: returns `"unknown"` rather * than throwing when it can't be located, since a version print must never fail. */ declare function readVersion(): string; /** * Write the grouped command reference to STDOUT — help is requested output, not * an error. The reference itself comes from the command registry via * `help.ts`; nothing about the command surface is written down here. */ declare function printHelp(): void; declare function run(argv: string[]): Promise; /** * Resolve the lock path for an entry file: `--lock=` wins, else * `xano.lock` beside the entry (matching `export`/`compile` defaults). */ declare function resolveLockPath(args: ParsedArgs, file: string): string; /** A compiled bundle plus any seed `content/` entries (empty unless requested). */ interface CompiledBundle { bundle: string; content: SeedContentFile[]; /** * Names of tables that declared `seed` but whose rows were NOT built into * `content` (i.e. `opts.seed` was false). Empty when `opts.seed` is true. Lets * the `export` command warn that its artifact omits seed — so the CI pattern * `export --out bundle.json` then `deploy --bundle bundle.json` doesn't drop * seed silently (a `--bundle` deploy has no registry to resolve seed from). */ omittedSeedTables: string[]; /** * Seed values drawn from columns the schema declares non-public, for the * `--static` publication guard. Empty unless seed was resolved. */ nonPublicSeedValues: NonPublicSeedValue[]; } /** * Thin wrapper over {@link compileBundle} for the many callers that only need the * bundle text (export, validate, sandbox-export). Seed content is not built here. */ declare function exportBundleJson(args: ParsedArgs): Promise; /** * Compile an entry file to its `packageExport` bundle, running the full lock * pipeline (seed → export → write). With `opts.seed`, also resolve + validate the * tables' seed rows into signed `content/` archive entries — done HERE, inside the * same lock-seeded context as the export, so a seed file's `dbo` guid matches the * table's guid in `workspace.json`. Only the deploy path passes `seed:true`, so a * plain `export`/`validate` never resolves seed sources. */ declare function compileBundle(args: ParsedArgs, opts?: { seed?: boolean; }): Promise; export { type CompiledBundle, type HelpRequest, type ParsedArgs, compileBundle, exportBundleJson, loadDefault, parseArgs, printHelp, readVersion, resolveHelpRequest, resolveLockPath, run };