An AI companion that enhances shell command efficiency.
Project details
smart-terminal revolutionizes the command line experience by predicting the next shell command and providing context-aware suggestions. Designed for users of all skill levels, it translates natural language into actionable commands, effectively integrating with your terminal while maintaining complete control.
smart-terminal is an advanced AI-driven command-line interface (CLI) built with Rust, designed to enhance the terminal experience by predicting user commands based on natural language and partial inputs. This tool not only assists in streamlining command execution but also investigates codebases to provide meaningful insights and generate shell scripts from user prompts. The architecture employs a ReAct framework combined with structured output, utilizing project-scoped memory that evolves from user interactions for more accurate predictions over time.
The next-cmd feature utilizes context from:
By tracking interactions within each project directory, smart-terminal can recall past commands and suggestions, enhancing the quality and relevance of future predictions. Users can easily manage this memory with commands to initialize, view, clear, or delete stored interactions:
$ smart-terminal memory init
$ smart-terminal memory show
$ smart-terminal memory clear
$ smart-terminal memory delete
The investigate feature allows users to pose questions about their projects, leveraging LLMs to provide grounded answers based on current project context. This feature is particularly useful for exploring new codebases, debugging, or evaluating the state of git repositories:
$ smart-terminal investigate --one-off "What does this repository do?"
$ sterm ask "Why is this test failing?"
Every suggestion comes with a clear explanation and a reversibility indicator, ensuring users can make informed decisions without fear of unintended consequences. The predicted commands are color-coded to represent their potential impact:
| Level | Color | Meaning | Example |
|---|---|---|---|
| Full | 🟢 | Fully reversible | ls, grep, git log |
| Mostly | 🔵 | Undoable in one step | git stash, git commit |
| Partial | 🟡 | Some effects persist | mkdir, touch, git add |
| Hard | 🔴 | Requires manual cleanup | git switch, docker system prune |
| Irreversible | 🟥 | Cannot be undone | rm -rf, git push --force |
The smart-terminal separates different components to ensure modularity, allowing for effortless integration of new agents and LLM providers:
smart-terminal is ideal for shell users of all levels—from beginners to professionals—looking to enhance productivity. It provides a seamless experience that respects the traditional terminal environment without acting as a mere chat interface. Contributing to the project is encouraged. Developers interested in driving the future of this AI shell companion can refer to the CONTRIBUTING.md for guidance.
Comments
0Start the conversation
Share the first comment.