Edison
Edison is an AI-powered command-line tool that translates natural language queries into shell commands. It leverages OpenAI's GPT models to generate accurate and useful commands based on your descriptions.
Features
- Translate natural language to shell commands
- Support for multiple shells (bash, zsh, powershell)
- Safety checks for potentially dangerous commands
- Command modification and clipboard support
- Configurable via YAML file
- Rich terminal UI with syntax highlighting
- Interactive shell mode with command history
- Command explanations
- Progress indicators and spinners
Installation
# Clone the repository
git clone https://github.com/yourusername/edison.git
cd edison
# Install the package
pip install -e .
Usage
# Basic usage
edison how to list all files in the current directory
# Enable safety mode (confirmation before execution)
edison -s how to find all python files recursively
# Print current configuration
edison -c
# Enable verbose logging
edison -v how to check disk space
# Use rich terminal UI
edison -r how to find large files
# Get command explanations
edison -e how to compress a directory
# Start interactive shell mode
edison -i
Interactive Shell
Edison includes an interactive shell mode that provides a more user-friendly experience:
# Start interactive shell
edison -i
In interactive mode, you can:
- Type natural language queries
- Navigate command history with up/down arrows
- Get auto-suggestions based on previous commands
- Execute, modify, copy, or get explanations for commands
- Use special commands like
!helpand!exit
Rich Terminal UI
The rich terminal UI provides:
- Syntax highlighting for commands
- Colorful output
- Progress indicators during API calls
- Command explanations with detailed breakdowns
- Success/error messages with appropriate styling
Configuration
Edison can be configured via the edison.yaml file. Here's an example configuration:
model: gpt-3.5-turbo
temperature: 0
max_tokens: 500
safety: true
API Key
Edison requires an OpenAI API key to function. You can provide it in one of the following ways:
- Environment variable:
OPENAI_API_KEY="your-api-key" .envfile in the same directory as the script.openai.apikeyfile in your home directory- In the
edison.yamlconfiguration file:openai_api_key: "your-api-key"
License
MIT