Getting started
This getting started guide shows you how to:
-
Create an authentication key that allows you to use
fauna-shell
to interact with a database. -
Define a configuration file endpoint.
-
Display the configuration file.
-
Start
Fauna Shell
.
After starting Fauna Shell
, experiment with the available
commands to gain familiarity with Fauna Shell
.
Create a key
-
Log in to your Fauna account using your email and password.
-
Choose the Explorer menu item.
-
Hover over the database name you want and click the key icon.
-
Click the CREATE-KEY button.
-
Choose Admin or Server Role and enter an optional Key Name.
-
Click the SAVE button.
-
Copy the KEY’S SECRET, which is needed to configure an endpoint.
This is the only time Fauna displays the secret field, which is equivalent to a password. Fauna cannot recover a secret that is discarded or lost. Copy and save the secret to a password manager or other safe location.
You can now access and query your database using fauna-shell
.
Define a configuration endpoint
Use the cloud-login
command to create a default
configuration endpoint in the fauna-shell
configuration file.
-
Open a terminal window on your local host.
-
Run the
cloud-login
command and enter Return to add acloud
definition to your configuration file.:fauna cloud-login ? The endpoint alias prefix (to combine with a region): cloud
The cloud configuration defaults to the
db.fauna.com
endpoint. -
At the prompt for an authentication method, enter Return to choose
Secret
as the authentication method:? How do you prefer to authenticate? Email and Password ❯ Secret
-
At the prompt, paste the key that you created in the preceding step and enter Return.
-
In response to the region prompt, choose a region and enter Return.
Select a region (Use arrow keys) ❯ Classic Europe (EU) United States (US)
-
Enter Return to accept the default,
Y
, and acceptcloud
as the default endpoint:? Would you like endpoint 'cloud' to be default? (Y/n) Y
Display the configuration file
To view the updated configuration file on Linux, macOS, and Unix-like operating systems, enter:
cat $HOME/.fauna-shell
On a Windows operating system, enter:
type %userprofile%\.fauna-shell
Next steps
Go to the Topics and commands documentation to become familiar with the individual Fauna Shell command syntax.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!