Purpose
The CLI mirrors core workspace concepts for automation: project selection, module selection, JSON output, and shared access to FirestructCore services.
Executable Layout
Sources/FirestructCLI/main.swiftis the thin executable.Sources/FirestructCLIKitparses arguments, loads local state, dispatches commands, and encodes JSON output.Sources/FirestructCoreprovides the same project, query, and write services used by GUI flows.
Global Behavior
helpand--helpprint usage.- Missing commands, missing actions, invalid flags, and unknown commands exit with code
1. - Successful command payloads are JSON unless the command is help text.
--project <name|firebaseProjectID|uuid>overrides the selected project for supported commands.
Current Command Groups
project connect
project list
project select
project databases list
project databases add
project databases select
module list
module select
firestore query
firestore export
firestore backup
firestore import
firestore transfer
firestore schema
firestore run-js
firestore saved-query
firestore saved-script
firestore embedding-config
firestore embedding-generate
firestore create
firestore update
firestore delete
tasks list
tasks show
tasks retry
tasks cancel
auth list
auth search
auth create
auth update
auth delete
auth disable
auth enable
auth export
auth import
auth transfer
auth run
auth tenants list
auth tenants select
auth tenants current
auth routes list
auth routes set
auth routes enable
auth routes disable
auth routes delete
auth routes resolve-auth
auth routes resolve-firestore
storage buckets
storage list
storage upload
storage upload-folder
storage download
storage download-batch
storage zip
storage zip-folder
storage inspect
storage copy
storage move
storage delete-folder
storage copy-folder
storage move-folder
storage rename-folder
storage duplicate-folder
storage delete
storage url
storage signed-url
release preflight
index-advisor analyze
index-advisor parse-error
index-advisor load-indexes
seed import-template
seed generate
seed export-template
seed apply
seed diff
workspace link
workspace status
workspace diff
workspace deploy
pitr load
pitr diff
pitr restore
push validate
push resolve-tokens
push send
migrations status
migrations show
migrations record-applied
migrations apply
run <selected-module-action>
Release Preflight
release preflight is an operator-oriented command that classifies local release evidence and returns JSON with an overall pass, warning, or fail status plus individual checks and remediation.
release preflight
release preflight --skip-storekit --ui-smoke-output-file smoke.log --ui-smoke-exit-code 0 --ui-smoke-result-bundle build/smoke.xcresult
release preflight --require-full-ui --full-ui-output-file full-ui.log --full-ui-exit-code 0 --full-ui-result-bundle build/full-ui.xcresult
release preflight --require-storekit-transaction --storekit-transaction-output-file storekit.log --storekit-transaction-exit-code 0 --storekit-transaction-evidence build/storekit.xcresult
The command can run local StoreKit tooling checks, classify captured focused UI smoke output, require full emulator UI/E2E evidence, and require captured StoreKit purchase/restore evidence. It also reports the current no-endpoint boundary for app-owned update/license checks. Supplying captured output classifies that evidence; it does not run the UI or StoreKit transaction suites itself.
Module Selection
module select <module> saves the selected module. run <action> dispatches
to the selected first-class CLI module when supported.
Known module names accepted by module select:
firestore
auth
storage
index-advisor
seed-studio
workspace-link
pitr
push
migrations
The CLI module list is narrower than the GUI module list. Support, Purchases, and Settings do not currently expose first-class CLI command groups. Tasks has a first-class CLI for current-process task inspection and durable completed-task history. release preflight is a standalone operator command and is not selectable as a workspace module.
Source Anchors
Sources/FirestructCLI/main.swiftSources/FirestructCLIKit/FirestructCLI.swiftSources/FirestructCLIKit/CLIArguments.swiftSources/FirestructCLIKit/CLIStateStore.swiftSources/FirestructCLIKit/ModuleCommand.swift