Skip to main content

Natural language to shell commands โ€” just say what you want and cmdo does it.

Project description

cmdo

Natural language to shell commands. Just say what you want and cmdo does it.

$ cmdo "compress the checkpoints folder"

๐Ÿค– Will run:
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ tar -czf checkpoints.tar.gz checkpoints/     โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
๐Ÿ“ Compresses the "checkpoints" directory into a gzipped tarball.

[Y] Execute  [e] Edit  [c] Copy  [n] Cancel

Features

  • Translates natural language into accurate shell commands using GPT
  • Safety-first: commands are classified as Safe / Caution / Dangerous with color-coded warnings
  • Hard-blocks catastrophic commands (fork bombs, rm -rf /, disk wipes)
  • Context-aware: knows your OS, shell, current directory, installed tools, and git branch
  • Works everywhere: any terminal โ€” iTerm, VSCode, Terminal.app, SSH, tmux

Install

pip install cmdo

Requires Python 3.10+.

Quick Start

# First-time setup โ€” enter your OpenAI API key
cmdo --config

# Use it
cmdo "find all Python files larger than 1MB"
cmdo "start a local HTTP server on port 8080"
cmdo "show disk usage sorted by size"

# Generate without executing
cmdo --dry-run "delete the temp folder"

# Auto-confirm safe commands
cmdo --yes "list all docker containers"

Safety

Every generated command goes through two layers of safety checking:

  1. LLM classification โ€” the model labels each command as SAFE, CAUTION, or DANGEROUS
  2. Local pattern matching โ€” a regex-based classifier catches anything the LLM misses
Risk Level Confirmation Auto-confirm (--yes)
SAFE (green) Single keypress Y Allowed
CAUTION (yellow) Single keypress Y Allowed
DANGEROUS (red) Type full word yes Never

Certain commands are hard-blocked and can never be executed:

  • Fork bombs
  • Full disk wipes (dd if=/dev/zero of=/dev/sda)
  • System-wide deletion (rm -rf /)

Configuration

cmdo --config           # Interactive setup wizard
cmdo --config --show    # View current config (API key masked)
cmdo --config --reset   # Reset to defaults

Config is stored in ~/.config/cmdo/config.toml.

CLI Reference

Usage: cmdo [OPTIONS] [QUERY]...

Options:
  --config          Configure cmdo
  --show            Show current configuration (use with --config)
  --reset           Reset configuration (use with --config)
  -d, --dry-run     Generate command without executing
  -y, --yes         Auto-confirm safe commands
  -m, --model TEXT  Override default model for one query
  -V, --version     Show version
  --help            Show help

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmdo_cli-0.1.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmdo_cli-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file cmdo_cli-0.1.0.tar.gz.

File metadata

  • Download URL: cmdo_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cmdo_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f0157e1011e80b3ef9ba704e49a947dd74362271708e587aa235e3141e69776
MD5 79d80d43b6850449ba253297bbd084d7
BLAKE2b-256 017e40d1188e4122af1ac7cdfd7700bfc5e81074cc2e02d60397419170637c1c

See more details on using hashes here.

File details

Details for the file cmdo_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cmdo_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cmdo_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deecd126a64b6ed275055ea6d1945ca2a0f48fe80bc7edc96f01c5a4364e7f4e
MD5 e28f9f9800fe7f68b6f6eba477d0423b
BLAKE2b-256 b32ab52c1df21810b4db50a664bc130712caf7def36b31e1768bf64df9437ee6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page