Rust-based CLI tool for Metabase API interaction.
- Authentication: Login/logout with secure session management via service layer
- Configuration: Multi-profile support with TOML configuration and validation
- Secure Storage: Keyring integration for credentials with dual-mode authentication
- Interactive Display: Full-screen pagination and interactive table navigation
- Error Handling: Hierarchical error system with comprehensive user feedback
- Async Operations: Built on tokio for efficient I/O operations
4-Layer Clean Architecture with clear dependency flow:
CLI Layer (User Interface)
├── Core Layer (Business Logic)
├── Storage Layer (Data Persistence)
└── Utils Layer (Shared Utilities)
Key Architectural Features:
- Service Layer Pattern: Business logic separated from CLI using facade pattern
- Single Responsibility: Each module has focused, well-defined responsibilities
- Dependency Inversion: Each layer only depends on layers below it
- Error-First Design: Comprehensive failure handling with hierarchical error types
- Zero Circular Dependencies: Clean module boundaries validated by architecture tests
See ARCHITECTURE.md for detailed system diagrams and implementation details.
# View help and available commands
cargo run -- --help
# Initialize configuration (creates default config automatically)
cargo run -- config show
# Authenticate with your Metabase instance
cargo run -- auth login
# Verify authentication status
cargo run -- auth status# Build the project
cargo build --release
# View current configuration (creates default profile if none exists)
./target/release/mbr-cli config show
# Authenticate with Metabase
./target/release/mbr-cli auth login
# Verify authentication status
./target/release/mbr-cli auth statusThe application automatically creates a default profile (default) pointing to http://localhost:3000. To customize your Metabase URL:
# Edit the configuration file manually
mkdir -p ~/.config/mbr-cli
cat > ~/.config/mbr-cli/config.toml << EOF
[default]
url = "https://your-metabase.com"
email = "[email protected]"
EOFauth login- Login with username/password (supports CLI args, environment variables, and interactive input)auth logout- Clear stored session and credentialsauth status- Display current authentication status and profile information
Environment Variables for Authentication:
MBR_USERNAME- Username for login (fallback when --username not provided)MBR_PASSWORD- Password for login (fallback when --password not provided)
config show- Display current configuration and all profilesconfig set- Set configuration values (supports multiple input modes)
Config Set Usage:
# Using environment variables (MBR_URL and MBR_USERNAME)
export MBR_URL="https://your-metabase.com"
export MBR_USERNAME="[email protected]"
mbr-cli config set
# Using CLI arguments (takes priority over env vars)
mbr-cli config set --url "https://metabase.com" --email "[email protected]"
# Legacy field/value mode (backward compatible)
mbr-cli config set --field "url" --value "https://metabase.com"question list- List available questions with search, limit, and collection filteringquestion execute <id>- Execute question with parameters and display results with pagination
Available for all commands:
--verbose, -v- Enable verbose output--profile, -p <PROFILE>- Use specific profile (defaults to 'default')--config-dir <DIR>- Override default config directory--api-key <KEY>- Set API key (also viaMBR_API_KEYenvironment variable)
MBR_API_KEY- API key for authentication (alternative to username/password)MBR_USERNAME- Username for login and profile email configurationMBR_PASSWORD- Password for loginMBR_URL- Metabase server URL for profile configuration
Licensed under the MIT License.
See LICENSE file for details.