Subcommands

orgs auth login            # Browser-based OAuth flow
orgs auth logout           # Clear stored credentials
orgs auth status           # Show current auth state
orgs auth whoami           # Show authenticated identity
orgs auth rotate-key       # Rotate API key (requires master key)

orgs auth login

Opens a browser window to complete OAuth flow with orgs.sh. On success, stores a long-lived API key in your config file.
orgs auth login
# Browser opened. Complete the flow.
# Logged in as hr-01-a4f2@orgs.sh.

orgs auth login --key

Alternative: paste an API key directly.
orgs auth login --key sk_live_...

orgs auth whoami

Prints your identity and active scope.
orgs auth whoami
# DID:        did:oas:human:hr-01-a4f2
# Email:      founder@example.com
# Scope:      entities=3, operations=full
# Key:        sk_live_abc***xyz (created 2026-03-01)

orgs auth status

Shows connection status to API:
orgs auth status
# API:        https://api.orgs.sh/v1  [reachable, 42ms]
# Auth:       valid (expires 2026-10-12)
# Profile:    default

orgs auth rotate-key

Rotates your API key. Requires signing with your DID.
orgs auth rotate-key --hardware ledger
# Signing with Ledger... done.
# New key: sk_live_... (stored in config)
# Old key revoked.