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:
-
Ask for your Anthropic API key - Get one at https://console.anthropic.com
- Saved securely to
~/.config/autocmd/config
- Saved securely to
-
Offer to set up shell integration (recommended)
- Adds a small wrapper function to your
.zshrcor.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)
- Adds a small wrapper function to your
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) orREADLINE_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68a5b79f1a5876619e036577a63affc7c719373a73049ef721faa8da0e869256
|
|
| MD5 |
843a33f3dbac160d0d6b3bb04367d0d4
|
|
| BLAKE2b-256 |
3e9f83fe03c0ba3bd38890ed6a54be1a7484c0626e6b38c98b6fab0e18a62660
|
Provenance
The following attestation bundles were made for autocmd_cli-0.1.2.tar.gz:
Publisher:
publish.yml on dvirzg/autocmd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autocmd_cli-0.1.2.tar.gz -
Subject digest:
68a5b79f1a5876619e036577a63affc7c719373a73049ef721faa8da0e869256 - Sigstore transparency entry: 725619895
- Sigstore integration time:
-
Permalink:
dvirzg/autocmd@c3640dac38ea7d90c98b254db01628489767d9cb -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/dvirzg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3640dac38ea7d90c98b254db01628489767d9cb -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5115dafb79be4a474e1e157f0693dbd413337443a76c72a8bd854bdf4092fd6
|
|
| MD5 |
c1f2008551cbe6f569ca4afde1dc13f8
|
|
| BLAKE2b-256 |
cbab2e52e1431e232bb7e1d59e5ad8efdb032814a77c6ece48b0512377032486
|
Provenance
The following attestation bundles were made for autocmd_cli-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on dvirzg/autocmd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autocmd_cli-0.1.2-py3-none-any.whl -
Subject digest:
a5115dafb79be4a474e1e157f0693dbd413337443a76c72a8bd854bdf4092fd6 - Sigstore transparency entry: 725619899
- Sigstore integration time:
-
Permalink:
dvirzg/autocmd@c3640dac38ea7d90c98b254db01628489767d9cb -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/dvirzg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3640dac38ea7d90c98b254db01628489767d9cb -
Trigger Event:
release
-
Statement type: