Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now in beta.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

fauna delete-key

Delete a database key.

Syntax

fauna delete-key <KEY_NAME> [--[no-]color ] [--endpoint <value>]
  [--environment <value>] [--secret <value>] [--timeout <value>]
  [--url <value>]

Description

The delete-key command deletes a key.

Arguments

Argument Description

<KEY_NAME>

Name of the key to delete.

Options

Option Description

--[no-]color

Enables or disables color formatting for the output. Color formatting is enabled by default if the terminal supports it (determined using chalk/supports-color). Use --no-color to disable.

--endpoint

Connection endpoint from .fauna-shell.

--environment

Environment to use, from a Fauna project.

--help

Help for create-database command.

--secret

Authentication secret. Overrides the secret in .fauna-shell.

Use a scoped key to interact with a child database using a parent database’s admin key.

For example, with a parent database’s admin key secret of fn123, you can access a child database by appending the child database name and role: fn123:childDB:admin.

--timeout

Connection timeout (milliseconds).

--url

Database URL. Overrides the URL in .fauna-shell.

Example

There are already four keys for this example:

fauna list-keys

The response includes each key’s ID, database, and role. It doesn’t include the key’s secret:

Key ID               Database             Role
259718958404338186   prod                 server
259719743570706945   prod                 client
265528117038154259   childDB              admin
265437820880945683   childDB              admin

Now, delete the first key in the list:

fauna delete-key 259718958404338186

List the keys again:

fauna list-keys

The key you deleted is now gone:

Key ID               Database             Role
259719743570706945   prod                 client
265528117038154259   childDB              admin
265437820880945683   childDB              admin

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!