Skip to main content

Turn natural language into terminal commands.

Project description

askcmd

Stop Googling. Start asking.

Turn natural language into terminal commands — right from your shell.

Python 3.8+ MIT License GitHub Stars PRs Welcome


Demo

$ ask "list all docker containers"
> docker ps -a

$ ask "kill process on port 3000"
> lsof -ti:3000 | xargs kill -9

$ ask "find large files in this folder"
> find . -type f -size +100M

askcmd demo


Why This Exists

You're a developer. You live in the terminal.

And yet — every single day — you open a browser to Google things like:

"how to find files larger than 100MB linux" "tar compress folder command" "kill process on port 3000 mac"

You know the command exists. You just can't remember the exact flags.

askcmd fixes that. One tool. One command. No leaving the terminal.

ask "undo last git commit but keep changes"

That's it.


Install

pip install ask2cmd

Then run the setup wizard to pick your provider and enter your API key:

ask setup

Choose from OpenAI, DeepSeek, or any OpenAI-compatible API:

选择你的 AI 服务商:

  1) OpenAI
  2) DeepSeek
  3) Custom (OpenAI-compatible)

Done. You're ready.


Examples

This is where it gets fun.

Everyday

ask "show disk usage sorted by size"
ask "count lines of code in this project"
ask "show my public IP"
ask "what's using port 8080"

Git

ask "undo last commit but keep changes"
ask "squash last 3 commits"
ask "show commits from last week by me"
ask "delete all merged branches"

Docker

ask "stop all running containers"
ask "remove all dangling images"
ask "show logs for container nginx"
ask "list all volumes not used by any container"

Files & Search

ask "find all TODO comments in python files"
ask "find files modified in the last 24 hours"
ask "replace foo with bar in all js files"
ask "find duplicate files in this folder"

System

ask "kill process on port 3000"
ask "show top 10 processes by memory"
ask "how much RAM is free"
ask "list all open network connections"

Fun

ask "generate a random password 32 chars"
ask "download this youtube video as mp3"  # you rebel
ask "what's the weather in Tokyo from the terminal"

Every command is shown to you before it runs. You stay in control.


Features

Feature Description
Natural language Just describe what you want
OS-aware Detects macOS / Linux / Windows and adapts commands
Multi-provider OpenAI, DeepSeek, or any compatible API
Safe by default Always asks for confirmation before running
--explain Explains what the command does
--dry-run Shows the command without executing
--yes Skips confirmation (for the brave)

Safety

askcmd never runs anything without your permission.

Default flow:

$ ask "delete all node_modules recursively"

╭──────────────────────────────────────────╮
│ find . -name node_modules -type d        │
│   -prune -exec rm -rf {} +               │
╰──────────────────────────────────────────╯

Run this command? [y/N]:
  • Default is N. You must explicitly approve.
  • Use --dry-run to preview without any execution.
  • Use --explain to understand the command before running.
  • No telemetry. No data collection. Your queries go to your API provider and nowhere else.

You are always in control.


How It Works

  You                askcmd             LLM API           Terminal
   │                   │                  │                  │
   │  "kill port 3000" │                  │                  │
   │──────────────────>│                  │                  │
   │                   │  prompt + OS ctx │                  │
   │                   │─────────────────>│                  │
   │                   │  shell command   │                  │
   │                   │<─────────────────│                  │
   │  show command     │                  │                  │
   │<──────────────────│                  │                  │
   │  confirm (y/N)    │                  │                  │
   │──────────────────>│                  │                  │
   │                   │          execute │                  │
   │                   │─────────────────────────────────────>
   │                   │                  │          output  │
   │<─────────────────────────────────────────────────────────
  1. You describe what you want in plain English
  2. askcmd builds a prompt with your OS and shell context
  3. The LLM returns a single shell command (no markdown, no fluff)
  4. You review, confirm, and it runs — or you walk away

No agents. No chains. No frameworks. Just one clean API call.


Roadmap

  • Command history — recall and reuse past generations
  • Shell aliases — auto-create aliases for commands you use often
  • Offline mode — local models via Ollama
  • Plugins — community-contributed prompt packs
  • Clipboard mode — copy command instead of running
  • Multi-command — generate pipelines and scripts
  • i18n — prompts in any language

Want to build one of these? PRs are open.


Contributing

git clone https://github.com/dovzilla/askcmd.git
cd askcmd
pip install -e .
ask setup

That's the whole dev setup. Hack away.


License

MIT — do whatever you want with it.



If this saves you even one Google search, give it a ⭐

Star on GitHub

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

ask2cmd-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

ask2cmd-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ask2cmd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b11e335e29933d53c09445e925e49a8f6817e32833bc8248319bb67cb6f89708
MD5 4b07cb3578e77fb3ee69a3eae902521f
BLAKE2b-256 68831748a9b4a8bc9b7118f4a3b853312a742a92bd2bcde5899563cb3921c7f5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ask2cmd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e69e78ea56c4e32cd423b02a67305eb69783b3277dd8d285b006cdb7b44e0be1
MD5 2abb4aeb86ffccd73c88deaf59be4625
BLAKE2b-256 e155ff616aa674650a226e5a190e9b0dbed83637e8aa43e2259cf18bc52e78c7

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