Authentication

The Tektii CLI requires an API key to authenticate with the platform. This guide covers how to configure authentication.

Get Your API Key

  1. Log in to your Tektii account
  2. Navigate to Settings → API Keys
  3. Click Create New Key
  4. Copy the key and store it securely

Configure the CLI

There are two ways to authenticate the CLI: environment variable (recommended) or command-line flag.

Environment Variable (Recommended)

Set the TEKTII_API_KEY environment variable in your shell:

export TEKTII_API_KEY="your-api-key"

To make this permanent, add the export line to your shell profile:

# For bash
echo 'export TEKTII_API_KEY="your-api-key"' >> ~/.bashrc
source ~/.bashrc

# For zsh
echo 'export TEKTII_API_KEY="your-api-key"' >> ~/.zshrc
source ~/.zshrc

Command-Line Flag

Alternatively, pass the key with the --api-key flag on each command:

tektii --api-key "your-api-key" strategy list

Test Your Connection

Once configured, verify your authentication works:

tektii strategy list

If authenticated correctly, you'll see a list of your strategies (or an empty list if you haven't created any yet).

API URL Configuration

By default, the CLI connects to https://api.tektii.com. You can override this for development or self-hosted instances:

# Via environment variable
export TEKTII_API_URL="https://custom-api.example.com"

# Via flag
tektii --api-url "https://custom-api.example.com" strategy list

Troubleshooting

"API key not found"

This error means the CLI couldn't find your API key. Make sure:

  1. You've set the TEKTII_API_KEY environment variable, OR
  2. You're passing --api-key on the command line

Check your environment variable is set:

echo $TEKTII_API_KEY

"Invalid API key"

Your API key may be expired, revoked, or incorrectly copied. Try:

  1. Create a new API key in Settings → API Keys
  2. Make sure you copied the entire key
  3. Check there are no extra spaces or quotes

Connection refused

The CLI can't reach the API server:

  1. Check your internet connection
  2. Verify the --api-url setting is correct
  3. Check if a firewall is blocking the connection

Next Steps