{"id":16355955,"url":"https://github.com/timobechtel/hey-comma","last_synced_at":"2026-02-21T18:06:17.601Z","repository":{"id":65614852,"uuid":"594704989","full_name":"TimoBechtel/hey-comma","owner":"TimoBechtel","description":"Run shell commands using natural language","archived":false,"fork":false,"pushed_at":"2023-11-13T14:08:31.000Z","size":1445,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T20:04:29.783Z","etag":null,"topics":["ai","gpt","shell"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimoBechtel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-29T11:45:56.000Z","updated_at":"2024-02-23T09:58:18.000Z","dependencies_parsed_at":"2023-11-13T15:38:49.272Z","dependency_job_id":null,"html_url":"https://github.com/TimoBechtel/hey-comma","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"0e76d649db528e09532d7b55695cc91c2bf4c864"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fhey-comma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fhey-comma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fhey-comma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimoBechtel%2Fhey-comma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimoBechtel","download_url":"https://codeload.github.com/TimoBechtel/hey-comma/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257251,"owners_count":20424131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","gpt","shell"],"created_at":"2024-10-11T01:42:14.367Z","updated_at":"2026-02-21T18:06:17.595Z","avatar_url":"https://github.com/TimoBechtel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\nhey,\n\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eRun shell commands using natural language\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  ·\n  \u003ca href=\"https://github.com/TimoBechtel/hey,/issues\"\u003eReport Bug / Request Feature\u003c/a\u003e\n  ·\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"750px\" alt=\"running command example\" src=\"./assets/is-it-safe.gif\"\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [About](#about)\n- [Installation](#install)\n- [Setup](#setup)\n- [Usage](#usage)\n  - [`hey, run`](#hey-run)\n  - [`hey, explain`](#hey-explain)\n- [Data sent to providers](#data-sent-to-providers)\n- [Migration to v2](#migration-to-v2)\n- [More examples](#more-examples)\n- [Contributing](#contributing)\n\n## About\n\nUse natural language to turn tasks into shell commands.\n\nJust say what you want to do and `hey,` will generate the command for you.\n\n### Features\n\n- use natural language to run shell commands\n- explain files, scripts, and piped input with your configured model\n- caches successful commands to speed up future runs\n\n### Why?\n\nShell scripts are powerful, but only if you remember the exact commands. `hey,` is for the moments when you know what you want, but not the syntax.\n\nAlways forget the command to pack a directory into a tarball? Just say it:\n\n```sh\nhey, create a tarball with all files in the current directory, except javascript files\n```\n\n## Install\n\n### Binary install\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/TimoBechtel/hey-comma/main/install.sh | bash\n```\n\nSupported binaries:\n\n- macOS arm64\n- macOS x64\n- Linux x64\n- Windows x64\n\n### npm install\n\nRequires Node.js **22 or later** when installed via npm.\n```sh\nnpm i -g hey-comma\n```\n\n\u003e [!NOTE]\n\u003e `pnpm` does not like the comma, so only the `hey` alias is available. You can add it manually: `alias hey,=hey`\n\n## Setup\n\n### AI provider setup\n\n`hey,` works with `openai`, `anthropic`, `google`, and `openrouter`.\n\nThen, run:\n\n```sh\nhey, setup\n```\n\nand follow the prompts. This creates `~/.hey-comma/config.toml`.\n\nIf you prefer environment variables, set the key and point config to it:\n\n```sh\nexport OPENROUTER_API_KEY=...\nhey, config set openrouter_api_key \"env:OPENROUTER_API_KEY\"\n```\n\n## Usage\n\n`hey,` currently has two modes: `run` and `explain`. Most of the time you don't need to specify the mode specifically, as `hey,` will automatically detect the mode based on whether you pipe data to it or not.\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"650px\" alt=\"running command example\" src=\"./assets/copy-gif.gif\"\u003e\n\u003c/p\u003e\n\n### `hey, run`\n\n`hey, run` is the default mode. It will convert your instruction to a shell command and run it. **It will always ask for confirmation before running the command.**\n\n```sh\nhey, create a tarball with all files in the current dir, except js files\n```\n\nYou can explicitly specify the mode:\n\n```sh\nhey, run: initialize a next.js project in ./my-app\n```\n\n_(colon is optional)_\n\n### `hey, explain`\n\n`hey, explain` will explain the data you pipe to it.\n\n\u003e [!IMPORTANT]\n\u003e Piped data is sent to your configured provider. Do not pipe secrets you would not send to that service.\n\n```sh\ncat mysterious.sh | hey, is this safe to run\n```\n\nYou can explicitly specify the mode:\n\n```sh\ncat script.sh | hey, explain: what does this do\n```\n\n_(colon is optional)_\n\n### Special characters\n\nTo pass special characters to the `hey,`, you can pass them as a quoted string:\n\n```sh\nhey, \"what is the most recent file in ~/Documents?\"\n```\n\n## Configuration\n\nYou can configure `hey,` using the `hey, config` command. Or by editing the `config.toml` directly. To get the path to the config file, run:\n\n```sh\nhey, config path\n```\n\nFor example, `~/.hey-comma/config.toml`\n\nAvailable options:\n\n- `default_provider`: default provider (`openai`, `anthropic`, `google`, `openrouter`)\n- `default_model`: default model name for your default provider\n- `model_aliases`: alias map for model selectors (e.g. `smart = \"anthropic/claude-sonnet-4-5\"`)\n- `openai_api_key`: OpenAI API key (or `env:OPENAI_API_KEY`)\n- `anthropic_api_key`: Anthropic API key (or `env:ANTHROPIC_API_KEY`)\n- `google_api_key`: Google API key (or `env:GOOGLE_API_KEY`)\n- `openrouter_api_key`: OpenRouter API key (or `env:OPENROUTER_API_KEY`)\n- `openrouter_base_url`: OpenRouter base URL (default: `https://openrouter.ai/api/v1`)\n- `disable_thinking`: disable provider reasoning/thinking modes where supported (default: `false`)\n- `temperature`: the temperature to use when generating commands (default: `0.2`)\n- `max_tokens`: the maximum number of tokens to generate (default: `1200`)\n- `run_prompt`: the prompt to use when generating commands (see [Custom prompts](#custom-prompts))\n- `explain_prompt`: the prompt to use when explaining data (see [Custom prompts](#custom-prompts))\n- `cache.max_entries`: the maximum number of entries to cache (default: `50`)\n\n### Model selector\n\nUse `--model` when you want to override your defaults:\n\n```sh\nhey, run --model anthropic/claude-sonnet-4-5 \"create a tarball from this folder\"\nhey, explain --model openrouter/openai/gpt-4o \"what does this script do?\"\n```\n\nAccepted forms:\n\n- full selector: `\u003cprovider\u003e/\u003cmodel\u003e`\n- alias from `model_aliases`\n- bare model name (resolved with `default_provider`)\n\nExample aliases:\n\n```toml\n[model_aliases]\nfast = \"openai/gpt-4o-mini\"\nsmart = \"anthropic/claude-sonnet-4-5\"\ncheap = \"google/gemini-2.5-flash\"\n```\n\n### Custom prompts\n\nYou can customize the prompts used by `hey,` by setting the `run_prompt` and `explain_prompt` options. See [prompts.ts](https://github.com/TimoBechtel/hey-comma/blob/main/src/prompts.ts) for the default prompts.\n\n\u003e [!IMPORTANT]\n\u003e Make sure to add the placeholders (e.g. `%INSTRUCTION%`) to your custom prompts.\n\nThe following placeholders are available:\n\n- `%INSTRUCTION%`: the instruction that is passed to `hey, run` or `hey, explain`\n- `%SHELL%`: the current shell (e.g. `bash` or `zsh`) (only available for `hey, run`)\n- `%INPUT%`: the data that is piped to `hey, explain` (only available for `hey, explain`)\n\n## Data sent to providers\n\n`hey,` sends this data to your configured provider:\n\n- The command you want to run\n- The data you pipe to `hey, explain`\n- Your current shell (e.g. `bash` or `zsh`)\n\n## Migration to v2\n\nv2 is intentionally breaking. There is no compatibility layer for old flags or old config keys.\n\nRemoved:\n\n- `--gpt4`\n- `openai_model`\n- OpenAI-only runtime behavior\n\nUse this instead:\n\n- `--model \u003cprovider/model\u003e` (or alias / bare model with default provider)\n- `default_provider`, `default_model`, and `[model_aliases]` in config\n\n## More usage examples\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"650px\" alt=\"running command example\" src=\"./assets/ip-addr.gif\"\u003e\n\u003c/p\u003e\n\n```sh\nhey, what are the largest files in my download directory\n```\n\n```sh\ncat salaries.csv | hey, what is the average salary of people with a PhD\n```\n\n```sh\ncat script.sh | hey, explain\n```\n\n## Contributing\n\n### Development\n\nThis project uses [bun](https://bun.sh/) as package manager and compiler.\n\nIf you don't have bun installed, run:\n\n```sh\ncurl -fsSL https://bun.sh/install | bash\n```\n\n#### Install dependencies\n\n```sh\nbun install\n```\n\n#### Build\n\n```sh\nbun run build\n```\n\nTo build all release binaries:\n\n```sh\nbun run build:all\n```\n\n### Commit messages\n\nThis project uses semantic-release for automated release versions. So commits in this project follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) guidelines. I recommend using [commitizen](https://github.com/commitizen/cz-cli) for automated commit messages.\n\n### Release publishing\n\n`main` releases use semantic-release with npm Trusted Publishing (OIDC).  \nBefore publishing, configure `TimoBechtel/hey-comma` as a trusted publisher in npm package settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimobechtel%2Fhey-comma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimobechtel%2Fhey-comma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimobechtel%2Fhey-comma/lists"}