94 lines
2.8 KiB
Markdown
94 lines
2.8 KiB
Markdown
# Basic Usage
|
|
|
|
Edison is designed to be intuitive and easy to use. This guide covers the fundamental operations and commands.
|
|
|
|
## Command Structure
|
|
|
|
```
|
|
edison [OPTIONS] <your natural language query>
|
|
```
|
|
|
|
For example:
|
|
|
|
```bash
|
|
edison how to find all png files in the current directory
|
|
```
|
|
|
|
## Basic Workflow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User
|
|
participant Edison
|
|
participant API as OpenAI API
|
|
participant Shell
|
|
|
|
User->>Edison: Natural language query
|
|
Edison->>API: Send prompt with query
|
|
API-->>Edison: Return command
|
|
Edison->>User: Display command & ask for confirmation
|
|
User->>Edison: Confirm (Y/n/m)
|
|
alt User confirms
|
|
Edison->>Shell: Execute command
|
|
Shell-->>User: Show command output
|
|
else User modifies
|
|
User->>Edison: Modified command
|
|
Edison->>Shell: Execute modified command
|
|
Shell-->>User: Show command output
|
|
else User declines
|
|
Edison->>User: Command skipped
|
|
end
|
|
```
|
|
|
|
1. **Enter your query**: Describe in natural language what you want to do
|
|
2. **Review the command**: Edison will display the generated shell command
|
|
3. **Choose an action**:
|
|
- Press `Enter` or type `y` to execute the command
|
|
- Type `n` to skip execution
|
|
- Type `m` to modify the command before execution
|
|
- Type `d` to directly modify the command (new feature!)
|
|
- Type `c` to copy the command to clipboard
|
|
|
|
## Command Line Options
|
|
|
|
Edison supports several command-line options:
|
|
|
|
| Option | Description |
|
|
|--------|-------------|
|
|
| `-v, --verbose` | Enable verbose logging (DEBUG level) |
|
|
| `-i, --interactive` | Start interactive shell mode |
|
|
| `-e, --explain` | Explain the generated command |
|
|
| `-c, --config` | Print current configuration |
|
|
| `-s, --safety` | Enable safety mode (only useful when safety is off) |
|
|
|
|
## Examples
|
|
|
|
Here are some example queries you can try:
|
|
|
|
```bash
|
|
# File operations
|
|
edison list all files larger than 10MB
|
|
edison create a new directory called "project"
|
|
edison find files modified in the last 24 hours
|
|
|
|
# System information
|
|
edison check CPU usage
|
|
edison show network connections
|
|
edison how much disk space do I have left
|
|
|
|
# Text processing
|
|
edison count lines in all python files
|
|
edison find lines containing "error" in log files
|
|
edison replace "old" with "new" in all text files
|
|
```
|
|
|
|
## Tips for Effective Queries
|
|
|
|
1. **Be specific**: The more specific your query, the better the generated command
|
|
2. **Include parameters**: Mention specific filenames, sizes, or other parameters
|
|
3. **Start with verbs**: Commands usually work best when starting with actions like "find", "list", "create"
|
|
4. **Use common terminology**: Avoid obscure technical terms when possible
|
|
|
|
## Next Steps
|
|
|
|
Once you're comfortable with basic usage, explore [Advanced Features](advanced-features.md) to learn about interactive mode, command explanations, and more. |