New protocol version released: This page may contain outdated information.
The HAIP CLI can be configured using environment variables, configuration files, and command-line options. This page covers all configuration options and best practices.
# Verbose outputnode dist/index.js --verbose connect ws://localhost:8080# Help for specific commandnode dist/index.js connect --help# Version informationnode dist/index.js --version
# Store tokens securelyexport HAIP_DEFAULT_TOKEN=$(cat ~/.haip/token)# Use different tokens for different environmentsexport HAIP_DEV_TOKEN=dev-tokenexport HAIP_STAGING_TOKEN=staging-tokenexport HAIP_PROD_TOKEN=prod-token# Rotate tokens regularly# Update tokens in configuration files and environment variables
# Use secure connections in productionexport HAIP_DEFAULT_URL=wss://prod.example.com:443# Use secure tokensexport HAIP_DEFAULT_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...# Validate server certificatesexport HAIP_VERIFY_SSL=true
# Show current environment variablesenv | grep HAIP# Show configuration file contentscat ~/.haip/config.json# Test configurationnode dist/index.js info
# Good: Use environment variables for tokensexport HAIP_DEFAULT_TOKEN=your-secret-token# Bad: Hardcode tokens in scriptsnode dist/index.js send text "Hello" --token hardcoded-token
4. Use Different Configurations for Different Environments
Copy
# Good: Environment-specific configurationshaip-env dev # Switch to developmenthaip-env staging # Switch to staginghaip-env prod # Switch to production
# Good: Validate configuration before usenode dist/index.js health --url $HAIP_DEFAULT_URL# Good: Test connection with current configurationnode dist/index.js connect $HAIP_DEFAULT_URL --timeout 5000