Interactive Chat
Have multi-turn conversations with AI using whisp chat.
Interactive Chat
Use whisp chat for extended conversations where context from previous messages matters.
Starting a Chat Session
whisp chatThis opens an interactive REPL (read-eval-print loop) where you can have a back-and-forth conversation.
whisp> How do I set up a Python virtual environment?
Creating a virtual environment in Python:
1. Create: python -m venv myenv
2. Activate:
- Linux/macOS: source myenv/bin/activate
- Windows: myenv\Scripts\activate
3. Install packages: pip install <package>
whisp> What about with poetry instead?
Using Poetry for virtual environments:
1. Install Poetry: curl -sSL https://install.python-poetry.org | python3 -
2. Create project: poetry new myproject
3. Or init existing: poetry init
4. Add packages: poetry add requests
5. Activate shell: poetry shell
Poetry automatically manages virtual environments for you.
whisp> exitWhy Use Chat Mode?
Chat mode maintains conversation history, so each response builds on previous context:
| Use Case | Query Mode (,) | Chat Mode |
|---|---|---|
| Quick commands | Best | Overkill |
| Follow-up questions | Context lost | Context kept |
| Complex problems | Limited | Best |
| Learning/exploring | OK | Better |
Chat Commands
Within the chat session:
| Command | Action |
|---|---|
/clear | Reset conversation (clears history) |
exit or quit | Exit chat mode |
Ctrl+D | Exit chat mode |
Clearing Context
If the conversation goes off-track, reset it:
whisp> /clear
Context cleared. Starting fresh conversation.
whisp>Command Generation in Chat
The AI can suggest commands during chat. When it does, you'll see:
whisp> How do I find and delete old Docker images?
To clean up old Docker images:
Command: docker image prune -a --filter "until=720h"
This removes all images older than 30 days (720 hours).
Add -f to skip confirmation.
whisp> Run that but only for images older than a week
Command: docker image prune -a --filter "until=168h"
This removes images older than 7 days (168 hours).Commands are displayed but not automatically executed—copy and run them yourself.
Conversation Features
Context Awareness
Chat mode knows about:
- Your current working directory
- Your shell type (bash, zsh, fish)
- The operating system
- Previous messages in the conversation
whisp> I'm in a node project, how do I run tests?
Based on your package.json, you can run tests with:
Command: npm test
Or for watch mode:
Command: npm test -- --watch
whisp> What testing framework is configured?
Looking at your package.json dependencies, you're using Jest.History Navigation
Use arrow keys to navigate through your previous inputs:
- Up arrow: Previous input
- Down arrow: Next input
Multi-line Input
For complex questions, just type naturally—the REPL handles multi-line editing.
Examples
Debugging a Problem
whisp> My Python script is throwing "ModuleNotFoundError: No module named 'requests'"
This error means the 'requests' package isn't installed in your current
Python environment.
Fix options:
1. Install it: pip install requests
2. If using venv, activate it first: source venv/bin/activate
3. If using system Python on Ubuntu: sudo apt install python3-requests
whisp> I installed it but still get the error
A few things to check:
1. Are you using the right Python?
Command: which python && python --version
2. Is requests actually installed?
Command: pip list | grep requests
3. Are you in a virtual environment?
Command: echo $VIRTUAL_ENV
whisp> $VIRTUAL_ENV is empty
That's the issue—you installed requests globally but your script
might be running in a different environment.
Try:
Command: pip3 install requests
Or ensure you're running with the same Python:
Command: python3 -m pip install requestsLearning a New Tool
whisp> I want to learn jq for JSON processing
jq is a powerful JSON processor. Here are the basics:
Basic syntax: jq 'filter' file.json
Essential filters:
- . : Identity (whole document)
- .field : Access field
- .[] : Iterate array
- | : Pipe filters
whisp> Show me an example with nested data
Given this JSON:
{
"users": [
{"name": "Alice", "age": 30},
{"name": "Bob", "age": 25}
]
}
Commands:
- Get all names: jq '.users[].name' data.json
- Filter by age: jq '.users[] | select(.age > 27)' data.json
- Transform: jq '.users | map({user: .name})' data.json
whisp> How do I use it with curl?
Pipe curl output directly to jq:
Command: curl -s https://api.example.com/users | jq '.data[].email'
The -s flag makes curl silent (no progress bar).Planning a Task
whisp> I need to migrate a MySQL database to PostgreSQL
Database migration from MySQL to PostgreSQL involves several steps:
1. **Schema conversion**: MySQL and PostgreSQL have syntax differences
- AUTO_INCREMENT → SERIAL
- TINYINT(1) → BOOLEAN
- ENUM → CHECK constraints or separate table
2. **Data export**: Use mysqldump or a migration tool
3. **Tools to consider**:
- pgloader: Automated migration tool
- AWS DMS: If using cloud
- Manual: mysqldump + conversion scripts
whisp> Let's use pgloader
Good choice. Here's how to use pgloader:
1. Install: apt install pgloader (Ubuntu) or brew install pgloader (macOS)
2. Create a migration file (mysql-to-pg.load):
Command: cat > mysql-to-pg.load << 'EOF'
LOAD DATABASE
FROM mysql://user:pass@localhost/mydb
INTO postgresql://user:pass@localhost/mydb
WITH include drop, create tables, create indexes, reset sequences
SET work_mem to '16MB', maintenance_work_mem to '512 MB';
EOF
3. Run: pgloader mysql-to-pg.load
whisp> What if I need to transform some data during migration?
pgloader supports transformations. Add to your load file...Tips
When to Use Chat vs Query Mode
Use chat mode when:
- You need to ask follow-up questions
- You're debugging a complex issue
- You're learning something new
- The problem requires back-and-forth
Use query mode (,) when:
- You need a quick command
- The request is self-contained
- You know exactly what you want
Keeping Context Relevant
If responses seem confused, use /clear to reset. Long conversations can accumulate irrelevant context.
Exiting Cleanly
Always exit with exit, quit, or Ctrl+D rather than closing the terminal, to ensure the session is properly closed.