Application Commands
Commands for managing OAuth applications registered in SharkAuth. Each application has a client_id and client_secret used in standard OAuth 2.0 flows.
All commands require a running server and admin credentials:
shark app list
List all OAuth applications.
Synopsis
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Emit JSON response |
Examples
shark app create
Create a new OAuth application. The client_secret is shown only once.
Synopsis
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--name | string | (required) | Application name |
--callback | string[] | (none) | Allowed callback URL (repeatable) |
--logout | string[] | (none) | Allowed logout URL (repeatable) |
--origin | string[] | (none) | Allowed CORS origin (repeatable) |
--json | bool | false | Emit created app as JSON |
URL validation rejects dangerous schemes (javascript:, file:, data:, vbscript:). Both https:// and custom mobile app schemes (e.g. myapp://) are accepted.
Examples
Gotchas
client_secretis shown exactly once. Store it immediately.- The default application (created on first boot) cannot be deleted.
shark app show
Show details of a single application. Accepts either the internal id or the client_id.
Synopsis
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Emit full application object as JSON |
Examples
shark app update
Update an application's name and/or allowed URLs. Use --add-* and --remove-* to mutate URL lists rather than replacing them wholesale.
Synopsis
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--name | string | (none) | New application name |
--add-callback | string[] | (none) | Add a callback URL |
--remove-callback | string[] | (none) | Remove a callback URL |
--add-logout | string[] | (none) | Add a logout URL |
--remove-logout | string[] | (none) | Remove a logout URL |
--add-origin | string[] | (none) | Add an origin |
--remove-origin | string[] | (none) | Remove an origin |
Examples
Gotchas
- The command fetches the current application state first, then applies mutations client-side, then sends a full PATCH. This means concurrent updates could race — serialize updates to the same application.
- URL validation (same rules as
app create) runs on all--add-*values.
shark app delete
Delete an application (destructive — irreversible).
Synopsis
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--yes | bool | false | Skip confirmation prompt |
Examples
Gotchas
- The default application (
is_default: true) cannot be deleted. The command exits with an error if attempted.
shark app rotate-secret
Generate a new client_secret for an application. The old secret is immediately invalid.
Synopsis
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--json | bool | false | Emit {"client_id":"...","secret":"...","rotated_at":"..."} |
Examples
Gotchas
- The new
client_secretis shown exactly once. Update all consumers of the old secret before they next authenticate. - The
rotated_attimestamp is included in the JSON response for audit purposes.