Documentation
SharkAuth CLI — Overview
The shark binary is the operator's single interface for managing the SharkAuth identity server: starting the server, inspecting state, managing users, agents, applications, API keys, audit logs, and runtime configuration.
Authentication
Most commands that call the admin API require two things:
| What | Flag | Environment variable | Default |
|---|---|---|---|
| Server URL | --url | SHARK_URL | http://localhost:8080 |
| Admin token | --token | SHARK_ADMIN_TOKEN | (none — required) |
The first-boot admin API key is written to admin.key.firstboot beside the database file. Set it as SHARK_ADMIN_TOKEN before running any management command.
Global Flags
These flags are available on every command:
| Flag | Default | Description |
|---|---|---|
--url | http://localhost:8080 | Base URL of the running shark instance |
--token | (env) | Admin API token |
--verbose / -v | false | Enable debug-level logging to stderr |
Output Modes
- Human-readable (default): tabular or inline key/value output suitable for terminals.
--json: emits structured JSON to stdout. Supported on most subcommands. Errors in JSON mode are written to stderr as{"error":"code","message":"..."}.
Command Pattern
shark <noun> <verb> [flags] [args]
Examples:
Command Groups
| Group | Commands |
|---|---|
| Server | serve, health, version, doctor, mode, reset |
| Debug | debug decode-jwt |
| Identity | user, agent, api-key, consents |
| Applications | app |
| Audit | audit |
| Demo | demo |
| Admin | admin, branding, auth, keys, whoami |
| Utility | cli, completion |