PlanetScale CLI commands - audit log

Use the PlanetScale CLI to create development branches, open deploy requests, and make non-blocking schema changes directly from your terminal.

Getting Started

Make sure to first set up your PlanetScale developer environment. Once you've installed the pscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.

The audit log command

Lists all audit logs in an organization. The user running the command must have Organization-level permissions, specifically list_organization_audit_logs.


pscale audit-log <SUB-COMMAND> <FLAG>

Available sub-commands

listList all audit logs in an organization

Available flags

-h, --helpView help for audit-log command
--actionFilter based on action type
--limit intThe number of events to return. Min: 1, Max: 100
--starting-after stringThe ID of the audit log to start after (for pagination)
--org <ORGANIZATION_NAME>The organization for the current user

Global flags

--api-token <TOKEN>The API token to use for authenticating against the PlanetScale API.
--api-url <URL>The base URL for the PlanetScale API. Default is
--config <CONFIG_FILE>Config file. Default is $HOME/.config/planetscale/pscale.yml.
--debugEnable debug mode.
-f, --format <FORMAT>Show output in a specific format. Possible values: human (default), json, csv.
--no-colorDisable color output.
--service-token <TOKEN>The service token for authenticating.
--service-token-id <TOKEN_ID>The service token ID for authenticating.


The list sub-command with --org flag


pscale audit-log list --org <ORGANIZATION_NAME>


 ID (25)      ACTOR (25)  ACTION                   EVENT                     REMOTE IP      LOCATION         CREATED AT
------------- ----------- ------------------------ ------------------------ --------------- ---------------- ------------
xxxxxxxxxx  Name        Open_web_console main    branch.open_web_console   Los Angeles, CA  1 day ago


Use the ID from the last result and pass it as the --starting-after to retrieve the next page of results.

pscale audit-log list --limit 5 --starting-after <ID>

Need help?

Get help from the PlanetScale support team, or join our GitHub discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on
Help us improve this page