CLI
This reference lists common fireemu commands and options. Run npx fireemu --help, or npx fireemu help <command>, for the help of the version you have installed.
| Command | What it does |
|---|---|
init |
Create fireemu.toml in the current directory |
up |
Start the emulators and keep them running until Ctrl+C (alias: emulators:start) |
exec |
Start the emulators, run a command, stop them (alias: emulators:exec) |
emulators:export |
Export the state of a running suite to a directory |
doctor |
Check the installation: binary, UI, Functions runner, Node.js |
capabilities |
Print the capability manifest of the resolved profile as JSON |
fireemu init - create fireemu.toml in the current directory
usage: fireemu init [options]
Creates fireemu.toml in the current directory and prints the command to start with it. It never overwrites an existing file unless --force is given. An existing fireemu.json must be removed before creating fireemu.toml.
options: --reference Also write fireemu.reference.toml, which fireemu does not load. With an existing fireemu.toml or fireemu.json and no --profile or --firebase-json, write only the reference. Copying a key into fireemu.toml makes it explicit and stops productionExact from switching it. --profile strict|emulator Compatibility profile. strict follows production Firebase and is recommended, including when migrating from the official emulator; emulator is only for checking alignment with the pinned official emulator and is not needed when migrating. Default: strict (asked interactively). --firebase-json <file> Reference this firebase.json from fireemu.toml, so rules, indexes, Functions and ports are read from it on every start. Default: ./firebase.json when it exists (asked interactively). --interactive Ask for the missing choices. Default: only when stdin and stdout are terminals. --yes, --no-interactive Never ask; use the defaults for what is not given. --force Replace existing output files. Default: an existing file is an error. -h, --help Print this help and exit.fireemu up - start the emulators and keep them running until Ctrl-C (alias: emulators:start)
usage: fireemu up [options] fireemu emulators:start [options]
Serves the selected emulators (Firestore, Auth, Storage and App Check; Functions when a codebase is configured, and with it Eventarc and Cloud Tasks; Pub/Sub when configured; the Realtime Database when configured) plus the control API, the Emulator Hub and the UI on loopback until Ctrl-C.
options: --config <file> Configuration file: TOML (.toml) or JSON (any other extension), with schemaVersion 1, or a firebase.json. Default: ./fireemu.toml or ./fireemu.json when neither --config nor --firebase-json is given (both present is an error; remove one), else the nearest firebase.json (see --no-config-discovery), else the built-in defaults. --firebase-json <file> Read ports, rules, indexes and Functions codebases from this firebase.json. Takes precedence over one referenced by --config. Default: the one ./fireemu.toml or ./fireemu.json names, else, without either, the nearest firebase.json in the current directory or a parent. --no-config-discovery Do not search for ./fireemu.toml, ./fireemu.json or the nearest firebase.json when neither --config nor --firebase-json is given; use the built-in defaults. Also silences the warning for a discovered file that was skipped because of its owner or permissions. Default: the search is on. -P, --project <id|alias> Project ID, or an alias from the .firebaserc next to the firebase.json (else the current directory). Default: the .firebaserc default, else daemon.authProject from --config, else demo-app. --only <list> Comma-separated services to start: auth, firestore, storage, functions (or functions:<codebase>), eventarc, tasks, pubsub, database, appcheck. Default: Firestore, Auth, Storage and App Check; Functions when a codebase is configured (firebase.json or --functions), and with it Eventarc and Cloud Tasks; Pub/Sub when configured (emulators.pubsub, daemon.pubsubPort or --pubsub-port); the Realtime Database when configured (emulators.database, daemon.databasePort or --database-port). --firestore-port <n> Firestore port. Default: 8080 (0 picks a free port). --http-port <n> Auth (Identity Toolkit) port. Default: 9099 (0 picks a free port). --storage-port <n> Storage port. Default: 9199 (0 picks a free port). --functions-port <n> Functions port, used when a codebase is loaded. Default: 5001 (0 picks a free port). --eventarc-port <n> Eventarc port. Eventarc starts exactly when a Functions backend is loaded; this option only sets the port. Default: 9299. --tasks-port <n> Cloud Tasks port. Cloud Tasks starts exactly when a Functions backend is loaded; this option only sets the port. Default: 9499. --pubsub-port <n> Pub/Sub port. Without --only, giving it also starts Pub/Sub; with --only, Pub/Sub starts only when the list names pubsub. Default: 8085. --database-port <n> Realtime Database port. Without --only, giving it also starts the Realtime Database; with --only, it starts only when the list names database. Default: 9000. --functions <dir> Load exactly one Functions codebase from this directory, whatever firebase.json declares. Default: the codebases firebase.json declares. --ui-port <n|auto> UI port; auto assigns an available port, 0 disables the UI. Default: 4000 for up (the UI is skipped if that port is busy), off for exec. --hub-port <n|auto> Emulator Hub port; auto assigns an available port, 0 disables it. Default: 4400. --logging-port <n> Logging emulator port; 0 disables it. Default: 4500. --inspect-functions [port] Run the Functions runner under the Node inspector on this port (1024-65535); without a port, or with `true`, a free port. Refused when functions.runner is not node. Default: off. --log-verbosity quiet|silent|info|debug quiet and silent print errors only; info adds the banner and notices; debug also prints the resolved configuration. Case-insensitive. Default: info. --import <dir> Import an export directory (from --export-on-exit or emulators:export) at start; it must exist. Default: start empty. --export-on-exit [dir] Export all state to this directory when the emulators stop; without a directory, the --import directory. Refused for the working directory or a parent of it, and unavailable on Windows. Default: no export. --ready-file <file> Publish endpoint discovery, including a control capability, to this private file once every listener is bound, and remove it on graceful shutdown. For tooling such as fireemu/testing. Default: none. --owner-stdin Shut down when standard input is closed. For tooling such as fireemu/testing. Default: off. -h, --help Print this help and exit.fireemu exec - start the emulators, run a command, stop them (alias: emulators:exec)
usage: fireemu exec [options] "shell script" fireemu exec [options] -- <command...> fireemu emulators:exec [options] "shell script" fireemu emulators:exec [options] -- <command...>
Starts the same emulators as `up`, runs the command with the emulator host environment variables (FIRESTORE_EMULATOR_HOST, FIREBASE_AUTH_EMULATOR_HOST, and so on) once every listener is bound, stops everything when the command exits, and exits with the command's status. On Unix, a command ended by signal n gives 128 + n, and SIGINT and SIGTERM are forwarded to it.
With "shell script" (the official form) the script is run by the system shell. With `--` the command is run as exactly that program and argv, without a shell. Everything after `--` belongs to the command, including --help; a `--help` inside the script text is script text.
options: --config <file> Configuration file: TOML (.toml) or JSON (any other extension), with schemaVersion 1, or a firebase.json. Default: ./fireemu.toml or ./fireemu.json when neither --config nor --firebase-json is given (both present is an error; remove one), else the nearest firebase.json (see --no-config-discovery), else the built-in defaults. --firebase-json <file> Read ports, rules, indexes and Functions codebases from this firebase.json. Takes precedence over one referenced by --config. Default: the one ./fireemu.toml or ./fireemu.json names, else, without either, the nearest firebase.json in the current directory or a parent. --no-config-discovery Do not search for ./fireemu.toml, ./fireemu.json or the nearest firebase.json when neither --config nor --firebase-json is given; use the built-in defaults. Also silences the warning for a discovered file that was skipped because of its owner or permissions. Default: the search is on. -P, --project <id|alias> Project ID, or an alias from the .firebaserc next to the firebase.json (else the current directory). Default: the .firebaserc default, else daemon.authProject from --config, else demo-app. --only <list> Comma-separated services to start: auth, firestore, storage, functions (or functions:<codebase>), eventarc, tasks, pubsub, database, appcheck. Default: Firestore, Auth, Storage and App Check; Functions when a codebase is configured (firebase.json or --functions), and with it Eventarc and Cloud Tasks; Pub/Sub when configured (emulators.pubsub, daemon.pubsubPort or --pubsub-port); the Realtime Database when configured (emulators.database, daemon.databasePort or --database-port). --firestore-port <n> Firestore port. Default: 8080 (0 picks a free port). --http-port <n> Auth (Identity Toolkit) port. Default: 9099 (0 picks a free port). --storage-port <n> Storage port. Default: 9199 (0 picks a free port). --functions-port <n> Functions port, used when a codebase is loaded. Default: 5001 (0 picks a free port). --eventarc-port <n> Eventarc port. Eventarc starts exactly when a Functions backend is loaded; this option only sets the port. Default: 9299. --tasks-port <n> Cloud Tasks port. Cloud Tasks starts exactly when a Functions backend is loaded; this option only sets the port. Default: 9499. --pubsub-port <n> Pub/Sub port. Without --only, giving it also starts Pub/Sub; with --only, Pub/Sub starts only when the list names pubsub. Default: 8085. --database-port <n> Realtime Database port. Without --only, giving it also starts the Realtime Database; with --only, it starts only when the list names database. Default: 9000. --functions <dir> Load exactly one Functions codebase from this directory, whatever firebase.json declares. Default: the codebases firebase.json declares. --ui Start the UI while the command runs (exec does not start it otherwise, as in `firebase emulators:exec`). --ui-port overrides. --ui-port <n|auto> UI port; auto assigns an available port, 0 disables the UI. Default: 4000 for up (the UI is skipped if that port is busy), off for exec. --hub-port <n|auto> Emulator Hub port; auto assigns an available port, 0 disables it. Default: 4400. --logging-port <n> Logging emulator port; 0 disables it. Default: 4500. --inspect-functions [port] Run the Functions runner under the Node inspector on this port (1024-65535); without a port, or with `true`, a free port. Refused when functions.runner is not node. Default: off. --log-verbosity quiet|silent|info|debug quiet and silent print errors only; info adds the banner and notices; debug also prints the resolved configuration. Case-insensitive. Default: info. --import <dir> Import an export directory (from --export-on-exit or emulators:export) at start; it must exist. Default: start empty. --export-on-exit [dir] Export all state to this directory when the emulators stop; without a directory, the --import directory. Refused for the working directory or a parent of it, and unavailable on Windows. Default: no export. --ready-file <file> Publish endpoint discovery, including a control capability, to this private file once every listener is bound, and remove it on graceful shutdown. For tooling such as fireemu/testing. Default: none. --owner-stdin Shut down when standard input is closed. For tooling such as fireemu/testing. Default: off. -h, --help Print this help and exit.emulators:export
Section titled “emulators:export”fireemu emulators:export - export the state of a running suite to a directory
usage: fireemu emulators:export <dir> [options]
Asks the suite that is already running for the project (found through its Emulator Hub locator file) to write its state to <dir>, in the format --import reads. Not available on Windows.
options: -P, --project <id> Project of the running suite. Default: the .firebaserc default in the current directory, else demo-app. -f, --force Overwrite a non-empty destination. Default: refused. -h, --help Print this help and exit.doctor
Section titled “doctor”fireemu doctor - check the installation: binary, UI, Functions runner, Node.js
usage: fireemu doctor [--connect <control url> | --export-dir <path>]
Reports the Fireemu binary, UI, Functions runner and Node.js that this installation finds, and suggests a remedy for each problem.
options: --export-dir path Inspect an export destination and its ancestors without starting a daemon or changing files. Export checks again when it writes. Cannot be combined with --connect. --connect http://127.0.0.1:<port> Also report what a running suite says, through its control URL (the control port is printed at startup). Default: only the offline report. -h, --help Print this help and exit.capabilities
Section titled “capabilities”fireemu capabilities - print the capability manifest of the resolved profile as JSON
usage: fireemu capabilities [options]
Prints the capability manifest for the profile the options resolve to. It accepts the same options as `up` and validates them the same way, but only --config (the profile it names) changes the result.
options: --config <file> Configuration file: TOML (.toml) or JSON (any other extension), with schemaVersion 1, or a firebase.json. Default: ./fireemu.toml or ./fireemu.json when neither --config nor --firebase-json is given (both present is an error; remove one), else the nearest firebase.json (see --no-config-discovery), else the built-in defaults. --firebase-json <file> Read ports, rules, indexes and Functions codebases from this firebase.json. Takes precedence over one referenced by --config. Default: the one ./fireemu.toml or ./fireemu.json names, else, without either, the nearest firebase.json in the current directory or a parent. --no-config-discovery Do not search for ./fireemu.toml, ./fireemu.json or the nearest firebase.json when neither --config nor --firebase-json is given; use the built-in defaults. Also silences the warning for a discovered file that was skipped because of its owner or permissions. Default: the search is on. -P, --project <id|alias> Project ID, or an alias from the .firebaserc next to the firebase.json (else the current directory). Default: the .firebaserc default, else daemon.authProject from --config, else demo-app. --only <list> Comma-separated services to start: auth, firestore, storage, functions (or functions:<codebase>), eventarc, tasks, pubsub, database, appcheck. Default: Firestore, Auth, Storage and App Check; Functions when a codebase is configured (firebase.json or --functions), and with it Eventarc and Cloud Tasks; Pub/Sub when configured (emulators.pubsub, daemon.pubsubPort or --pubsub-port); the Realtime Database when configured (emulators.database, daemon.databasePort or --database-port). --firestore-port <n> Firestore port. Default: 8080 (0 picks a free port). --http-port <n> Auth (Identity Toolkit) port. Default: 9099 (0 picks a free port). --storage-port <n> Storage port. Default: 9199 (0 picks a free port). --functions-port <n> Functions port, used when a codebase is loaded. Default: 5001 (0 picks a free port). --eventarc-port <n> Eventarc port. Eventarc starts exactly when a Functions backend is loaded; this option only sets the port. Default: 9299. --tasks-port <n> Cloud Tasks port. Cloud Tasks starts exactly when a Functions backend is loaded; this option only sets the port. Default: 9499. --pubsub-port <n> Pub/Sub port. Without --only, giving it also starts Pub/Sub; with --only, Pub/Sub starts only when the list names pubsub. Default: 8085. --database-port <n> Realtime Database port. Without --only, giving it also starts the Realtime Database; with --only, it starts only when the list names database. Default: 9000. --functions <dir> Load exactly one Functions codebase from this directory, whatever firebase.json declares. Default: the codebases firebase.json declares. --ui-port <n|auto> UI port; auto assigns an available port, 0 disables the UI. Default: 4000 for up (the UI is skipped if that port is busy), off for exec. --hub-port <n|auto> Emulator Hub port; auto assigns an available port, 0 disables it. Default: 4400. --logging-port <n> Logging emulator port; 0 disables it. Default: 4500. --inspect-functions [port] Run the Functions runner under the Node inspector on this port (1024-65535); without a port, or with `true`, a free port. Refused when functions.runner is not node. Default: off. --log-verbosity quiet|silent|info|debug quiet and silent print errors only; info adds the banner and notices; debug also prints the resolved configuration. Case-insensitive. Default: info. --import <dir> Import an export directory (from --export-on-exit or emulators:export) at start; it must exist. Default: start empty. --export-on-exit [dir] Export all state to this directory when the emulators stop; without a directory, the --import directory. Refused for the working directory or a parent of it, and unavailable on Windows. Default: no export. --ready-file <file> Publish endpoint discovery, including a control capability, to this private file once every listener is bound, and remove it on graceful shutdown. For tooling such as fireemu/testing. Default: none. --owner-stdin Shut down when standard input is closed. For tooling such as fireemu/testing. Default: off. -h, --help Print this help and exit.