CLI Reference
Command-line tools for Fireconduit setup and schema generation
The Fireconduit CLI helps you deploy required infrastructure and generate schema configurations from your Firestore collections.
Installation
The CLI is available as an npm package. Run commands directly with npx:
npx fireconduit <command>
Or install globally:
npm install -g fireconduit
Commands
init
Interactive setup wizard that generates Terraform configuration files for deploying Fireconduit infrastructure to your GCP project.
npx fireconduit init
The wizard will:
- Check prerequisites (Terraform, gcloud CLI, authentication)
- Prompt for your GCP project ID
- Prompt for your preferred region
- Prompt for your Fireconduit API key (from the dashboard)
- Generate Terraform files in a
./.fireconduitdirectory
After running init, follow the next steps to deploy:
cd .fireconduit
terraform init
terraform apply
schema
Generate a schema configuration by sampling documents from a Firestore collection. This is useful for understanding your data structure before creating a pipeline.
npx fireconduit schema -c <collection> [options]
Options:
| Option | Short | Description | Default |
|---|---|---|---|
--collection | -c | Firestore collection path (required) | — |
--sample | -s | Number of documents to sample | 100 |
--output | -o | Output file path | stdout |
--format | -f | Output format (json or yaml) | json |
--project | -p | GCP project ID | ADC default |
Examples:
# Sample 100 documents from 'users' collection, output to stdout
npx fireconduit schema -c users
# Sample 500 documents and save to file
npx fireconduit schema -c orders -s 500 -o schema.json
# Output as YAML
npx fireconduit schema -c products -f yaml -o schema.yaml
# Use a specific GCP project
npx fireconduit schema -c users -p my-project-123
The generated schema shows all fields found across sampled documents, their inferred BigQuery types, and frequency information.
validate
Validate a schema configuration file against the Fireconduit schema spec.
npx fireconduit validate <file>
Example:
npx fireconduit validate schema.json
This checks that your schema file is properly formatted and can be used with Fireconduit pipelines.
doctor
Diagnose common setup issues. Run this if you’re having problems with your Fireconduit deployment.
npx fireconduit doctor
The doctor command checks:
- Terraform installation
- gcloud CLI installation and authentication
- Application Default Credentials (ADC)
- Current GCP project configuration
- Existing Fireconduit setup (terraform.tfvars, deployed function)
- API key validity
Prerequisites
The CLI requires:
- Node.js 18+
- Terraform — for the
initcommand - gcloud CLI — authenticated with your GCP account
- Application Default Credentials — run
gcloud auth application-default login
Authentication
The CLI uses Google Cloud Application Default Credentials (ADC) to connect to Firestore. Before running commands that access Firestore (like schema), ensure you’re authenticated:
# Login to gcloud
gcloud auth login
# Set up ADC
gcloud auth application-default login
# Optionally set default project
gcloud config set project my-project-123