Skip to content

auth Command

The auth command manages local authentication state and stored API keys per-organization. Use this command to check your authentication status, manage credentials for multiple organizations, and troubleshoot login issues.

Shows detailed authentication status including active organization, stored credentials, and any warnings.

Terminal window
pakyas auth status
  • Environment variable override warning (if PAKYAS_API_KEY is set)
  • Active organization info
  • Default project info
  • Stored credentials summary (per-org keys with preview)
  • Legacy key warnings (if migrating from V1)
Authentication Status
=====================
Active Org: acme-corp (org_abc123)
Default Project: production-api (proj_xyz789)
Stored Credentials:
org_abc123 (acme-corp): pk_live_abc1... (added 2024-01-15, verified 2024-01-20)
org_def456 (staging): pk_test_def4... (added 2024-01-10, never verified)

Authenticate with Pakyas. Supports browser-based OAuth, API key, or interactive email/password login.

Terminal window
pakyas login [--api-key KEY] [--no-browser]
FlagDescription
--api-key <KEY>Login with API key directly (skips browser auth)
--no-browserSkip browser and use email/password interactively
Terminal window
# Browser-based login (default)
pakyas login
# Login with API key (useful for CI/CD)
pakyas login --api-key pk_live_abc123...
# Interactive email/password login
pakyas login --no-browser

Clear the active session and authentication state.

Terminal window
pakyas logout
Terminal window
pakyas logout
# Output: Logged out successfully

Show the currently authenticated user and organization.

Terminal window
pakyas whoami
Terminal window
pakyas whoami
# Output: Authenticated as: jane@example.com (Acme Corp)

Lists all locally stored API keys by organization.

Terminal window
pakyas auth key list
  • Organization ID
  • Key preview (first 12 characters)
  • Label (device name + date)
  • Added timestamp
  • Last verified timestamp
Terminal window
pakyas auth key list
# Output:
# Org ID Key Preview Label Added Verified
# org_abc123 pk_live_abc1... MacBook Pro (2024) 2024-01-15 2024-01-20
# org_def456 pk_test_def4... CI Server 2024-01-10 never

Import or store an API key for a specific organization.

Terminal window
pakyas auth key set --org <ORG_ID> [--key <KEY>]
FlagDescription
--org <ORG_ID>Organization ID to set key for (required)
--key <KEY>API key to store (prompts if not provided)
  1. Prompts for key if --key not provided
  2. Validates key format (pk_ prefix, minimum length)
  3. Validates key belongs to specified org via API call
  4. Stores key with device label for identification
Terminal window
# Set key interactively (prompts for key)
pakyas auth key set --org org_abc123
# Set key directly
pakyas auth key set --org org_abc123 --key pk_live_abc123...
# Set key for a second organization (multi-org setup)
pakyas auth key set --org org_def456 --key pk_test_def456...

Verify that a stored API key is still valid.

Terminal window
pakyas auth key verify [--org <ORG_ID>]
FlagDescription
--org <ORG_ID>Organization ID to verify key for (uses active org if not specified)
  1. Retrieves stored key for the organization
  2. Calls API to validate the key
  3. Updates last_verified timestamp on success
Terminal window
# Verify key for active organization
pakyas auth key verify
# Verify key for specific organization
pakyas auth key verify --org org_abc123

Remove a stored API key.

Terminal window
pakyas auth key rm (--org <ORG_ID> | --legacy) [-y]
FlagDescription
--org <ORG_ID>Organization ID to remove key for
--legacyRemove the legacy (unmigrated) API key from V1
-y, --yesSkip confirmation prompt

Note: --org and --legacy are mutually exclusive. You must specify one or the other.

Terminal window
# Remove key for specific organization (with confirmation)
pakyas auth key rm --org org_abc123
# Remove key without confirmation
pakyas auth key rm --org org_abc123 -y
# Remove legacy V1 key during migration
pakyas auth key rm --legacy

Credentials are stored locally at ~/.config/pakyas/credentials.json using the V2 format, which supports per-organization API keys.

PlatformPath
Linux/macOS~/.config/pakyas/credentials.json
  • Per-organization API keys (supports multiple orgs)
  • Key metadata (label, timestamps)
  • Automatic migration from V1 single-key format
  • Legacy key preserved during migration