Authentication
The SDK supports two authentication methods for connecting to ZeyOS instances:
1. Environment Variables (Recommended for CI/CD)
Environment variables are the recommended method for CI/CD environments and automated workflows.
# Set environment variables
ZEYSDK_TOKEN=your_token
ZEYSDK_SERVER=https://cloud.zeyos.com/your_instance
# Run commands
zeysdk [command]
Platform-Specific Commands
Windows CMD:
set ZEYSDK_TOKEN=your_token && set ZEYSDK_SERVER=https://cloud.zeyos.com/your_instance && zeysdk [command]
Windows PowerShell:
$env:ZEYSDK_TOKEN="your_token"; $env:ZEYSDK_SERVER="https://cloud.zeyos.com/your_instance"; zeysdk [command]
Linux/macOS:
export ZEYSDK_TOKEN=your_token && export ZEYSDK_SERVER=https://cloud.zeyos.com/your_instance && zeysdk [command]
2. Stored Credentials (Default for local development)
For local development, the SDK uses stored credentials by default.
# Link your instance first
zeysdk link
# Then run commands
zeysdk [command]
Authentication Priority
Environment variables take precedence over stored credentials. When both are available, the SDK will use the environment variables.
Security Notes
- Tokens are stored securely using system keychain
- Environment variables are cleared when the terminal session ends
- Stored credentials persist between sessions
- Use environment variables for CI/CD to avoid storing credentials
- Use stored credentials for local development convenience
Error Handling
| Error | Description | Resolution |
|---|---|---|
| Missing token | No authentication provided | Set environment variables or run zeysdk link |
| Invalid token | Bad credentials | Check token validity |
| Server error | Invalid server URL | Verify server URL format |
| Network error | Connection failed | Check connectivity |