The Fauna CLI lets you access Fauna from your terminal. You can use the CLI to:
- Log in to your Fauna account.
- Create and manage Fauna databases and keys.
- Manage database schema
as
.fsl
files on your local machine. - Run FQL queries from files or in an interactive shell.
Node.js v18.x or later.
Install the Fauna CLI globally using npm:
npm install -g fauna-shell
To upgrade the CLI, run:
npm update -g fauna-shell
For usage instructions and a full list of commands, see the Fauna docs.
You can also access help directly in the CLI by running:
# For general help:
fauna --help
# For a specific command:
fauna <COMMAND> --help
# For example:
fauna eval --help
To test changes during development, follow these steps:
-
Install the required packages:
yarn install
-
You can run commands in dev in one of two ways:
-
Option 1: Run against the just-in-time built project with development settings:
# Run `fauna cloud-login` in dev: ./bin/dev cloud-login # Run `fauna eval` in dev: ./bin/dev eval
-
Option 2: Run against built assets. Use
yarn link
to place them in your$PATH
as if globally installed:# Build the package and place it in your $PATH: yarn build && yarn link # Run CLI commands using `fauna ...`: fauna eval
-