bit is a Python CLI that translates natural-language shell instructions into Linux shell commands by calling a locally running OLLAMA model. It leaves no footprint and requires no API keys.
pip install bit-wrangler$ bit create folder new_folder
mkdir new_folderBy default, bit prints the generated command to stdout.
If you want bit to place the generated command into your current shell prompt for review, first enable the Bash or Zsh shell integration (this only has to be done once).
Activate shell integration:
# zsh
source <(bit --activate zsh) # alternatively replace zsh with bashThis command can be added to your shell startup file (e.g. .zshrc) to load the integration automatically.
Option 1 (using Ctrl-x Ctrl-b):
find large log files in current directory
# press Ctrl-x Ctrl-b to replace the prompt with the generated command
Option 2 (using bit function):
bit find large log files in current directory
# the generated command is staged into the prompt for review
- Translates free-form instructions into one shell command.
- Stores configuration in
~/.bitusing TOML. - Supports interactive model selection with
bit --setup. - Exposes shell integration instructions for Bash and Zsh so generated commands can be inserted into the prompt buffer.
- Builds as a standard Python package with
python -m build.
- Python 3.11 or newer.
- A local OLLAMA installation.
- An OLLAMA server available at
http://127.0.0.1:11434. - At least one installed OLLAMA model.
Build and install locally:
python -m build
python -m pip install dist/bit_wrangler-1.0.1-py3-none-any.whlOr install in editable mode while developing:
python -m pip install -e .After installation, the bit command is available directly on the command line.
Install the development dependencies:
python -m pip install -e ".[dev]"Run the formatter:
black src testsRun Ruff:
ruff check src testsRun Flake8:
flake8 src testsRun mypy:
mypy srcRun:
bit --setupThis command:
- Queries the local OLLAMA instance for installed models.
- Displays them as a numbered list.
- Prompts you to select one.
- Saves the result in
~/.bit.
The config file is TOML and looks like this:
model = "llama3.1:8b"
host = "http://127.0.0.1:11434"Translate an instruction:
bit create folder new_folder
bit find large log files in current directory
bit show disk usage for home directoryPrint Bash integration helper:
bit --activate bashPrint Zsh integration helper:
bit --activate zshPrint Bash deactivation helper:
bit --deactivate bashPrint Zsh deactivation helper:
bit --deactivate zshShow help:
bit --helpThe standalone bit executable only prints commands. If you want generated commands staged into your current shell prompt so you can review and edit them before execution, source the appropriate shell integration.
To enable that widget in Bash:
source <(bit --activate bash)To enable that widget in Zsh:
source <(bit --activate zsh)To unload the integration in Bash:
source <(bit --deactivate bash)To unload the integration in Zsh:
source <(bit --deactivate zsh)After sourcing the Zsh integration, you can also invoke bit directly as a shell function:
bit create folder new_folderThat direct Zsh function call does not execute the generated command immediately. Instead, it stages the translated shell command into the next prompt so you can review or edit it before pressing Enter.
Then type a natural-language instruction directly at the shell prompt and press Ctrl-x Ctrl-b. The widget will:
- Read the current command line buffer as the instruction.
- Call the installed
bitCLI. - Replace the current command line with the generated shell command.
Nothing is executed automatically. You can edit the generated command and then press Enter yourself.
To load this automatically, add the matching source <(bit --activate ...) line to your shell startup file.
In Zsh, sourcing the integration also defines a bit shell function that shadows the installed executable in that shell session. Administrative commands such as bit --setup, bit --help, bit --activate zsh, and bit --deactivate zsh still pass through to the real CLI.
Create a source distribution and wheel:
python -m build- The tool asks the model for a single shell command, but model output is still untrusted text.
bitrejects obvious malformed multi-line and fenced responses, but it does not prove a generated command is safe.- Review generated commands before executing them.
- Prompt staging is available through sourced shell integration rather than the standalone executable.
- The default target is Linux shell syntax even if the tool is run elsewhere.
