matlas

One CLI for MongoDB Atlas and MongoDB databases. Matlas bridges the Atlas SDK and the MongoDB Go Driver so you can manage infrastructure and data workflows without switching tools.

Core Features

🔐

Authentication & Configuration

Flexible authentication with API keys, config files, environment variables, and macOS Keychain integration.

Learn more
☁️

Atlas Commands

Manage MongoDB Atlas projects, clusters, users, and networking with intuitive commands.

Learn more
🗄️

Database Commands

Work directly with MongoDB databases, collections, and indexes through Atlas or direct connections.

Learn more
🔍

Discovery & Export

Discover existing Atlas resources and convert to infrastructure-as-code format with database-level resource enumeration.

Learn more
🏗️

Infrastructure Workflows

Terraform-inspired infrastructure-as-code workflows: discover, plan, diff, apply, destroy.

Learn more
🚨

Alerts & Monitoring

Comprehensive alert management and monitoring configuration with multi-channel notifications.

Learn more
📚

Examples & Patterns

Comprehensive YAML examples and usage patterns for all resource types and infrastructure scenarios.

View examples

Why Choose matlas?

Single Mental Model - Unified interface for both Atlas infrastructure and database operations

Terraform-Inspired - Familiar workflow: Discover → Plan/Diff → Apply

Consistent Interface - Same flags, output formats, and ergonomics across all commands

MongoDB Native - Built on official Atlas SDK and MongoDB Go Driver


Getting started

Installation

# Download from GitHub releases
# Or build from source
go install github.com/teabranch/matlas-cli@latest

Quick setup

# Set up authentication
export ATLAS_API_KEY="your-private-key"
export ATLAS_PUB_KEY="your-public-key"

# List your projects
matlas atlas projects list

# Discover a project's resources
matlas discover --project-id <id> --include-databases --output yaml

Example workflow

# 1. Discover current state
matlas discover --project-id abc123 --include-databases -o project.yaml

# 2. Edit the configuration
vim project.yaml

# 3. Preview changes
matlas infra diff -f project.yaml

# 4. Apply changes
matlas infra apply -f project.yaml

# 5. Explore examples for more patterns
matlas examples --help

📚 Ready-to-use Examples

Jump-start your infrastructure with our comprehensive examples collection:


Copyright © 2025 matlas CLI. Distributed by an MIT license.