1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-11 15:39:42 +00:00
gcloud-help/gcloud/alpha/emulators/firestore/start

95 lines
3.3 KiB
Text
Raw Normal View History

2022-03-01 04:29:52 +00:00
NAME
2022-10-18 11:38:19 +00:00
gcloud alpha emulators firestore start - start a local Firestore emulator
2022-03-01 04:29:52 +00:00
SYNOPSIS
2024-02-22 10:25:44 +00:00
gcloud alpha emulators firestore start [--database-mode=DATABASE_MODE]
2024-05-08 09:17:12 +00:00
[--export-on-exit=EXPORT_ON_EXIT] [--host-port=HOST_PORT]
2025-04-30 11:00:00 +00:00
[--import-data=IMPORT_DATA] [--licenses] [--rules=RULES]
[GCLOUD_WIDE_FLAG ...]
2022-03-01 04:29:52 +00:00
DESCRIPTION
2022-10-18 11:38:19 +00:00
(ALPHA) This command starts a local Firestore emulator.
2022-03-01 04:29:52 +00:00
EXAMPLES
2022-10-18 11:38:19 +00:00
To start the local Firestore emulator, run:
2022-03-01 04:29:52 +00:00
$ gcloud alpha emulators firestore start
2022-10-18 11:38:19 +00:00
To bind to a specific host and port, run:
$ gcloud alpha emulators firestore start --host-port=0.0.0.0:8080
To run the local Firestore emulator with a Firebase Rules set, run:
$ gcloud alpha emulators firestore start --rules=firestore.rules
2024-02-22 10:25:44 +00:00
To run the local Firestore emulator in Datastore Mode, run:
$ gcloud alpha emulators firestore start \
--database-mode=datastore-mode
2024-05-08 09:17:12 +00:00
To import data at the start of the Firestore emulator, run:
$ gcloud alpha emulators firestore start --import-data=<path/to/file>
To export emulator data upon emulator shutdown, run:
$ gcloud alpha emulators firestore start \
--export-on-exit=<path/to/directory>
2022-03-01 04:29:52 +00:00
FLAGS
2024-02-22 10:25:44 +00:00
--database-mode=DATABASE_MODE
The database mode to start the Firestore Emulator in. The valid options
are:
`firestore-native` (default): start the emulator in Firestore Native
`datastore-mode`: start the emulator in Datastore Mode
2024-05-08 09:17:12 +00:00
--export-on-exit=EXPORT_ON_EXIT
Directory path in which emulator data will be saved upon shutdown.
Example:/home/user/myexports/2024-03-26/
2022-03-01 04:29:52 +00:00
--host-port=HOST_PORT
The host:port to which the emulator should be bound. Can take the form
of a single address (hostname, IPv4, or IPv6) and/or port:
[ADDRESS][:PORT]
In this format you must enclose IPv6 addresses in square brackets: e.g.
[2001:db8:0:0:0:ff00:42:8329]:8080
The default value is localhost:8080.
2024-05-08 09:17:12 +00:00
--import-data=IMPORT_DATA
File path to the data to be loaded into the emulator upon start up.
Example:/home/user/myexports/sampleExport/sampleExport.overall_export_metadata.
2025-04-30 11:00:00 +00:00
--licenses
If set, the emulator will print open-source dependencies and licenses,
then exit.
2022-03-01 04:29:52 +00:00
--rules=RULES
2022-10-18 11:38:19 +00:00
If set, all projects will use the security rules in this file. More
information on Firebase Rules and the syntax for this file is available
at https://firebase.google.com/docs/rules.
2022-03-01 04:29:52 +00:00
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account,
--billing-project, --configuration, --flags-file, --flatten, --format,
--help, --impersonate-service-account, --log-http, --project, --quiet,
--trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.
NOTES
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct
project, you might be trying to access an API with an invitation-only early
2022-10-18 11:38:19 +00:00
access allowlist. These variants are also available:
$ gcloud emulators firestore start
2022-03-01 04:29:52 +00:00
$ gcloud beta emulators firestore start