Skip to content

mistivia/basher

Repository files navigation

Basher

Basher is a CLI AI Agent that interacts with OpenAI-compatible LLM API for executing coding tasks.

The only tool Basher ever uses is Bash. Whether it’s finding, reading, or editing files, Basher always generates a small Bash script to get the job done.

Installation

To use Basher, ensure you have Python 3 installed. Basher only uses Python standard library. No other Python dependencies are required.

But Basher depends on these command line utils:

  • rg
  • fd

Please make sure you have installed them.

Usage

First, you can create an AGENTS.md as context file.

To run Basher, you'll need to set a few environment variables prior to execution:

Environment Variables

  • BASHER_API_ENDPOINT: The API endpoint for the OpenAI-compatible LLM service. e.g. https://openrouter.ai/api/v1/.
  • BASHER_API_KEY: Your API key for authenticating with the LLM service.
  • BASHER_MODEL: The model to use for interaction. e.g. moonshotai/kimi-k2.5.

Run

You can run the Basher CLI from your terminal like this:

export BASHER_API_KEY='your_api_key_here'
python basher.py 'your task here`'

Sandbox Security

Basher executes arbitrary Bash commands generated by LLM, which can be dangerous without proper isolation. We recommend running Basher inside a sandbox to protect your system.

This project provides a basher.firejail.profile for use with Firejail, a Linux security sandbox. The profile ensures that:

  • Basher can only modify files in your current working directory;
  • Basher cannot read other files in your home directory (your browser cookies, passwords, etc. are safe);
  • Basher cannot modify .git in your current working directory. When Basher messed up your project, you can use git reset to recover.

Usage

Run Basher with Firejail:

firejail --profile=basher.firejail.profile python basher.py "your task here"

License

The MIT License

Copyright (c) 2026 Mistivia <i@mistivia.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

About

simple yet useful ai agent that just use `bash`

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors