Skip to content

fauna/fauna-shell

Repository files navigation

Fauna CLI v4 (beta)

Important

v4 of the Fauna CLI is in beta. For the latest GA version, see the Fauna CLI v3 docs.

The Fauna CLI lets you access Fauna from your terminal. You can use the CLI to:

fauna-cli

Requirements

Quick start

To get started:

  1. Install the CLI:

    npm install -g fauna-shell@">=4.0.0-beta"
  2. If you're using bash or zsh, enable auto-complete by appending the output of fauna completion to your .bashrc, .bash_profile, .zshrc, or .zprofile. For example:

    fauna completion >> ~/.zshrc
  3. Authenticate with Fauna:

    fauna login
  4. Run CLI commands. Specify a --database, including the Region Group and hierarchy, to run the command in. For example:

    # Runs a query in the top-level 'my_db' database
    # in the 'us' Region Group. Use the default admin role.
    fauna query "Collection.all()" \
      --database us/my_db

Installation

During the beta, you can install v4 of the Fauna CLI globally using npm:

npm install -g fauna-shell@">=4.0.0-beta"

Documentation

For usage instructions and a full list of commands, see the Fauna docs.

You can also access help directly in the CLI:

# For general help:
fauna --help

# For a specific command:
fauna <command> --help
# For example:
fauna query --help

Contributions and development

See the contribution guidelines.