AI-powered shell assistant that uses tmux
Project description
muxmait
A command-line tool that works with your tmux scrollback. It reads your tmux pane content and provides contextually aware command suggestions using various AI models through litellm.
Features
- Reads your tmux pane content and sends it to your choice of AI model
- Automatically parses commands from AI responses and puts them into your prompt
- Optional Stack Exchange integration to provide additional context from relevant stack exchange google search.
- Terrible and poorly thought out features like auto-execution and recursive mode for automated system destruction.
Installation
-
Make sure you have tmux.
-
Install required Python packages:
pip install muxmait
-
Set up your API key for your chosen provider as an environment variable: The tool looks for API keys in environment variables based on the chosen model:
# Example API key setup export OPENROUTER_API_KEY="your-key-here" export ANTHROPIC_API_KEY="your-key-here" export GEMINI_API_KEY="your-key-here" export TOGETHER_API_KEY="your-key-here" export XAI_API_KEY="your-key-here"
- And any others supported by litellm
Usage
Basic usage:
mait [options] [input]
Options
-A
,--auto
: Automatically execute the suggested command (use with caution)-r
,--recursive
: Add;mait
to the end of suggested commands for continuous operation-m MODEL
,--model MODEL
: Choose AI model (Can select by shorthand for some models eg.'cs' for claude-3-5-sonnet-latest or 'gf' for gemini/gemini-1.5-flash-latest )-q
,--quiet
: Only output the command without explanation-v
,--verbose
: Enable verbose mode with detailed output--debug
: Run in debug mode (skips API request)-t TARGET
,--target TARGET
: Specify target TMux pane (default: current pane)--log FILE
: Log all output to specified file--log-commands FILE
: Log only commands to specified file--file FILE
: Read additional input from specified file-S LINES
,--scrollback LINES
: Number of scrollback lines to include from tmux (default: 0)--system-prompt FILE
: Use custom system prompt from file--delay SECONDS
: Set delay before auto-execution (default: 2.0 seconds)-c
,--add-stackexchange
: Add relevant context from Stack Exchange-M MODEL
,--model-stackexchange MODEL
: Specify model for Stack Exchange search query generation (default: gemini/gemini-1.5-flash-latest)
Examples
-
Basic command suggestion based on visible terminal content:
mait
-
Get a suggestion for a specific task:
mait how to find large files
-
Use a specific model by name or shorthand:
mait -m cs how do I automate these commands # or mait -m anthropic/claude-3-5-sonnet-latest how do I automate these commands
-
Include Stack Exchange context with custom model:
mait -c -M gemini/gemini-1.5-pro-latest how to compress images in bulk
-
Auto-execute commands with auto and recursive mode(or don't):
mait -A -r process these files # DO NOT DO THIS
-
Include more context from terminal history:
mait -S 100 why wont this compile
Security Considerations
- Review commands before execution: Always review suggested commands before running them
- Auto-execution risks: The
-A
flag will execute commands without confirmation - Data privacy: Be mindful that terminal content is sent to AI providers
- API credentials: Secure your API keys and avoid exposing them in scripts or logs
- Recursive mode: Use
-r
flag with extreme caution as it can create command loops
Troubleshooting
- Enable verbose mode (-v) for detailed operation information
- Check API key environment variables if model requests fail
Contributing
Contributions are welcome! Please feel free to submit issues and enhancement requests.
License
GPL 3
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file muxmait-0.1.3.tar.gz
.
File metadata
- Download URL: muxmait-0.1.3.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a47fe3e13d24553cb6b7e6a0cb93db1f82bfae2f5d4e027a27fc0a9c7bae1a6d |
|
MD5 | 98ac53e3ca694d39ffc81b74206ed60b |
|
BLAKE2b-256 | 379e5470d2155104835d9bbf692890a54930964bd1a1d9246809a1c5c13d390b |
Provenance
The following attestation bundles were made for muxmait-0.1.3.tar.gz
:
Publisher:
python-publish.yml
on elijahknaperek/muxmait
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
muxmait-0.1.3.tar.gz
- Subject digest:
a47fe3e13d24553cb6b7e6a0cb93db1f82bfae2f5d4e027a27fc0a9c7bae1a6d
- Sigstore transparency entry: 146856819
- Sigstore integration time:
- Predicate type:
File details
Details for the file muxmait-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: muxmait-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bada9a07ce9e1b86c47748571d0a4e9c2fba5a874e9ebf2789ac5a99ddcf505 |
|
MD5 | 1dc18de812280cdd282ee9a711a3f93d |
|
BLAKE2b-256 | 8b478c0d22977c6fc314bfeacf02bdd6a882b3799e5ea2a0319e97974ccfd52b |
Provenance
The following attestation bundles were made for muxmait-0.1.3-py3-none-any.whl
:
Publisher:
python-publish.yml
on elijahknaperek/muxmait
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
muxmait-0.1.3-py3-none-any.whl
- Subject digest:
7bada9a07ce9e1b86c47748571d0a4e9c2fba5a874e9ebf2789ac5a99ddcf505
- Sigstore transparency entry: 146856820
- Sigstore integration time:
- Predicate type: