auth_cli_pair
Mint a short-lived smt_ API key for ephemeral environments (hosted coding environments, sandboxes, containers). somewhere auth set takes the returned key through standard input or the command environment as SOMEWHERE_TOKEN. The CLI verifies and stores it, so the session can use the CLI without a browser login. Positional tokens are refused; the key does not belong in command arguments or chat.
Returns: { id, key: "smt_...", prefix, name, kind: "cli_pair", expires_at, ttl_seconds }. Key auto-expires in 24h; the next session takes a new key. No refresh token is returned here: the pairing response omits the long-lived refresh credential. somewhere auth login gives a CLI session that renews itself; it stores its credentials directly in the CLI config.
For a shell without CLI credentials. The CLI is the scoped package @somewhere-cloud/cli (npm i -g @somewhere-cloud/cli). After pairing, first-class CLI commands cover routine work and somewhere call <tool> '<json>' covers the complete platform tool catalog. Without a shell, the MCP tools are the path.
Security note: scoped to the same user as the caller. Auditable as kind='cli_pair' separately from your main developer key, so a stolen ephemeral token is revocable on its own.
Example flow (run once per session):
1. Call auth_cli_pair() → { key: "smt_...", expires_at: "..." }
2. Set SOMEWHERE_TOKEN to the returned key in the command environment.
3. Run: somewhere auth set // reads SOMEWHERE_TOKEN
4. Run: somewhere whoami // confirms identity
5. somewhere deploy // deploy raw sourceTool 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_cli_pair"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Optional short label that ends up in the key name for audit trail (e.g. "web-sandbox", "codespace-1234"). Defaults to "ephemeral". Max 40 chars; non-alphanumeric stripped. |