Skip to main content

Usage

toolshed login [--server <url>]
OptionDefaultDescription
-s, --server <url>http://localhost:3000Toolshed server URL

How it works

  1. The CLI starts a temporary HTTP server on a random local port
  2. Opens your browser to the Toolshed server’s /api/auth/cli-login endpoint, passing the local callback URL
  3. The server generates a user ID and session token, then redirects back to the CLI’s callback
  4. The CLI saves the credentials to ~/.toolshed/config.json and exits

Example

$ toolshed login --server http://localhost:3001
Logging in to http://localhost:3001...
Opening browser to authenticate...
Logged in as user_f7c469e8

Config file

After login, credentials are stored in ~/.toolshed/config.json:
{
  "serverUrl": "http://localhost:3001",
  "userId": "user_f7c469e8",
  "sessionToken": "..."
}
This file is used by toolshed serve, toolshed connect, and toolshed status.

If already logged in

Running login again will print the current session and exit. To log in to a different server, delete ~/.toolshed/config.json first.