OAuth Management
The MachineMetrics CLI provides commands to manage OAuth clients for your applications.
OAuth Command
mmdev oauth [subcommand]
Manages OAuth clients for your MachineMetrics applications.
Available Subcommands
| Command | Description |
|---|---|
dev-init | Create a new OAuth client for local development |
dev-reset | Clear local development OAuth client information |
dev-apply | Apply the local development OAuth client to the current project |
add [options] | Create a new OAuth client |
list [options] | List your OAuth clients (paginated) |
update [options] | Update an existing OAuth client's name and redirect URIs |
Options for add
| Option | Description |
|---|---|
-n, --name <name> | Name of the client (required) |
-r, --redirect <redirect> | Comma-separated redirect URIs (required) |
-h, --help | Display help for command |
Options for list
| Option | Description |
|---|---|
-o, --offset <offset> | Pagination offset (default 0) |
-l, --limit <limit> | Page size (default 20) |
-h, --help | Display help for command |
Options for update
All three options are required: update replaces the client's name and its redirect
URI list in one call, so re-supply the full redirect list even when you only want to rename.
| Option | Description |
|---|---|
-i, --client-id <clientId> | Client ID to update (find it with list) |
-n, --name <name> | New name of the client |
-r, --redirect <redirect> | Comma-separated redirect URIs |
-h, --help | Display help for command |
The client name is what end users see in the authorization prompt when they first launch
your application, so update is how you control that branding.
Usage Examples
-
Initialize local development OAuth client:
mmdev oauth dev-init -
Reset local development OAuth client:
mmdev oauth dev-reset -
Add a new OAuth client:
mmdev oauth add --name "My App" --redirect "http://localhost:3000/callback,https://myapp.com/callback" -
Find a client's ID:
mmdev oauth list -
Rename a client (keeping its redirect URIs):
mmdev oauth update --client-id <clientId> --name "My App (Production)" --redirect "https://myapp.com/callback"