| name | gemini-chat |
| description | Interactive chat workflows with Gemini CLI including context management, multimodal conversations, and session persistence. Use for extended AI conversations, brainstorming, or collaborative problem-solving. |
Gemini Interactive Chat
Advanced interactive chat workflows with Gemini CLI, featuring context management, multimodal support, and session persistence.
Quick Start
gemini -i "Let's work on my project"
gemini --include-directories ./src -i "Help me refactor this code"
gemini --checkpointing -i "Complex multi-step task"
YOLO Mode in Interactive Sessions
YOLO mode can be toggled during interactive sessions for automated execution:
gemini --yolo -i "Set up complete development environment automatically"
gemini -i "Let's plan first, then execute with YOLO"
When to use YOLO in chat:
- ✅ File operations (create, edit, organize)
- ✅ Batch processing tasks
- ✅ Project setup and configuration
- ✅ Documentation generation
- ❌ Complex system changes (review first)
- ❌ Unknown/experimental commands
Interactive Commands
Essential Commands
/help
/tools
/mcp
/compress
/copy
/clear
/checkpoint
/restore
/exit
Context Management
@./src/main.js
@./docs/
@https://example.com
@./diagram.png
Ctrl+V
/compress
/clear context
/show context
Chat Workflows
Code Review Session
#!/bin/bash
start_code_review() {
local project_dir="${1:-.}"
gemini \
--include-directories "$project_dir/src" \
--exclude-directories node_modules,.git \
--checkpointing \
-i "Let's do a code review. Start by giving me an overview of the codebase structure."
}
start_code_review ./my-project
Brainstorming Session
#!/bin/bash
brainstorm_session() {
local topic="$1"
local session_name="brainstorm-$(date +%Y%m%d-%H%M%S)"
mkdir -p ~/.gemini/sessions/$session_name
gemini \
--checkpointing \
--log ~/.gemini/sessions/$session_name/chat.log \
-i "Let's brainstorm about: $topic
Please help me:
1. Generate creative ideas
2. Evaluate feasibility
3. Identify challenges
4. Suggest next steps"
gemini --yolo -p "Summarize our brainstorming session and create actionable next steps" \
> ~/.gemini/sessions/$session_name/summary.md
echo "Session saved to ~/.gemini/sessions/$session_name/"
}
automated_brainstorm() {
local topic="$1"
local session_name="auto-brainstorm-$(date +%Y%m%d-%H%M%S)"
mkdir -p ~/.gemini/sessions/$session_name
gemini --yolo --checkpointing \
-i "Automated brainstorming session for: $topic
Execute this workflow automatically:
1. Generate 10 creative ideas
2. Evaluate each for feasibility (1-10 scale)
3. Identify top 3 ideas with rationale
4. Create implementation roadmap for top idea
5. List potential challenges and solutions
6. Generate final summary document
Save all outputs to organized files."
}
Learning Session
#!/bin/bash
learn_with_gemini() {
local subject="$1"
gemini \
--yolo \
-i "I want to learn about $subject.
Please:
1. Start with fundamentals
2. Provide examples
3. Create exercises
4. Check my understanding
5. Suggest resources
Let's begin!"
}
Advanced Features
Session Management
#!/bin/bash
save_session() {
local name="${1:-session}"
gemini checkpoint save "$name"
echo "Session saved as: $name"
}
list_sessions() {
gemini checkpoint list
}
resume_session() {
local name="$1"
gemini checkpoint restore "$name"
gemini -i "Let's continue where we left off"
}
cleanup_sessions() {
local days_old="${1:-7}"
find ~/.gemini/checkpoints -mtime +$days_old -delete
echo "Cleaned up sessions older than $days_old days"
}
Multi-Modal Conversations
#!/bin/bash
analyze_designs() {
local design_dir="$1"
gemini -i "Let's review UI designs"
}
analyze_screenshot() {
screencapture -i /tmp/screenshot.png
gemini -p "Analyze this screenshot: @/tmp/screenshot.png"
}
Context Optimization
#!/bin/bash
optimized_chat() {
local max_context="${1:-50000}"
while true; do
context_size=$(gemini context size)
if [ $context_size -gt $max_context ]; then
echo "Context limit approaching. Compressing..."
gemini /compress
fi
gemini -i "Continue"
done
}
focused_chat() {
local focus_dir="$1"
local task="$2"
gemini \
--include-directories "$focus_dir" \
--max-depth 1 \
-i "Focus only on: $task"
}
Prompt Engineering
Structured Prompts
gemini -i "You are a senior software engineer.
Context:
- Language: Python
- Framework: FastAPI
- Database: PostgreSQL
Task: Help me design a scalable API
Constraints:
- Must handle 10k requests/second
- Must have <100ms response time
- Must be maintainable
Let's start with the architecture."
Role-Based Sessions
#!/bin/bash
start_role_session() {
local role="$1"
case $role in
architect)
PROMPT="You are a solutions architect. Focus on system design, scalability, and best practices."
;;
reviewer)
PROMPT="You are a code reviewer. Focus on bugs, security issues, and code quality."
;;
teacher)
PROMPT="You are a patient teacher. Explain concepts simply with examples."
;;
debugger)
PROMPT="You are a debugging expert. Focus on finding and fixing issues systematically."
;;
*)
PROMPT="You are a helpful AI assistant."
;;
esac
gemini -i "$PROMPT
How can I help you today?"
}
Automation Scripts
Daily Standup
#!/bin/bash
daily_standup() {
local git_log=$(git log --oneline -5)
local todos=$(cat TODO.md 2>/dev/null || echo "No TODO file")
gemini -p "Based on recent commits and TODOs, generate a standup update:
Recent commits:
$git_log
TODOs:
$todos
Format:
- What I did yesterday
- What I'm doing today
- Any blockers"
}
Continuous Learning
#!/bin/bash
learn_from_changes() {
local since="${1:-1 week ago}"
local changes=$(git diff --stat "@{$since}")
local new_files=$(git ls-files --others --exclude-standard)
gemini --yolo -i "Analyze these recent changes and teach me:
Changes since $since:
$changes
New files:
$new_files
Please:
1. Explain what was changed and why
2. Identify patterns and best practices
3. Suggest improvements
4. Generate documentation for changes
5. Create knowledge summary document
6. Quiz me on the concepts"
}
auto_dev_workflow() {
local task="$1"
gemini --yolo --checkpointing -i "Automated development workflow: $task
Execute this complete development cycle:
1. Analyze current codebase and requirements
2. Create detailed implementation plan
3. Generate all necessary code files
4. Write comprehensive tests
5. Create documentation
6. Set up CI/CD integration
7. Generate deployment scripts
8. Create progress report
Work autonomously and save all outputs."
}
Integration Patterns
Vim Integration
" .vimrc
" Send selection to Gemini
vnoremap <leader>g :w !gemini -p "Explain this code: $(cat)"<CR>
" Get suggestions
nnoremap <leader>G :r !gemini -p "Improve this function: $(cat %:p)"<CR>
" Interactive help
nnoremap <leader>? :terminal gemini -i "Help with vim and %:t"<CR>
VS Code Integration
gemini /ide install
gemini /ide enable
gemini -i "Help me with the file I have open in VS Code"
Tmux Workflow
#!/bin/bash
gemini_tmux() {
tmux new-session -d -s gemini-coding
tmux send-keys -t gemini-coding "vim" C-m
tmux split-window -h -t gemini-coding
tmux send-keys -t gemini-coding "gemini -i 'Help me code'" C-m
tmux split-window -v -t gemini-coding
tmux send-keys -t gemini-coding "watch -n 2 'tree -L 2'" C-m
tmux attach -t gemini-coding
}
Best Practices
Effective Prompting
-
Be Specific
"Help me with code"
"Help me refactor this authentication module to use JWT tokens"
-
Provide Context
gemini --include-directories ./src/auth,./tests/auth
-
Set Constraints
"Explain in simple terms, with examples, max 100 lines"
Session Hygiene
-
Regular Compression
/compress
-
Save Important Sessions
/checkpoint
-
Clear Irrelevant Context
/clear context
Troubleshooting
Common Issues
-
Slow Responses
- Compress context:
/compress
- Use faster model:
gemini -m gemini-2.5-flash
- Reduce included directories
-
Lost Context
- Check checkpoints:
/restore
- Review history:
~/.gemini/history
-
Tool Errors
- Check available tools:
/tools
- Verify permissions:
ls -la
Related Skills
gemini-cli: Main Gemini CLI integration
gemini-auth: Authentication management
gemini-tools: Tool execution workflows
gemini-mcp: MCP server management