Chat to AI
Chat to AI allows you to directly interact with AI in the terminal, and AI will help you complete terminal operations tasks.
Overview
Chaterm provides two AI interaction methods, allowing you to choose the most appropriate way to collaborate with AI based on different scenarios:
- In-Terminal AI Interaction: Quickly execute simple tasks
- AI Sidebar Interaction: Plan complex tasks and have detailed conversations
In-Terminal AI Interaction
Function Description
In the terminal window, use shortcut keys to quickly pop up an AI dialog box. Enter the operation you want to perform, and AI will help you complete terminal operations tasks.
Usage
- Open Dialog: In the terminal window, use shortcut keys (usually
Ctrl+KorCmd+K) - Enter Request: In the pop-up dialog, describe the operation you want to perform
- AI Processing: AI will understand your request and generate corresponding commands
- Execute Command: After confirmation, the command will automatically be inserted into the terminal input box for execution
Use Cases
- Quick Command Generation: Need to execute an operation but unsure of the specific command
- Simple Task Execution: Execute single or simple command combinations
- Command Query: Query the usage or parameters of a command
Examples
- "View files in the current directory"
- "Check system memory usage"
- "Restart nginx service"
AI Sidebar Interaction
Function Description
In the terminal window, use shortcut keys to quickly open the AI conversation sidebar. AI will automatically obtain the current terminal's context information to help you complete terminal operations tasks.
Usage
- Open Sidebar: In the terminal window, use shortcut keys (usually
Ctrl+LorCmd+L) - View Context: AI will automatically obtain the current terminal's output content and status
- Describe Task: Enter your task requirements in the sidebar
- AI Analysis: AI will analyze based on terminal context and provide suggestions
- Execute Operation: Execute corresponding operations according to AI's suggestions
Use Cases
- Complex Task Planning: Tasks that require multiple steps to complete
- Problem Troubleshooting: Diagnose problems based on terminal output
- Detailed Consultation: Scenarios that require multiple rounds of conversation with AI
- Context-Related Operations: Operations that need to be executed based on current terminal state
Context Understanding
The AI sidebar will automatically obtain the following information:
- Current terminal output content
- Terminal history
- Current working directory
- System environment information
Shortcuts
| Function | macOS | Windows/Linux |
|---|---|---|
| Open AI Command Generation Dialog | Command + K | Ctrl + K |
| Send to AI / Toggle AI Sidebar | Command + L | Ctrl + L |
For more shortcut information, please refer to the Shortcuts Settings documentation.
Usage Tips
Describe Clear Task Objectives
- Clearly state the goals you want to achieve
- Provide necessary context information
- Explain any special requirements or constraints
Make Full Use of Context
- When using
Ctrl+Lto open the sidebar, AI will automatically obtain terminal context - When describing tasks, you can reference specific output in the terminal
- Let AI provide suggestions based on current state
Execute Complex Tasks Step by Step
For complex tasks:
- First use
Ctrl+Lto open the sidebar for planning - Discuss task steps with AI
- Gradually execute commands suggested by AI
- Adjust strategy based on execution results
Combine with Command Snippets
- Save commonly used commands generated by AI as command snippets
- Use command snippets to quickly execute repetitive tasks
- Optimize and improve command snippets through AI
Best Practices
Simple Tasks
- Use
Ctrl+Kto quickly generate and execute commands - Suitable for one-time or simple operations
Complex Tasks
- Use
Ctrl+Lto open the sidebar for detailed planning - Make full use of AI's context understanding capabilities
- Conduct multiple rounds of conversation to gradually improve the solution
Learning and Exploration
- Use AI to learn new commands and tools
- Ask for detailed explanations and parameters of commands
- Explore different solutions
Notes
Tip
- Carefully check AI-generated command suggestions before execution
- For commands involving system modifications, it is recommended to verify in a test environment first
- Make full use of AI's context understanding and provide clear descriptions
Security Notice
- Do not let AI execute commands that may cause data loss or system damage
- For sensitive operations, always confirm manually
- Regularly review commands suggested by AI to ensure they comply with security standards