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
module list
module select
firestore query
firestore create
firestore update
firestore delete
auth list
auth search
auth create
auth update
auth delete
auth export
auth import
auth transfer
auth run
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
storage signed-url
run <selected-module-action>
Module Selection
module select <module> saves the selected module. run <action> currently dispatches to firestore, auth, or storage when one of those modules is selected.
Known module names accepted by module select:
firestore
auth
storage
index-advisor
seed-studio
workspace-link
migrations
The CLI module list is narrower than the GUI module list. Push, PITR, Tasks, Support, Purchases, and Settings do not currently expose first-class CLI command groups.
Source Anchors
Sources/FirestructCLI/main.swiftSources/FirestructCLIKit/FirestructCLI.swiftSources/FirestructCLIKit/CLIArguments.swiftSources/FirestructCLIKit/CLIStateStore.swiftSources/FirestructCLIKit/ModuleCommand.swift