auth_login
Save a Splits API key as the active local workspace or start a browser login to connect or create a workspace; keys stay out of output.
Instructions
Save a Splits API key as a workspace in the local config (~/.splits/config.json, mode 0600) and make it the active workspace. Without --api-key or stdin, starts a browser login: it opens an approval page where the person connects an existing workspace or creates a new one, waits up to 10 minutes for the approval, and saves the key it receives. The key never appears in the output. With a key, the key is checked against the API first. The workspace is named after its org unless --name is given; logging in again to the same org refreshes that workspace. Other workspaces and local keys are never removed. The browser login prints a code that the person must type on the page, so an agent that cannot show the person this command's output while it waits (under MCP, or running it in a shell tool) uses auth login-start and auth login-status instead. Saved keys are only used when the SPLITS_API_KEY env var is not set — env always wins.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "auth_login"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Saved local key that proves this agent in a browser login, and becomes the treasury signer if the person creates a workspace. Without it, the login uses a new key, which is saved under the workspace's name after approval, whether the person connects or creates a workspace. | |
| name | No | Workspace alias. Defaults to the org name in lowercase with dashes. An existing workspace with this alias is replaced. | |
| apiKey | No | API key value. Refused under MCP mode; prefer stdin for secrets. | |
| clientName | No | Required for a browser login, ignored when an API key is given. The name of the app the person is using to talk to you, as they would recognise it: for example `Claude Code`, `Claude Desktop`, `Codex`, `Cursor` or `ChatGPT`. Use the product name, not the model name (not "Claude Opus"), not the person's name, and not "Splits CLI". The person sees it on the approval page before approving, and the API key is named after it. |