Caution
This application is still considered "beta". Its interfaces and/or its stability is subject to change in breaking ways
A powerful command-line interface for interacting with the Mezmo observability platform. Manage logs, views, configurations, and leverage AI-powered assistance directly from your terminal.
- Log Management: Search, tail, and analyze logs in real-time
- View Management: Create, edit, delete, and manage log views
- AI-Powered Assistant: Ask questions and get intelligent assistance
- Resource Management: Manage various Mezmo platform resources via YAML/JSON definitions
- Account Management: View and manage account information
- Configuration Management: Customize CLI behavior and settings
- Shell Completions: Auto-completion support for enhanced productivity
| Command | Description |
|---|---|
mzm ask |
Interact with the Mezmo AI assistant |
mzm completions |
Generate shell completion scripts |
mzm config |
Manage CLI configuration |
mzm create |
Create resources from definitions |
mzm delete |
Delete resources |
mzm edit |
Edit existing resources |
mzm get |
Retrieve and display resources |
mzm log |
Interact with log data |
mzm log search- Search through historical logsmzm log tail- Stream logs in real-time
mzm get account- Display account informationmzm get conversation- List AI conversationsmzm get view- List or get specific views
mzm config get <key>- Display configuration valuesmzm config set <key>- Set configuration values
- Mezmo Account: Active account with API access
The Mezmo CLI uses the following environment variables:
| Variable | Required | Description | Default |
|---|---|---|---|
MZM_ACCESS_KEY |
Yes | Authentication key for accessing the Mezmo platform API. This is required for all API operations. | None |
EDITOR |
No | Specifies the text editor to use when editing resources with mzm edit command |
vi (Unix/Linux/macOS) or notepad.exe (Windows) |
Note: The CLI also respects standard system environment variables like HOME for determining configuration file locations.
The Mezmo CLI requires the following system permissions and access:
| Operation | Location | Purpose |
|---|---|---|
| Read/Write | ~/.config/mezmo/mzm.cfg |
Store CLI configuration and local data |
| Read/Write/Delete | System temp directory | Temporary files for editing operations |
| Read | User-specified paths | Reading resource definition files |
| Create Directory | ~/.config/mezmo/ |
Initial configuration setup |
The CLI requires HTTPS access to the following Mezmo API endpoints:
- API Host:
https://api.mezmo.com(configurable)- View management operations (GET, POST, PUT, DELETE)
- Account information retrieval
- AI assistant interactions
- Stream Host:
https://tail.mezmo.com(configurable)- Real-time log streaming via WebSocket
- Log search and retrieval
- Subprocess Spawning: Required for launching external text editors (
$EDITOR) - Standard I/O: Access to stdin, stdout, and stderr for command interaction
- All API communications require authentication via
MZM_ACCESS_KEY - The CLI uses Token Bearer authentication for API requests
- Network timeouts: 3 seconds for standard API calls, 10 minutes for AI operations
- No elevated system privileges (sudo/admin) required for normal operation
Download the appropriate binary for your platform from the releases page:
# macOS (Apple Silicon)
curl -LO https://github.com/mezmo/cli/releases/latest/download/mzm-darwin-aarch64
chmod +x mzm-darwin-aarch64
sudo mv mzm-darwin-aarch64 /usr/local/bin/mzm
# macOS (Intel)
curl -LO https://github.com/mezmo/cli/releases/latest/download/mzm-darwin-x86_64
chmod +x mzm-darwin-x86_64
sudo mv mzm-darwin-x86_64 /usr/local/bin/mzm
# Linux (x86_64)
curl -LO https://github.com/mezmo/cli/releases/latest/download/mzm-linux-x86_64
chmod +x mzm-linux-x86_64
sudo mv mzm-linux-x86_64 /usr/local/bin/mzm
# Linux (ARM64)
curl -LO https://github.com/mezmo/cli/releases/latest/download/mzm-linux-aarch64
chmod +x mzm-linux-aarch64
sudo mv mzm-linux-aarch64 /usr/local/bin/mzm
# Windows
# Download mzm-windows-x86_64.exe and add to PATH# Clone the repository
git clone https://github.com/mezmo/cli.git
cd cli
# Install Deno if not already installed
curl -fsSL https://deno.land/install.sh | sh
# Compile the CLI for your platform
deno task compile:local
# Move binary to PATH
sudo mv mzm /usr/local/bin/# Clone the repository
git clone https://github.com/mezmo/cli.git
cd cli
# Run directly with Deno
deno task local <command> [options]Set up Authentication:
The Mezmo CLI requires a Mezmo platform access key to authenticate API requests. You must set the MZM_ACCESS_KEY environment variable with your access key.
# Set the access key for your current session
export MZM_ACCESS_KEY="your-access-key-here"
Getting an Access Key:
- It is recommended to use a Personal Access Key for better security and control
- Visit the Mezmo documentation on IAM Service Keys for detailed instructions on creating and managing access keys
- Personal Access Keys can be created and managed through your Mezmo User Preferences
Enable auto-completion for your shell:
# Bash
source <(mzm completions bash)
# Zsh
source <(mzm completions zsh)
# Fish
source (mzm completions fish | psub)All commands and sub commands support the -h / --help flag for outputing
detailed instruction and examples for that specific command
# display help text for the main command
mzm
# display help for the log command
mzm log --help
# display help text for the log search command
mzm log search --helpSearch Logs
# Basic search
mzm log search "error"
# Search with time range
mzm log search "database connection" --from "1h ago" --to "now"
# Search with filters
mzm log search "error" --app myapp --level error
# Export results
mzm log search "critical" --format json > results.jsonStream Logs in Real-time
# Tail all logs
mzm log tail
# Tail with filters
mzm log tail --app production --level warn --leve error
# Tail specific hosts
mzm log tail --host server1 --host server2
# Tail with custom query
mzm log tail "status:500"Views are sets of predefined search queries and filters that help you better interact with your data. They are an essential part of leveraging the mezmo platform. As such, we have tried to make it exceptionally easy to manage and use them.
List Views
# List all views
mzm get view
# Get specific view details
mzm get view <view-id>
# Output as JSON
mzm get view --output jsonCreate Views
# Create from YAML file
cat > view.yaml << EOF
type: v1/view
spec:
name: production-errors
query: level:error AND app:production
categories:
- production
- errors
EOF
mzm create -f view.yamlEdit Views
# Edit view interactively
mzm edit view <view-id>
mzm edit view "name of a view"Delete Views
# Delete a view
mzm delete view <view-id>Interact with the Mezmo AI assistant for help with queries, troubleshooting, and platform guidance:
# Ask a question
mzm ask "How do I filter logs by timestamp?"
# Continue a previous conversation
mzm ask --continue
# Continue specific conversation
mzm ask --continue <conversation-id>
# Interactive mode
mzm ask
# Then type your questions interactivelyManage resources using declarative YAML or JSON definitions:
# Create resources from file
mzm create -f resource.yaml
# Delete resources from spec file (experimental)
mzm delete -f resource.yaml
# Delete a view by id
mzm delete view a41febfd
# Delete a view name
mzm delete view "my view name"
Example resource definition:
---
type: v1/view
spec:
name: application-logs
query: app:myapp
categories:
- application
---# Search for errors in production from the last hour
mzm log search "level:error AND env:production" --from "1h ago"
# Tail logs with multiple filters
mzm log tail --app api --level error --level warn --host prod-* "level:error AND env:production"
# Create multiple views from a directory
for file in views/*.yaml; do
mzm create -f "$file"
done
# Export all views
mzm get view --output json > all-views.json#!/bin/bash
# Monitor for critical errors
mzm log tail --level critical --format json | while read -r line; do
# Process each critical log
echo "Critical error detected: $line"
# Send alert, create ticket, etc.
done- Deno 2.0+
- Node.js 18+ (for release management)
# Clone repository
git clone https://github.com/mezmo/cli.git
cd cli
# Install dependencies (Deno downloads automatically)
deno cache main.ts
# Run tests
deno task test
# Generate coverage reports
deno task reports
# Run locally with environment variables
deno task local <command># Build all platforms
deno task compile
# Build specific platform
deno task compile:linux:x86
deno task compile:osx:arm
deno task compile:windows
# Build for local testing
deno task compile:local# Run all tests
deno task test
# Run with coverage
deno task reports
# Run specific test file
deno test @mzm/core/error.test.tsThis project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Email: support@mezmo.com
We welcome contributions of any kind! Please see our Contributing Guide for details.
Thanks goes to these wonderful people (emoji key):
Eric Satterwhite π» |
Mike Del Tito π π€ |
kwabena π π€ |
Sergey Opria π |
Nicholas DiMucci π |
Matt March π |
This project follows the all-contributors specification.
Β© 2025 Mezmo. All rights reserved.