agentic-shell

MCP.Pizza Chef: Flux159

Agentic Shell (AGIsh) is an experimental MCP client that interprets natural language input to generate and execute shell commands using large language models. It supports command completion, directory autocomplete, persistent history, and agentic loops to fix commands. Designed for Mac OS and Linux, it aims to integrate multiple LLM providers and extend functionality via plugins, enabling users to interact with their shell environment through natural language efficiently and flexibly.

Use This MCP client To

Run shell commands using natural language input Autocomplete commands and directories in shell Persist command history across sessions Automatically fix and retry failed commands Integrate multiple LLM providers for command generation Extend shell functionality with plugins Use personal API keys for LLM access Pipe generated commands into traditional shell

README

agentic-shell

Agentic Shell (AGIsh) is an experimental shell where commands are interpreted and run by a large language model (LLM). AGIsh can be used to test and evaluate LLMs on a variety of tasks as well as used as your natural language shell.

Features

  • Command completion & directory autocomplete
  • History (persistent across sessions)
  • Use your own API keys
  • Agentic loop to fix commands
  • Pipe commands into shell to run
  • Mac OS & Linux shell support
  • Run against multiple LLM providers (in progress)
  • Windows & Powershell support (in progress)
  • Support for plugins to extend agish functionality
  • Run with local LLM models
  • Support for .agishrc file to set default LLM provider, API keys, etc.
  • MCP Server support

Will not support

  • Interactive commands (vim, nano, top, read, etc.) - these are not supported because they require stdin input and are not supported by the current version of agish. Adding proper support for these will require recreating an entire terminal emulator (or using node-pty with custom shell interceptors for every shell) in agish which is not a goal of this project.

Installation

Download from releases, chmod +x and move to a directory in your PATH or follow one of the guides below.

Mac OS X (Apple Silicon/ARM64)

curl -L https://github.com/Flux159/agentic-shell/releases/download/v1/agish-macos-arm64 -o agish
chmod +x agish
sudo mv agish /usr/local/bin/ # Or move to any other directory in your PATH

Mac OS X (Intel/x64)

curl -L https://github.com/Flux159/agentic-shell/releases/download/v1/agish-macos-x64 -o agish
chmod +x agish
sudo mv agish /usr/local/bin/ # Or move to any other directory in your PATH

Linux (x64)

curl -L https://github.com/Flux159/agentic-shell/releases/download/v1/agish-linux-x64 -o agish
chmod +x agish
sudo mv agish /usr/local/bin/ # Or move to any other directory in your PATH

Usage

In your shell, make sure you have the following environment variable is set.

Get an Anthropic API Key from https://console.anthropic.com/settings/keys (see this guide for more: https://docs.anthropic.com/en/api/getting-started).

export ANTHROPIC_API_KEY="abcd"

Environment Variables

  • ANTHROPIC_API_KEY - Required. Your Anthropic API key
  • DEBUG - Optional. Set to any value to enable debug logging
$ agish
> list files in the current directory

Special commands:

  • /help - Show help text
  • /history - Show command history
  • /exit or /quit - Exit the shell
  • Up / Down arrows to navigate command history (will load history from previous sessions as well)

Piping commands to agish:

echo "list files in the current directory" | agish

Piping with heredoc:

cat << EOF | agish
list files in the current directory
zip the files in this directory into dist.zip
EOF

Build up a directory of test suites for LLMs in a directory & run all of them against agish:

find tests/ -type f -exec agish < {} \;

Development

git clone https://github.com/Flux159/agentic-shell.git
cd agentic-shell
npm install
cp .env.local.example .env.local
# Update .env.local with your API keys
npm run dev

Building

npm run build

License

MIT License

agentic-shell FAQ

How does Agentic Shell generate commands from English text?
It uses large language models to interpret natural language input and convert it into executable shell commands.
Can I use my own API keys with Agentic Shell?
Yes, Agentic Shell supports using your own API keys to access LLM providers like OpenAI, Claude, and Gemini.
Does Agentic Shell support multiple operating systems?
Currently, it supports Mac OS and Linux shells, with Windows and Powershell support in progress.
How does the agentic loop feature work?
The agentic loop automatically detects and fixes errors in generated commands by iteratively refining them before execution.
Is command history saved between sessions?
Yes, Agentic Shell maintains persistent command history across sessions for convenience.
Can Agentic Shell run local LLM models?
Support for running local LLM models is planned but not yet implemented.
Does Agentic Shell support interactive commands like vim or nano?
No, interactive commands are not supported due to their complexity in a natural language shell environment.
What is the status of MCP server support?
MCP server support is planned but currently not available in Agentic Shell.