The nile config
command helps you manage your CLI configuration settings. This guide covers all configuration options and their usage.
The configuration system supports:
- Viewing current settings
- Setting individual values
- Setting multiple values at once
- Resetting to defaults
- Environment variable overrides
Viewing Configuration
View your current configuration settings:
Setting API Key
Set your API key for authentication:
nile config --api-key <key>
Examples
# Set API key
nile config --api-key sk_test_1234...
# Set API key from environment variable
export NILE_API_KEY=sk_test_1234...
nile config
Setting Workspace
Set your default workspace:
nile config --workspace <name>
Examples
# Set default workspace
nile config --workspace development
# Set workspace and verify
nile config --workspace production
nile workspace show
Setting Database
Set your default database:
Examples
# Set default database
nile config --db customer-db
# Set database and verify
nile config --db myapp-db
nile db show
Setting Multiple Configurations
Set multiple configuration values at once:
nile config --api-key <key> --workspace <name> --db <name>
Examples
# Set API key and workspace
nile config --api-key sk_test_1234... --workspace development
# Set workspace and database
nile config --workspace staging --db test-db
# Set all main configurations
nile config --api-key sk_test_1234... --workspace production --db prod-db
Resetting Configuration
Reset all settings to their default values:
Examples
# Reset all configurations
nile config reset
# Reset and verify
nile config reset
nile config
Environment Variables
All configuration settings can be set using environment variables:
# Authentication
export NILE_API_KEY=sk_test_1234...
# Workspace and Database
export NILE_WORKSPACE=development
export NILE_DB=myapp-db
# Host Configuration
export NILE_DB_HOST=custom.db.host
export NILE_GLOBAL_HOST=custom.global.host
Configuration Precedence
Settings are applied in the following order (highest to lowest priority):
- Command-line flags
- Environment variables
- Configuration file
- Default values
# Environment variable set
export NILE_WORKSPACE=production
# Command-line flag overrides environment
nile config --workspace development
# Result: workspace is set to "development"
Common Issues
Invalid API Key
When API key is invalid:
# Set invalid API key
nile config --api-key invalid_key
Error: Invalid API key format
# Solution: Use valid API key
nile config --api-key sk_test_1234...
Workspace Not Found
When workspace doesn’t exist:
# Set non-existent workspace
nile config --workspace nonexistent
Error: Workspace 'nonexistent' not found
# Solution: List available workspaces
nile workspace list
Database Not Found
When database doesn’t exist:
# Set non-existent database
nile config --db nonexistent
Error: Database 'nonexistent' not found
# Solution: List available databases
nile db list
Best Practices
-
Environment-specific Configurations:
# Development
nile config --workspace dev --db dev-db
# Production
nile config --workspace prod --db prod-db
-
Configuration Verification:
# Set and verify
nile config --workspace development
nile workspace show
-
Security Best Practices:
# Store API key in environment
export NILE_API_KEY=sk_test_1234...
# Use configuration file for non-sensitive settings
nile config --workspace development --db dev-db
nile workspace
- Manage workspaces
nile db
- Manage databases
nile connect
- Authentication management
nile tenants
- Tenant management