Skip to main content

Natural language to shell command translator using Claude

Project description

autocmd

Natural language to shell command translator using Claude Haiku 4.5.

Installation

# Install from PyPI (recommended)
uv tool install autocmd-cli

# Or install directly from git
uv tool install git+https://github.com/dvirzg/autocmd.git

First Run Setup

The first time you run autocmd, it will:

  1. Ask for your Anthropic API key - Get one at https://console.anthropic.com

    • Saved securely to ~/.config/autocmd/config
  2. Offer to set up shell integration (recommended)

    • Adds a small wrapper function to your .zshrc or .bashrc
    • Makes commands appear directly on your prompt, editable before execution
    • If you skip this, commands will just be printed (you can copy/paste them)

Just run any autocmd command to start setup:

autocmd "check git status"

Usage

After setup, commands appear on your prompt line as if you typed them:

$ autocmd "git fetch all updates from remote"
$ git fetch --all█  # ← appears on your prompt, press Enter to run or edit first

Examples

autocmd "show git log for last 5 commits"
autocmd "find all python files modified today"
autocmd "kill process on port 3000"
autocmd "compress images in current folder"
autocmd "create a new branch called feature-x"

How It Works

  • Uses Claude Haiku 4.5 for fast, accurate command translation
  • Isolated dependencies (won't interfere with other Python projects)
  • Shell integration uses print -z (zsh) or READLINE_LINE (bash)
  • Works from any directory after installation

Configuration

Using a Different Claude Model

By default, autocmd uses claude-haiku-4-5-20251001 for fast responses. To use a different model, set the AUTOCMD_MODEL environment variable:

# One-time use
AUTOCMD_MODEL=claude-sonnet-4-20250514 autocmd "your command here"

# Set permanently in your shell config (~/.zshrc or ~/.bashrc)
export AUTOCMD_MODEL=claude-sonnet-4-20250514

Available models:

  • claude-haiku-4-5-20251001 (default, fastest)
  • claude-sonnet-4-20250514 (more capable)
  • claude-opus-4-20250514 (most capable)

Development

To contribute or develop locally:

# Clone the repo
git clone https://github.com/dvirzg/autocmd.git
cd autocmd

# Run the dev setup script
./dev-setup.sh

# Reload your shell
source ~/.zshrc  # or ~/.bashrc

# Use autocmd-dev for development (always uses latest code)
autocmd-dev "check git status"

The autocmd-dev alias lets you test changes immediately without reinstalling. Just edit the code and run autocmd-dev - it always uses your latest changes with full shell integration.

Uninstall

uv tool uninstall autocmd

# Optionally remove the shell integration line from ~/.zshrc or ~/.bashrc
# (Look for "# autocmd shell integration")

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

autocmd_cli-0.1.2.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

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

autocmd_cli-0.1.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file autocmd_cli-0.1.2.tar.gz.

File metadata

  • Download URL: autocmd_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autocmd_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 68a5b79f1a5876619e036577a63affc7c719373a73049ef721faa8da0e869256
MD5 843a33f3dbac160d0d6b3bb04367d0d4
BLAKE2b-256 3e9f83fe03c0ba3bd38890ed6a54be1a7484c0626e6b38c98b6fab0e18a62660

See more details on using hashes here.

Provenance

The following attestation bundles were made for autocmd_cli-0.1.2.tar.gz:

Publisher: publish.yml on dvirzg/autocmd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autocmd_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: autocmd_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autocmd_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a5115dafb79be4a474e1e157f0693dbd413337443a76c72a8bd854bdf4092fd6
MD5 c1f2008551cbe6f569ca4afde1dc13f8
BLAKE2b-256 cbab2e52e1431e232bb7e1d59e5ad8efdb032814a77c6ece48b0512377032486

See more details on using hashes here.

Provenance

The following attestation bundles were made for autocmd_cli-0.1.2-py3-none-any.whl:

Publisher: publish.yml on dvirzg/autocmd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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