Warp - AI Terminal

Overview

Estimated time: 20โ€“30 minutes

Warp is a modern terminal with built-in AI assistance that revolutionizes command-line workflows. It provides intelligent command suggestions, natural language queries, and collaborative features while maintaining full compatibility with existing tools.

Learning Objectives

Prerequisites

What is Warp?

Warp is a terminal built for the modern developer, featuring AI-powered command assistance, structured output, and collaborative workflows. Unlike traditional terminals, Warp treats commands as first-class objects with rich formatting and context.

Key Features:
  • AI Drive: Natural language to command translation
  • Blocks: Structured command output with context
  • Workflows: Shareable command sequences
  • Intelligent Autocomplete: Context-aware suggestions
  • Modern UI: Mouse support, search, and collaboration

Installation & Setup

Download and Install

# macOS
curl -L https://warp.dev/download -o warp.dmg
open warp.dmg

# Or via Homebrew
brew install --cask warp

# Linux (Ubuntu/Debian)
curl -L https://releases.warp.dev/linux/latest/warp-terminal_amd64.deb -o warp.deb
sudo apt install ./warp.deb

# Linux (Fedora/CentOS)
curl -L https://releases.warp.dev/linux/latest/warp-terminal.rpm -o warp.rpm
sudo rpm -i warp.rpm

Initial Configuration

1. First Launch
   - Sign in with GitHub/Google (optional but recommended)
   - Enable AI features
   - Choose theme and appearance

2. AI Drive Setup
   - OpenAI integration (requires API key or Warp subscription)
   - Choose AI model preferences
   - Configure privacy settings

3. Shell Configuration
   - Warp works with bash, zsh, fish
   - Import existing shell configuration
   - Set up aliases and environment variables

AI Drive Features

Natural Language Commands

# Type natural language queries with #
# "find all python files larger than 1MB"
find . -name "*.py" -size +1M

# "show me the 10 largest files in current directory"
ls -la | sort -k5 -nr | head -10

# "kill all node processes"
pkill -f node

# "show git log for last week with author names"
git log --since="1 week ago" --pretty=format:"%h %an %s"

Context-Aware Suggestions

# Warp learns from your patterns and suggests:

# After typing "git"
git status          # Check repository status
git add .           # Stage all changes  
git commit -m       # Commit with message
git push origin     # Push to remote

# After typing "docker"
docker ps           # List running containers
docker build -t     # Build image with tag
docker run -it      # Run interactive container
docker logs         # View container logs

# After typing "npm"
npm install         # Install dependencies
npm run dev         # Start development server
npm test            # Run test suite
npm run build       # Build for production

Smart Error Handling

# When commands fail, Warp suggests fixes:

$ git push
# Error: fatal: No upstream branch

# Warp suggests:
git push --set-upstream origin main
# or
git push -u origin main

$ npm start
# Error: Missing package.json

# Warp suggests:
npm init -y
# or
cd [project-directory]

Blocks and Workflows

Command Blocks

Every command creates a "block" with:
- Input command
- Output with syntax highlighting
- Execution time and exit code
- Shareable link for collaboration

Benefits:
โœ… Easy to navigate command history
โœ… Copy/paste specific outputs
โœ… Share results with team members
โœ… Search across all command history

Creating Workflows

# Example: Django Project Setup Workflow
django-admin startproject myproject
cd myproject
python -m venv venv
source venv/bin/activate
pip install django
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

# Save as "Django Setup" workflow
# Share with team or community

Using Shared Workflows

# Popular community workflows:

# React App Setup
npx create-react-app my-app
cd my-app
npm install
npm start

# Docker Container Debug
docker ps -a
docker logs [container-id]
docker exec -it [container-id] /bin/bash

# Git Feature Branch
git checkout -b feature/new-feature
git add .
git commit -m "Add new feature"
git push -u origin feature/new-feature

Productivity Features

Keyboard Shortcuts

Navigation

  • Cmd + โ†‘/โ†“ - Navigate blocks
  • Cmd + K - Command palette
  • Cmd + T - New tab
  • Cmd + W - Close tab
  • Cmd + F - Search blocks

AI Features

  • # - Natural language query
  • Cmd + ` - AI suggestions
  • Tab - Accept suggestion
  • Esc - Dismiss suggestions
  • Cmd + ? - Command help

Collaboration

  • Cmd + Shift + C - Copy block link
  • Cmd + S - Save workflow
  • Cmd + Shift + S - Share workflow
  • Cmd + R - Replay command
  • Cmd + E - Export session

Customization

  • Cmd + , - Settings
  • Cmd + Shift + P - Theme picker
  • Cmd + +/- - Font size
  • Cmd + 0 - Reset zoom
  • F11 - Fullscreen

Advanced Search

Search Operators:
- "exact phrase" - Exact match
- command:git - Commands containing 'git'
- output:error - Output containing 'error'
- exit:1 - Commands that failed
- time:>5s - Commands taking over 5 seconds
- date:yesterday - Commands from yesterday

Team Collaboration

Sharing Commands

# Share individual commands
# Right-click block โ†’ "Copy Link"
# https://warp.dev/block/abc123

# Share command output
# Select output โ†’ "Share Selection"
# https://warp.dev/share/def456

# Share entire session
# Cmd+E โ†’ Export โ†’ Share link
# https://warp.dev/session/ghi789

Team Workflows

Create Team Workflows:
1. Document common procedures
2. Save as workflows with descriptions
3. Share with team workspace
4. Version control workflow updates
5. Track usage and improvements

Examples:
- Deployment procedures
- Database backup scripts
- Environment setup
- Troubleshooting guides
- Code review workflows

Integration Examples

Development Workflows

# Full-stack development setup
# "setup node project with typescript and testing"
mkdir my-project
cd my-project
npm init -y
npm install typescript @types/node jest @types/jest ts-node
npx tsc --init
mkdir src tests
echo "console.log('Hello TypeScript!');" > src/index.ts

# AI suggests complete setup commands

DevOps Integration

# "deploy to kubernetes with health checks"
kubectl apply -f deployment.yaml
kubectl rollout status deployment/myapp
kubectl get pods -l app=myapp
kubectl logs -f deployment/myapp

# AI provides complete deployment pipeline

Database Operations

# "backup postgres database safely"
pg_dump -h localhost -U postgres -d mydb -f backup_$(date +%Y%m%d_%H%M%S).sql
gzip backup_*.sql
ls -la backup_*

# AI ensures proper backup procedures

Customization & Configuration

Theme and Appearance

{
  "theme": "dark",
  "accentColor": "#00d4ff",
  "fontSize": 14,
  "fontFamily": "JetBrains Mono",
  "cursorStyle": "block",
  "showLineNumbers": true,
  "transparentBackground": false
}

AI Configuration

{
  "aiProvider": "openai",
  "model": "gpt-4-turbo-preview",
  "maxSuggestions": 5,
  "enableContextualHelp": true,
  "privacyMode": false,
  "shareUsageStats": true
}

Best Practices

Effective AI Usage

  • Be specific: "Show me disk usage by directory" vs "check disk"
  • Include context: "In this Django project, run migrations"
  • Learn from suggestions: Study AI-generated commands
  • Build workflows: Document repetitive command sequences

Security Considerations

  • Review AI commands: Always verify before execution
  • Avoid sharing secrets: Commands may contain sensitive data
  • Use privacy mode: For confidential work
  • Regular cleanup: Clear history with sensitive information

Common Use Cases

System Administration

# "find processes using most memory"
ps aux --sort=-%mem | head -10

# "check disk space by filesystem"
df -h

# "monitor system resources in real time"
htop

# "find large files taking up space"
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null

Git Operations

# "show git commits by author this month"
git log --since="1 month ago" --author="$(git config user.name)" --oneline

# "undo last commit but keep changes"
git reset --soft HEAD~1

# "create and switch to new branch"
git checkout -b feature/new-feature

# "merge branch with no fast-forward"
git merge --no-ff feature-branch

Docker Management

# "clean up unused docker resources"
docker system prune -a

# "show docker container resource usage"
docker stats

# "copy file from container to host"
docker cp container_name:/path/to/file ./local/path

# "execute interactive shell in running container"
docker exec -it container_name /bin/bash

Troubleshooting

AI Issues

  • No suggestions: Check internet connection and API key
  • Poor suggestions: Be more specific in queries
  • Slow responses: Try simpler queries or check server status
  • Privacy concerns: Enable privacy mode in settings

Performance

  • Slow startup: Clear large command history
  • High memory usage: Close unused tabs and sessions
  • Rendering issues: Update graphics drivers
  • Font problems: Install recommended fonts

Checks for Understanding

  1. How do you use AI Drive for natural language commands?
  2. What are the benefits of Warp's block system?
  3. How can you share commands and workflows with team members?
Show answers
  1. Type '#' followed by your natural language query, Warp translates to commands
  2. Structured output, easy navigation, copy/paste outputs, shareable links, searchable history
  3. Copy block links, share workflows, export sessions, create team workspaces

Exercises

  1. Install Warp and configure AI Drive with your preferred settings
  2. Use natural language queries to perform common development tasks
  3. Create a workflow for a repetitive task in your development process
  4. Share a useful command or workflow with a colleague