/ flydocs auth

Store a FlyDocs API key globally for CLI authentication.

Synopsis

terminal
flydocs auth [key]

Validates and stores an API key at the global credential location (~/.flydocs/credentials). Use this to set up or rotate your API key without reinitializing your project.

Arguments

Argument Type Description
key string API key (fdk_...). If omitted, prompts interactively.

What It Does

  1. Validates format by checking the key starts with the fdk_ prefix
  2. Validates against the relay API to confirm the key is active and authorized
  3. Stores the key at ~/.flydocs/credentials with 600 file permissions (owner read/write only)
  4. Fetches workspace ID associated with the key and stores it alongside the credential

The global credential file is the default location used by all FlyDocs commands. Project-scoped credentials (created via flydocs init --project-key) take priority when present.

Examples

Store a key interactively:

terminal
flydocs auth

Store a key directly:

terminal
flydocs auth fdk_abc123def456

Related Commands