- 🧠 AI-powered intelligent command generation
- 🛡️ Built-in dangerous command detection
- 🎨 Beautiful command-line interface
- 🔍 Debug mode support
- 📝 Detailed command execution results
- 🚀 Dry-run mode support
Ensure you have the Rust toolchain installed, then run:
cargo install --path .
On first run, the program will guide you through the configuration process. The configuration file will be saved in .askai/config.toml
in your home directory.
You can also manually set the configuration via command line:
# Set API base URL
ask set config base_url=https://api.openai.com/v1
# Set API key
ask set config api_key=your_api_key
# Set model name
ask set config model=gpt-3.5-turbo
# Set interface language (en/zh)
ask set config language=en
The configuration file format is as follows:
[api]
base_url = "Your OpenAI API URL"
api_key = "Your OpenAI API Key"
model = "Model name you want to use (e.g., gpt-3.5-turbo)"
language = "Interface language (en/zh)"
# Basic usage
ask "list all files in current directory"
# Show command without execution (dry-run mode)
ask --dry-run "check system memory usage"
# Show debug information
ask -D "list all running processes"
# Hide detailed output
ask -v false "ping baidu.com"
Parameter | Description | Default |
---|---|---|
<PROMPT> |
Description of what you want to do | Required |
-d, --dry-run |
Show command without execution | false |
-v, --verbose |
Show detailed output | true |
-D, --debug |
Show debug information | false |
To protect system security, the program automatically detects and refuses to execute dangerous commands such as:
rm -rf
mkfs
dd
> /dev/
chmod -R
- And other potentially dangerous operations
Issues and Pull Requests are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.