Authentication
The Tektii CLI requires an API key to authenticate with the platform. This guide covers how to configure authentication.
Get Your API Key
- Log in to your Tektii account
- Navigate to Settings → API Keys
- Click Create New Key
- Copy the key and store it securely
The API key is only shown once when created. Store it securely as you cannot retrieve it later.
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
Using the environment variable is recommended because:
- You don't need to include the key in every command
- The key won't appear in your shell history
- It's easier to rotate keys across multiple terminals
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:
- You've set the
TEKTII_API_KEYenvironment variable, OR - You're passing
--api-keyon 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:
- Create a new API key in Settings → API Keys
- Make sure you copied the entire key
- Check there are no extra spaces or quotes
Connection refused
The CLI can't reach the API server:
- Check your internet connection
- Verify the
--api-urlsetting is correct - Check if a firewall is blocking the connection
Next Steps
- Installation - Install the CLI if you haven't already
- Troubleshooting - Common errors and fixes
- Read Workflow - List strategies and download results