Interactive Mode Quick Start

Streaming Conversations · Persistent Context · Instant Code Generation

Interactive Mode transforms Gemini CLI into a persistent conversation partner. Unlike single-command interactions, it maintains context across your entire session, enabling natural back-and-forth conversations that build upon previous exchanges. Perfect for iterative development, debugging, and complex problem-solving workflows.

Enable Mode

Start Interactive Mode with a simple command. The CLI will enter a persistent session where each input builds on the conversation history:

# Start interactive session
$ gemini interactive
# Or use the short flag
$ gemini -i
🤖 Interactive Mode enabled. Type your message or /help for commands.
You> _

Context Memory

The session remembers everything from your conversation. Reference previous code, continue discussions, and build complex solutions step by step:

You> Create a React component for user profile
🤖 [Generated ProfileComponent.jsx]
You> Add TypeScript types to that component
🤖 [Enhanced with TypeScript interfaces]
You> Now add form validation
🤖 [Added validation logic to the same component]

Command Shortcuts

Interactive Mode includes powerful shortcuts for session management:

  • /helpShow all available commands and shortcuts
  • /clearReset conversation context and start fresh
  • /saveExport current conversation to a file
  • /loadImport and continue a previous conversation
  • /exitGracefully exit Interactive Mode
  • Ctrl+CForce quit immediately

Exit & Cleanup

Properly exit your session to save context and clean up resources:

You> /exit
🤖 Saving session history...
🤖 Interactive Mode ended. Session saved to ~/.gemini/sessions/
# Or force quit anytime
^C (Ctrl+C)

Best Practices

  • Start with context: Begin sessions by describing your project or goals to establish relevant context.
  • Use descriptive requests: Reference "the component we just created" or "the function above" to leverage context memory.
  • Save important sessions: Use /save for complex conversations you might want to revisit or share.
  • Clear when switching topics: Use /clear to reset context when moving to unrelated tasks.
  • Iterate incrementally: Build complex solutions step by step, letting each response inform the next request.
  • Use for debugging: Perfect for troubleshooting where you need to share error messages and iterate on solutions.