Skip to main content

signaloid-cli auth

Authenticate with Signaloid Cloud Compute Engine and manage credentials.

Synopsis​

signaloid-cli auth <command> [options]

Description​

The auth command group allows you to authenticate with the Signaloid Cloud Compute Engine using either an API key or email/password credentials. It also provides commands to check your current authentication status and log out.

Commands​

Configuration​

Config File Location​

Credentials are stored in:

  • macOS: ~/Library/Application Support/signaloid-cli/config.json
  • Linux: ~/.config/signaloid-cli/config.json
  • Windows: %APPDATA%\signaloid-cli\config.json

Set the SIGNALOID_CONFIG_DIR environment variable to use a different directory. The CLI restricts the config directory to your user account (permissions 0700). The CLI creates config.json itself with your default file permissions.

Config File Format​

{
"auth": {
"mode": "apikey",
"apiKey": "scce_1234567890abcdef"
}
}

After an email and password login, the CLI stores the session token, not the email address or the password:

{
"auth": {
"mode": "jwt",
"token": "eyJraWQiOi..."
}
}

Exit Codes​

CodeDescription
0Success
1Error, including no stored credentials (not logged in)
2Usage error, such as an invalid email address
3The API rejected the stored credentials, for example an expired or deleted API key

Security​

Best Practices​

  • ✓ Use API keys for automation and CI/CD
  • ✓ Store API keys in environment variables or secrets managers
  • ✓ Rotate API keys regularly
  • ✓ Never commit API keys to version control
  • ✓ Use different API keys for different environments

CI/CD Integration​

GitHub Actions:

- name: Authenticate with Signaloid
env:
SIGNALOID_API_KEY: ${{ secrets.SIGNALOID_API_KEY }}
run: |
signaloid-cli auth login --api-key $SIGNALOID_API_KEY
signaloid-cli auth whoami

GitLab CI:

before_script:
- signaloid-cli auth login --api-key $SIGNALOID_API_KEY
- signaloid-cli auth whoami

Script with Error Handling​

#!/bin/bash

API_KEY="${SIGNALOID_API_KEY}"

if [ -z "$API_KEY" ]; then
echo "Error: SIGNALOID_API_KEY not set"
exit 1
fi

# Authenticate
if signaloid-cli auth login --api-key "$API_KEY"; then
echo "✓ Authentication successful"
else
echo "✗ Authentication failed"
exit 1
fi

# Verify
if signaloid-cli auth whoami > /dev/null 2>&1; then
echo "✓ Credentials valid"
EMAIL=$(signaloid-cli auth whoami | jq -r '.Username')
echo "Logged in as: $EMAIL"
else
echo "✗ Invalid credentials"
exit 1
fi

Troubleshooting​

"Authentication failed" Error​

Problem: Login fails with authentication error.

Solutions:

  1. Verify your API key is correct
  2. Check for extra spaces or newlines in the key
  3. Generate a new API key from signaloid.io/settings/api
  4. Verify network connectivity

"Invalid email address" Error​

Problem: Email validation fails during login.

Solutions:

  1. Ensure email is in correct format: user@example.com
  2. Check for typos
  3. Do not include spaces before or after email

"API key cannot be empty" Error​

Problem: Attempting to login with empty API key.

Solutions:

  1. Verify environment variable is set: echo $SIGNALOID_API_KEY
  2. Check for quote issues in shell
  3. Ensure API key is passed correctly

See Also​

Learn More​