Initial commit
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
# Edison - AI Command Assistant
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
|
||||
Edison is an AI-powered command-line assistant that helps you interact with your terminal more efficiently. Just describe what you want to do in natural language, and Edison will generate and execute the appropriate command.
|
||||
|
||||
```
|
||||
Edison v0.2
|
||||
|
||||
Usage: edison [options] <your command description>
|
||||
Arguments:
|
||||
-s, --safety : Enable safety mode (only useful when safety is off)
|
||||
-c, --config : Print current configuration
|
||||
-v, --verbose : Enable verbose logging
|
||||
-i, --interactive : Start interactive shell mode
|
||||
-e, --explain : Explain the generated command
|
||||
--no-streaming : Disable streaming output for command generation
|
||||
--no-rich : Disable rich text formatting
|
||||
--theme <theme> : Set syntax highlighting theme (e.g., monokai, github-dark)
|
||||
|
||||
Current configuration per edison.yaml:
|
||||
* Model : gpt-4o-mini
|
||||
* Temperature : 0
|
||||
* Max. Tokens : 500
|
||||
* Safety : on
|
||||
* Streaming : on
|
||||
* Show Prefix : off
|
||||
|
||||
UI Configuration:
|
||||
* Rich Formatting : on
|
||||
* Theme : monokai
|
||||
* Command Style : panel
|
||||
* Structured Expl.: on
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Natural language processing for command generation
|
||||
- Support for GPT-3.5 and GPT-4 models
|
||||
- Real-time streaming of command generation
|
||||
- Rich text formatting with syntax highlighting
|
||||
- Structured command explanations
|
||||
- Direct command modification (edit commands before execution)
|
||||
- Configurable settings via `edison.yaml`
|
||||
- Cross-platform support (Linux, macOS, Windows)
|
||||
- Safety mode to confirm commands before execution
|
||||
- Interactive shell mode with command history
|
||||
|
||||
## Installation
|
||||
|
||||
### Linux and macOS
|
||||
|
||||
```bash
|
||||
git clone https://github.com/user/command-assistant
|
||||
cd command-assistant
|
||||
source install_edison.sh
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
```powershell
|
||||
git clone https://github.com/user/command-assistant
|
||||
cd command-assistant
|
||||
.\install_edison.bat
|
||||
```
|
||||
|
||||
## OpenAI API Key Configuration
|
||||
|
||||
Configure your OpenAI API key using one of these methods:
|
||||
|
||||
- Environment variable: `export OPENAI_API_KEY=<yourkey>` (Linux/macOS) or `$env:OPENAI_API_KEY="<yourkey>"` (Windows)
|
||||
- Create a file at `~/.openai.apikey` with just the key
|
||||
- Add the key to the `edison.yaml` configuration file
|
||||
|
||||
## Usage Examples
|
||||
|
||||
```
|
||||
edison what's the time?
|
||||
edison show me some unicode characters
|
||||
edison what is my username and machine name?
|
||||
edison is there a process called chrome running?
|
||||
edison download the homepage of example.com and save it to index.html
|
||||
edison find all unique URLs in index.html
|
||||
edison create a file named test.txt with my username
|
||||
edison -a delete the test.txt file
|
||||
edison show me the current price of Bitcoin in USD
|
||||
edison check the SSH logs for suspicious logins
|
||||
```
|
||||
|
||||
## Safety Mode
|
||||
|
||||
By default, Edison will prompt for confirmation before executing commands. You can configure this behavior in `edison.yaml`.
|
||||
|
||||
## Streaming Mode
|
||||
|
||||
Edison displays command generation in real-time as tokens arrive from the API, providing immediate feedback. You can:
|
||||
|
||||
- Enable/disable streaming in `edison.yaml` with the `streaming` option
|
||||
- Disable streaming for a single command with the `--no-streaming` flag
|
||||
- Cancel a streaming command generation with Ctrl+C
|
||||
- Hide the "Generating command: " prefix with the `show_generating_prefix: false` option in `edison.yaml`
|
||||
|
||||
## Command Modification
|
||||
|
||||
Edison allows you to modify commands in two ways:
|
||||
|
||||
1. **Modify the prompt**: Change the natural language description to generate a new command
|
||||
2. **Modify the command directly**: Edit the generated command before execution
|
||||
|
||||
When you select the "modify" option (by typing `m`), Edison will ask whether you want to modify the prompt or the command:
|
||||
|
||||
```
|
||||
Execute command? [Y]es [n]o [m]odify (prompt/command) [c]opy to clipboard ==> m
|
||||
Modify [p]rompt or [c]ommand? [c] ==>
|
||||
```
|
||||
|
||||
- Choose `p` to modify the prompt and generate a new command
|
||||
- Choose `c` (default) to directly edit the generated command
|
||||
|
||||
## Rich Formatting
|
||||
|
||||
Edison provides enhanced terminal output with rich text formatting:
|
||||
|
||||
- Syntax highlighting for generated commands
|
||||
- Structured command explanations with better formatting
|
||||
- Customizable themes for syntax highlighting
|
||||
- Panel-based UI elements for better visual organization
|
||||
|
||||
You can configure rich formatting options in `edison.yaml` under the `ui` section:
|
||||
|
||||
```yaml
|
||||
ui:
|
||||
rich_formatting: true
|
||||
theme: "monokai"
|
||||
command_style: "panel"
|
||||
structured_explanations: true
|
||||
```
|
||||
|
||||
Or disable rich formatting for a single command with the `--no-rich` flag.
|
||||
|
||||
## License
|
||||
|
||||
MIT. No Liability. No Warranty.
|
||||
Reference in New Issue
Block a user