CLI Configuration
CLI Configuration
Section titled “CLI Configuration”OstrichDB CLI provides various configuration options to customize the database management experience. This guide covers all available settings, how to modify them, and best practices for different use cases.
Configuration Overview
Section titled “Configuration Overview”Configuration System
Section titled “Configuration System”OstrichDB uses a built-in configuration system that allows you to:
- Customize behavior: Modify how the CLI operates
- Optimize performance: Adjust settings for your use case
- Control features: Enable or disable specific functionality
- Set preferences: Personalize the user experience
Configuration Storage
Section titled “Configuration Storage”Configurations are stored in:
- Location:
.ostrichdb/configs/
directory - Format: Internal binary format
- Scope: Per-user settings
- Persistence: Settings survive restarts
Available Configurations
Section titled “Available Configurations”HELP_IS_VERBOSE
Section titled “HELP_IS_VERBOSE”Controls the verbosity of help information.
Default: false
Values: true
or false
Description:
false
: Simple, concise help messagestrue
: Detailed help with examples and explanations
Examples:
# Enable verbose helpSET CONFIG HELP_IS_VERBOSE TO true
# Disable verbose help (default)SET CONFIG HELP_IS_VERBOSE TO false
# Test the differenceHELP NEW
With verbose help enabled:
OstrichDB> HELP NEWNEW - Create new collections, clusters, records, or users
SYNTAX: NEW <location> # Create structure only NEW <location> OF_TYPE <type> # Create with type NEW <location> OF_TYPE <type> WITH <value> # Create with type and value NEW USER # Create user account
EXAMPLES: NEW users.staff.alice # Creates collection, cluster, record NEW products.count OF_TYPE INTEGER # Creates typed record NEW blog.title OF_TYPE STRING WITH "My Blog" # Creates with value NEW USER # Interactive user creation
RELATED COMMANDS: FETCH, ERASE, RENAME, SET
With verbose help disabled:
OstrichDB> HELP NEWNEW - Create new collections, clusters, records, or usersSyntax: NEW <location> [OF_TYPE <type>] [WITH <value>] NEW USER
SUPPRESS_ERRORS
Section titled “SUPPRESS_ERRORS”Controls whether error messages are displayed.
Default: false
Values: true
or false
Description:
false
: Show all error messages (recommended)true
: Hide error messages (not recommended)
Examples:
# Show errors (default, recommended)SET CONFIG SUPPRESS_ERRORS TO false
# Hide errors (use with caution)SET CONFIG SUPPRESS_ERRORS TO true
# Test with invalid commandNEW invalid.type OF_TYPE WRONG_TYPE WITH value
With errors shown:
OstrichDB> NEW test.record OF_TYPE INVALID_TYPE WITH valueError: Invalid data type 'INVALID_TYPE'Supported types: STRING, INTEGER, FLOAT, BOOLEAN, CHAR, DATE, TIME, DATETIME, UUID, NULL, []STRING, []INTEGER, []FLOAT, []BOOLEAN, []CHAR, []DATE, []TIME, []DATETIME, []UUID
With errors suppressed:
OstrichDB> NEW test.record OF_TYPE INVALID_TYPE WITH value# No error message shown, operation fails silently
Use Cases:
- Development: Keep
false
for debugging - Production scripts: Consider
true
for cleaner output - Learning: Always use
false
to understand issues
LIMIT_HISTORY
Section titled “LIMIT_HISTORY”Controls whether command history is limited to 100 entries.
Default: true
Values: true
or false
Description:
true
: Limit history to 100 most recent commandsfalse
: Keep unlimited command history
Examples:
# Limit history (default)SET CONFIG LIMIT_HISTORY TO true
# Unlimited historySET CONFIG LIMIT_HISTORY TO false
# Check current historyHISTORY
Performance Considerations:
- Limited history: Uses less memory, faster startup
- Unlimited history: Uses more memory, complete command record
Recommendations:
- Development: Use
false
for complete history - Production: Use
true
for memory efficiency - Learning: Use
false
to review all commands
AUTO_SERVE
Section titled “AUTO_SERVE”Controls whether the HTTP server starts automatically on login.
Default: true
Values: true
or false
Description:
true
: HTTP server starts when user logs infalse
: HTTP server must be started manually withSERVE
Examples:
# Auto-start server (default)SET CONFIG AUTO_SERVE TO true
# Manual server startSET CONFIG AUTO_SERVE TO false
# Check if server is running (look for server startup message on login)
With auto-serve enabled:
Welcome to OstrichDB!Starting HTTP server...Server running on http://localhost:8080Type 'HELP' for assistance.
OstrichDB>
With auto-serve disabled:
Welcome to OstrichDB!Type 'HELP' for assistance.
OstrichDB>
Use Cases:
- Web development: Enable for immediate API access
- CLI-only usage: Disable to save resources
- Security: Disable if HTTP access isn’t needed
LIMIT_SESSION_TIME
Section titled “LIMIT_SESSION_TIME”Controls whether CLI sessions are limited to 24 hours.
Default: true
Values: true
or false
Description:
true
: User automatically logged out after 24 hoursfalse
: No automatic logout (session persists indefinitely)
Examples:
# Enable session timeout (default)SET CONFIG LIMIT_SESSION_TIME TO true
# Disable session timeoutSET CONFIG LIMIT_SESSION_TIME TO false
With session timeout enabled:
# After 24 hoursSession expired after 24 hours. Please log in again.Login:
Security Considerations:
- Shared systems: Keep
true
for security - Personal systems: Can use
false
for convenience - Production: Always use
true
Configuration Management
Section titled “Configuration Management”Setting Configurations
Section titled “Setting Configurations”Syntax:
SET CONFIG <CONFIG_NAME> TO <VALUE>
Rules:
- Configuration names are case-sensitive
- Values must be exactly
true
orfalse
- Changes take effect immediately
- Settings persist across restarts
Examples:
# Enable verbose helpSET CONFIG HELP_IS_VERBOSE TO true
# Disable auto-serveSET CONFIG AUTO_SERVE TO false
# Enable unlimited historySET CONFIG LIMIT_HISTORY TO false
Viewing Current Settings
Section titled “Viewing Current Settings”Unfortunately, there’s no built-in command to view all current configurations, but you can test their effects:
Test Current Settings:
# Test verbose help settingHELP NEW
# Test error suppression (try invalid command)NEW test OF_TYPE INVALID_TYPE WITH value
# Check history limitHISTORY
# Check auto-serve (restart and see if server starts)RESTART
Configuration Validation
Section titled “Configuration Validation”OstrichDB validates configuration values:
Valid Configuration:
OstrichDB> SET CONFIG HELP_IS_VERBOSE TO trueConfiguration updated: HELP_IS_VERBOSE = true
Invalid Configuration Name:
OstrichDB> SET CONFIG INVALID_CONFIG TO trueError: Unknown configuration 'INVALID_CONFIG'Valid configurations: HELP_IS_VERBOSE, SUPPRESS_ERRORS, LIMIT_HISTORY, AUTO_SERVE, LIMIT_SESSION_TIME
Invalid Configuration Value:
OstrichDB> SET CONFIG HELP_IS_VERBOSE TO yesError: Configuration values must be 'true' or 'false'
Configuration Profiles
Section titled “Configuration Profiles”Development Profile
Section titled “Development Profile”Optimized for development and learning:
# Verbose help for learningSET CONFIG HELP_IS_VERBOSE TO true
# Show all errors for debuggingSET CONFIG SUPPRESS_ERRORS TO false
# Keep full history for referenceSET CONFIG LIMIT_HISTORY TO false
# Auto-start server for web developmentSET CONFIG AUTO_SERVE TO true
# Disable session timeout for convenienceSET CONFIG LIMIT_SESSION_TIME TO false
Production Profile
Section titled “Production Profile”Optimized for production and performance:
# Concise help for efficiencySET CONFIG HELP_IS_VERBOSE TO false
# Show errors for monitoringSET CONFIG SUPPRESS_ERRORS TO false
# Limit history for memory efficiencySET CONFIG LIMIT_HISTORY TO true
# Manual server controlSET CONFIG AUTO_SERVE TO false
# Enable session timeout for securitySET CONFIG LIMIT_SESSION_TIME TO true
Security-Focused Profile
Section titled “Security-Focused Profile”Maximum security settings:
# Standard helpSET CONFIG HELP_IS_VERBOSE TO false
# Show errors for security monitoringSET CONFIG SUPPRESS_ERRORS TO false
# Limit history to reduce data exposureSET CONFIG LIMIT_HISTORY TO true
# No auto-server for attack surface reductionSET CONFIG AUTO_SERVE TO false
# Enforce session timeoutsSET CONFIG LIMIT_SESSION_TIME TO true
Learning Profile
Section titled “Learning Profile”Optimized for learning and experimentation:
# Detailed help for learningSET CONFIG HELP_IS_VERBOSE TO true
# Show all errors to understand issuesSET CONFIG SUPPRESS_ERRORS TO false
# Keep full history to review commandsSET CONFIG LIMIT_HISTORY TO false
# Auto-start server to experiment with APIsSET CONFIG AUTO_SERVE TO true
# No session timeout to avoid interruptionsSET CONFIG LIMIT_SESSION_TIME TO false
Best Practices
Section titled “Best Practices”Configuration Strategy
Section titled “Configuration Strategy”Environment-Based Configuration:
- Development: Verbose, unlimited history, auto-serve
- Testing: Standard settings with error visibility
- Production: Conservative settings with security focus
- Learning: Verbose help and full history
Security Considerations:
- Always enable session timeouts on shared systems
- Consider disabling auto-serve if HTTP access isn’t needed
- Keep error messages enabled for security monitoring
- Use verbose help only in secure environments
Performance Optimization
Section titled “Performance Optimization”Memory Usage:
# Reduce memory usageSET CONFIG LIMIT_HISTORY TO true # Limit command historySET CONFIG AUTO_SERVE TO false # Don't auto-start serverSET CONFIG HELP_IS_VERBOSE TO false # Smaller help messages
Development Speed:
# Optimize for development speedSET CONFIG HELP_IS_VERBOSE TO true # Detailed helpSET CONFIG LIMIT_HISTORY TO false # Full command historySET CONFIG AUTO_SERVE TO true # Immediate API access
Configuration Maintenance
Section titled “Configuration Maintenance”Regular Review:
- Review configurations monthly
- Adjust based on usage patterns
- Update for security requirements
- Optimize for performance needs
Documentation:
- Document your configuration choices
- Share configurations with team members
- Version control configuration scripts
- Create profiles for different environments
Troubleshooting Configuration
Section titled “Troubleshooting Configuration”Common Issues
Section titled “Common Issues”Configuration Not Taking Effect:
# Solution: Restart OstrichDBRESTART
# Or verify the setting was applied correctlySET CONFIG HELP_IS_VERBOSE TO trueHELP NEW # Test if verbose help appears
Server Not Auto-Starting:
# Check auto-serve settingSET CONFIG AUTO_SERVE TO true
# Restart to applyRESTART
# Verify server starts on login
Session Timeout Issues:
# Disable session timeout for long sessionsSET CONFIG LIMIT_SESSION_TIME TO false
# Or manage sessions proactively# Set reminders before 24-hour limit
Configuration Reset
Section titled “Configuration Reset”If configurations become problematic:
Reset via Restart:
# Restart often resolves configuration issuesRESTART
Reset via Rebuild:
# Nuclear option - rebuilds entire systemREBUILD
Manual Reset:
# Set all configurations to defaultsSET CONFIG HELP_IS_VERBOSE TO falseSET CONFIG SUPPRESS_ERRORS TO falseSET CONFIG LIMIT_HISTORY TO trueSET CONFIG AUTO_SERVE TO trueSET CONFIG LIMIT_SESSION_TIME TO true
Configuration Automation
Section titled “Configuration Automation”Configuration Scripts
Section titled “Configuration Scripts”Create shell scripts to set up configurations:
development-config.sh:
#!/bin/bashecho "Setting up development configuration..."
# Start OstrichDB in background./main.bin &OSTRICH_PID=$!
# Wait for startupsleep 2
# Apply configurationsecho "SET CONFIG HELP_IS_VERBOSE TO true" | ./main.binecho "SET CONFIG SUPPRESS_ERRORS TO false" | ./main.binecho "SET CONFIG LIMIT_HISTORY TO false" | ./main.binecho "SET CONFIG AUTO_SERVE TO true" | ./main.binecho "SET CONFIG LIMIT_SESSION_TIME TO false" | ./main.binecho "EXIT" | ./main.bin
echo "Development configuration applied!"
production-config.sh:
#!/bin/bashecho "Setting up production configuration..."
./main.bin &OSTRICH_PID=$!sleep 2
echo "SET CONFIG HELP_IS_VERBOSE TO false" | ./main.binecho "SET CONFIG SUPPRESS_ERRORS TO false" | ./main.binecho "SET CONFIG LIMIT_HISTORY TO true" | ./main.binecho "SET CONFIG AUTO_SERVE TO false" | ./main.binecho "SET CONFIG LIMIT_SESSION_TIME TO true" | ./main.binecho "EXIT" | ./main.bin
echo "Production configuration applied!"
Configuration Verification
Section titled “Configuration Verification”verify-config.sh:
#!/bin/bashecho "Verifying OstrichDB configuration..."
./main.bin &sleep 2
# Test configurationsecho "HELP NEW" | ./main.bin > help_output.txtecho "HISTORY" | ./main.bin > history_output.txtecho "EXIT" | ./main.bin
# Check outputsif grep -q "EXAMPLES:" help_output.txt; then echo "✓ Verbose help enabled"else echo "✗ Verbose help disabled"fi
# Cleanuprm -f help_output.txt history_output.txt
Next Steps
Section titled “Next Steps”With OstrichDB configured:
- Apply Your Profile: Choose and implement the appropriate configuration profile
- Test Settings: Verify configurations work as expected
- Document Choices: Record your configuration decisions
- Monitor Performance: Watch how settings affect usage
- Iterate: Adjust configurations based on experience
Configuration is an ongoing process. Start with recommended settings for your use case, then refine based on your specific needs and usage patterns.
Proper configuration ensures OstrichDB works optimally for your specific requirements, whether you’re learning, developing, or running production systems.