Skip to content

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.

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

Configurations are stored in:

  • Location: .ostrichdb/configs/ directory
  • Format: Internal binary format
  • Scope: Per-user settings
  • Persistence: Settings survive restarts

Controls the verbosity of help information.

Default: false Values: true or false

Description:

  • false: Simple, concise help messages
  • true: Detailed help with examples and explanations

Examples:

Terminal window
# Enable verbose help
SET CONFIG HELP_IS_VERBOSE TO true
# Disable verbose help (default)
SET CONFIG HELP_IS_VERBOSE TO false
# Test the difference
HELP NEW

With verbose help enabled:

Terminal window
OstrichDB> HELP NEW
NEW - 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:

Terminal window
OstrichDB> HELP NEW
NEW - Create new collections, clusters, records, or users
Syntax: NEW <location> [OF_TYPE <type>] [WITH <value>]
NEW USER

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:

Terminal window
# Show errors (default, recommended)
SET CONFIG SUPPRESS_ERRORS TO false
# Hide errors (use with caution)
SET CONFIG SUPPRESS_ERRORS TO true
# Test with invalid command
NEW invalid.type OF_TYPE WRONG_TYPE WITH value

With errors shown:

Terminal window
OstrichDB> NEW test.record OF_TYPE INVALID_TYPE WITH value
Error: 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:

Terminal window
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

Controls whether command history is limited to 100 entries.

Default: true Values: true or false

Description:

  • true: Limit history to 100 most recent commands
  • false: Keep unlimited command history

Examples:

Terminal window
# Limit history (default)
SET CONFIG LIMIT_HISTORY TO true
# Unlimited history
SET CONFIG LIMIT_HISTORY TO false
# Check current history
HISTORY

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

Controls whether the HTTP server starts automatically on login.

Default: true Values: true or false

Description:

  • true: HTTP server starts when user logs in
  • false: HTTP server must be started manually with SERVE

Examples:

Terminal window
# Auto-start server (default)
SET CONFIG AUTO_SERVE TO true
# Manual server start
SET CONFIG AUTO_SERVE TO false
# Check if server is running (look for server startup message on login)

With auto-serve enabled:

Terminal window
Welcome to OstrichDB!
Starting HTTP server...
Server running on http://localhost:8080
Type 'HELP' for assistance.
OstrichDB>

With auto-serve disabled:

Terminal window
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

Controls whether CLI sessions are limited to 24 hours.

Default: true Values: true or false

Description:

  • true: User automatically logged out after 24 hours
  • false: No automatic logout (session persists indefinitely)

Examples:

Terminal window
# Enable session timeout (default)
SET CONFIG LIMIT_SESSION_TIME TO true
# Disable session timeout
SET CONFIG LIMIT_SESSION_TIME TO false

With session timeout enabled:

Terminal window
# After 24 hours
Session 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

Syntax:

Terminal window
SET CONFIG <CONFIG_NAME> TO <VALUE>

Rules:

  • Configuration names are case-sensitive
  • Values must be exactly true or false
  • Changes take effect immediately
  • Settings persist across restarts

Examples:

Terminal window
# Enable verbose help
SET CONFIG HELP_IS_VERBOSE TO true
# Disable auto-serve
SET CONFIG AUTO_SERVE TO false
# Enable unlimited history
SET CONFIG LIMIT_HISTORY TO false

Unfortunately, there’s no built-in command to view all current configurations, but you can test their effects:

Test Current Settings:

Terminal window
# Test verbose help setting
HELP NEW
# Test error suppression (try invalid command)
NEW test OF_TYPE INVALID_TYPE WITH value
# Check history limit
HISTORY
# Check auto-serve (restart and see if server starts)
RESTART

OstrichDB validates configuration values:

Valid Configuration:

Terminal window
OstrichDB> SET CONFIG HELP_IS_VERBOSE TO true
Configuration updated: HELP_IS_VERBOSE = true

Invalid Configuration Name:

Terminal window
OstrichDB> SET CONFIG INVALID_CONFIG TO true
Error: Unknown configuration 'INVALID_CONFIG'
Valid configurations: HELP_IS_VERBOSE, SUPPRESS_ERRORS, LIMIT_HISTORY, AUTO_SERVE, LIMIT_SESSION_TIME

Invalid Configuration Value:

Terminal window
OstrichDB> SET CONFIG HELP_IS_VERBOSE TO yes
Error: Configuration values must be 'true' or 'false'

Optimized for development and learning:

Terminal window
# Verbose help for learning
SET CONFIG HELP_IS_VERBOSE TO true
# Show all errors for debugging
SET CONFIG SUPPRESS_ERRORS TO false
# Keep full history for reference
SET CONFIG LIMIT_HISTORY TO false
# Auto-start server for web development
SET CONFIG AUTO_SERVE TO true
# Disable session timeout for convenience
SET CONFIG LIMIT_SESSION_TIME TO false

Optimized for production and performance:

Terminal window
# Concise help for efficiency
SET CONFIG HELP_IS_VERBOSE TO false
# Show errors for monitoring
SET CONFIG SUPPRESS_ERRORS TO false
# Limit history for memory efficiency
SET CONFIG LIMIT_HISTORY TO true
# Manual server control
SET CONFIG AUTO_SERVE TO false
# Enable session timeout for security
SET CONFIG LIMIT_SESSION_TIME TO true

Maximum security settings:

Terminal window
# Standard help
SET CONFIG HELP_IS_VERBOSE TO false
# Show errors for security monitoring
SET CONFIG SUPPRESS_ERRORS TO false
# Limit history to reduce data exposure
SET CONFIG LIMIT_HISTORY TO true
# No auto-server for attack surface reduction
SET CONFIG AUTO_SERVE TO false
# Enforce session timeouts
SET CONFIG LIMIT_SESSION_TIME TO true

Optimized for learning and experimentation:

Terminal window
# Detailed help for learning
SET CONFIG HELP_IS_VERBOSE TO true
# Show all errors to understand issues
SET CONFIG SUPPRESS_ERRORS TO false
# Keep full history to review commands
SET CONFIG LIMIT_HISTORY TO false
# Auto-start server to experiment with APIs
SET CONFIG AUTO_SERVE TO true
# No session timeout to avoid interruptions
SET CONFIG LIMIT_SESSION_TIME TO false

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

Memory Usage:

Terminal window
# Reduce memory usage
SET CONFIG LIMIT_HISTORY TO true # Limit command history
SET CONFIG AUTO_SERVE TO false # Don't auto-start server
SET CONFIG HELP_IS_VERBOSE TO false # Smaller help messages

Development Speed:

Terminal window
# Optimize for development speed
SET CONFIG HELP_IS_VERBOSE TO true # Detailed help
SET CONFIG LIMIT_HISTORY TO false # Full command history
SET CONFIG AUTO_SERVE TO true # Immediate API access

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

Configuration Not Taking Effect:

Terminal window
# Solution: Restart OstrichDB
RESTART
# Or verify the setting was applied correctly
SET CONFIG HELP_IS_VERBOSE TO true
HELP NEW # Test if verbose help appears

Server Not Auto-Starting:

Terminal window
# Check auto-serve setting
SET CONFIG AUTO_SERVE TO true
# Restart to apply
RESTART
# Verify server starts on login

Session Timeout Issues:

Terminal window
# Disable session timeout for long sessions
SET CONFIG LIMIT_SESSION_TIME TO false
# Or manage sessions proactively
# Set reminders before 24-hour limit

If configurations become problematic:

Reset via Restart:

Terminal window
# Restart often resolves configuration issues
RESTART

Reset via Rebuild:

Terminal window
# Nuclear option - rebuilds entire system
REBUILD

Manual Reset:

Terminal window
# Set all configurations to defaults
SET CONFIG HELP_IS_VERBOSE TO false
SET CONFIG SUPPRESS_ERRORS TO false
SET CONFIG LIMIT_HISTORY TO true
SET CONFIG AUTO_SERVE TO true
SET CONFIG LIMIT_SESSION_TIME TO true

Create shell scripts to set up configurations:

development-config.sh:

#!/bin/bash
echo "Setting up development configuration..."
# Start OstrichDB in background
./main.bin &
OSTRICH_PID=$!
# Wait for startup
sleep 2
# Apply configurations
echo "SET CONFIG HELP_IS_VERBOSE TO true" | ./main.bin
echo "SET CONFIG SUPPRESS_ERRORS TO false" | ./main.bin
echo "SET CONFIG LIMIT_HISTORY TO false" | ./main.bin
echo "SET CONFIG AUTO_SERVE TO true" | ./main.bin
echo "SET CONFIG LIMIT_SESSION_TIME TO false" | ./main.bin
echo "EXIT" | ./main.bin
echo "Development configuration applied!"

production-config.sh:

#!/bin/bash
echo "Setting up production configuration..."
./main.bin &
OSTRICH_PID=$!
sleep 2
echo "SET CONFIG HELP_IS_VERBOSE TO false" | ./main.bin
echo "SET CONFIG SUPPRESS_ERRORS TO false" | ./main.bin
echo "SET CONFIG LIMIT_HISTORY TO true" | ./main.bin
echo "SET CONFIG AUTO_SERVE TO false" | ./main.bin
echo "SET CONFIG LIMIT_SESSION_TIME TO true" | ./main.bin
echo "EXIT" | ./main.bin
echo "Production configuration applied!"

verify-config.sh:

#!/bin/bash
echo "Verifying OstrichDB configuration..."
./main.bin &
sleep 2
# Test configurations
echo "HELP NEW" | ./main.bin > help_output.txt
echo "HISTORY" | ./main.bin > history_output.txt
echo "EXIT" | ./main.bin
# Check outputs
if grep -q "EXAMPLES:" help_output.txt; then
echo "✓ Verbose help enabled"
else
echo "✗ Verbose help disabled"
fi
# Cleanup
rm -f help_output.txt history_output.txt

With OstrichDB configured:

  1. Apply Your Profile: Choose and implement the appropriate configuration profile
  2. Test Settings: Verify configurations work as expected
  3. Document Choices: Record your configuration decisions
  4. Monitor Performance: Watch how settings affect usage
  5. 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.