Introduction
Dartblaze CLI is a powerful command-line interface tool for managing Firebase and Google Cloud projects and functions.
Installation
Download the latest
dartblazebinary from GitHub ReleasesOpen Terminal and navigate to your downloads folder:
bashcd ~/DownloadsMake the binary executable:
bashchmod +x dartblazeMove the binary to your local bin:
bashsudo mv ./dartblaze /usr/local/bin/Verify the installation:
bashdartblaze doctorYou should see the current version number of DartBlaze CLI.
Updating
To update DartBlaze CLI:
- Download the latest version
- Replace the existing binary using the same steps as installation
- Verify the new version is installed:bash
dartblaze doctor
Uninstall
To remove DartBlaze CLI:
sudo rm /usr/local/bin/dartblazeBasic Usage
To see all available commands, run:
dartblazeCommands
doctor
Check your system for potential issues and verify your setup.
Usage
dartblaze doctorDescription
The doctor command runs a series of diagnostics to ensure your development environment is properly configured.
login
Usage
dartblaze loginDescription
Authenticate with Firebase and Google Cloud services. This command must be run before using any commands that require authentication.
logout
Usage
dartblaze logoutDescription
Sign out from Firebase and Google Cloud services and remove local authentication credentials.
new
Usage
dartblaze new project_nameDescription
Creates a new Dartblaze project with example cloud functions. init must be run afterwards to finish the project setup.
init
Usage
dartblaze init --email <user-email> --project-id <project-id>Options
| Option | Alias | Required | Description |
|---|---|---|---|
--email | -e | Yes | User email for granting deployment permissions |
--project-id | -p | Yes | Google Cloud project ID |
Description
Sets up the GCP for a new Dartblaze projects. The email address must be valid and follow standard format.
Example
dartblaze init --email [email protected] --project-id my-cloud-projectuse
Usage
dartblaze use <project-id>Description
Set the active project for Firebase and Google Cloud operations. All subsequent commands will be executed in the context of this project.
WARNING
Use command can only be used after the project has been initialized with init command.
Example
dartblaze use my-project-idprojects:list
Usage
dartblaze projects:listDescription
Display a list of all Firebase projects associated with your account. Requires authentication.
deploy
Usage
dartblaze deploy <function-name> --region=<database_region>Options
| Option | Required | Description |
|---|---|---|
--region | Yes | Region of the database |
--max-instances | No | Maximum number of instances for this function, defaults to 1 |
Description
Deploy a Cloud Function to your active project. If no function name is specified, all functions will be deployed.
WARNING
Multi-region Firestore deployments are not available at this time.
DANGER
Make sure to clear your GCP storage after successful deployment(s). Deployment uses Cloud Build service which stores a copy of your code in Cloud Storage.
Not clearning storage regularly will result in increased bill.
Example
dartblaze deploy authFunction --region=europe-west3delete
Usage
dartblaze delete <function-name>Description
WARNING
This command deletes the specified function from all regions
Delete a Cloud Function and its associated triggers. Use with caution as this action cannot be undone.
Example
dartblaze delete oldFunction