Skip to main content

Interactive Chat

Have natural conversations with AI about your code, directly in your terminal

The interactive chat feature is your primary interface for AI assistance. It's designed to be conversational, context-aware, and helpfulβ€”asking clarifying questions when needed and providing actionable guidance.

Starting a Chat Session

When you run lovelace chat, you enter an interactive session with full terminal UI:

$ lovelace chat

πŸ€– Lovelace CLI v1.0.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Connected to: claude-sonnet-4-5
Workspace: my-project
Project: /Users/dev/my-project

Type your message or use slash commands:
  /help    Show available commands
  /context Add files to conversation
  /clear   Clear conversation history
  /exit    End session

You: β–ˆ

The CLI shows:

  • βœ… Active AI model
  • βœ… Current workspace
  • βœ… Project directory
  • βœ… Available commands

The Interactive Experience

AI Asks Clarifying Questions

The CLI doesn't just executeβ€”it engages in conversation to understand your needs:

You: Help me build an authentication system

πŸ€– I can help with that! To give you the best guidance, let me ask a few questions:

1. What framework are you using?
   β€’ Next.js
   β€’ Express.js
   β€’ Other

2. What type of authentication?
   β€’ Email/password
   β€’ OAuth (Google, GitHub, etc.)
   β€’ Passkeys
   β€’ Multiple methods

3. Do you have a database set up?
   β€’ Yes (which one?)
   β€’ Not yet

You: Next.js 14 with App Router, OAuth with Google and GitHub, using Prisma with PostgreSQL

πŸ€– Perfect! I'll help you build a Next.js 14 authentication system with:
   βœ“ OAuth integration (Google + GitHub)
   βœ“ Prisma ORM with PostgreSQL
   βœ“ Next-Auth v5 (Auth.js)

Let's start with the setup. First, would you like me to:
   1. Explain the architecture
   2. Generate the code directly
   3. Walk through step-by-step

You: Walk through step-by-step

πŸ€– Great! Here's our plan:

Step 1: Install dependencies
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Notice how the AI:

  • βœ… Asked specific questions
  • βœ… Confirmed understanding
  • βœ… Offered options for how to proceed
  • βœ… Created a structured plan

Multi-Turn Conversations

Continue the dialogue naturally:

[Previous conversation about auth system]

πŸ€– Your auth system is now configured!

Next steps:
   1. Set up OAuth providers in Google/GitHub
   2. Add environment variables
   3. Create login UI

What would you like to tackle first?

You: Show me the OAuth setup for Google

πŸ€– Here's how to set up Google OAuth:

1. Go to Google Cloud Console...
   [Detailed instructions]

Need me to explain any of these steps in more detail?

You: Actually, can you help me with the Prisma schema instead?

πŸ€– Of course! Let's look at your Prisma schema for auth.

Do you want me to:
   β€’ Review your existing schema
   β€’ Generate a complete auth schema
   β€’ Add auth tables to existing schema

You: Add auth tables to my existing schema

πŸ€– I'll need to see your current schema. Use:
   /context prisma/schema.prisma

[After you add context]

Great! I can see you have User and Post tables. I'll add...

The conversation flows naturallyβ€”you can change topics, ask follow-ups, or request different approaches.

Slash Commands

Use slash commands to control the session:

/help - Show Available Commands

You: /help

Available Commands:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Session Control:
  /exit          End chat session
  /clear         Clear conversation history
  /save          Save current session
  /resume SESSION_ID   Resume previous session

Context Management:
  /context <path>    Add file or directory to context
  /context list      Show current context
  /context clear     Clear all context

Agent Operations:
  /agent create <name>    Create new agent
  /agent run <name>       Run agent task
  /agent status           Show agent status

Settings:
  /model <name>      Switch AI model
  /provider <name>   Switch AI provider
  /workspace <name>  Switch workspace

You: β–ˆ

/context - Add Files to Conversation

Give the AI access to your code:

You: /context src/auth/login.ts

βœ“ Added to context: src/auth/login.ts (234 lines)

Current context (1 file, 234 lines):
  β€’ src/auth/login.ts

You: Review this code for security issues

πŸ€– I've reviewed your login.ts file. Here are the security concerns I found:

1. **Critical**: Password hashing missing
   Line 45: Passwords stored in plain text

   Fix:
   ```typescript
   import bcrypt from 'bcrypt';
   const hashedPassword = await bcrypt.hash(password, 10);
  1. High: No rate limiting... [Detailed feedback]

Would you like me to show you how to fix these issues?


You can add multiple files:

You: /context src/auth

βœ“ Added to context: src/auth/ (8 files, 1,247 lines)

Files included: β€’ src/auth/login.ts β€’ src/auth/register.ts β€’ src/auth/session.ts β€’ src/auth/proxy.ts β€’ src/auth/types.ts β€’ src/auth/utils.ts β€’ src/auth/oauth.ts β€’ src/auth/config.ts

You: Explain how the auth system works

πŸ€– I'll walk through your authentication system based on these files:

Overview: Your auth system uses a session-based approach with...

[Comprehensive explanation based on actual code]


### `/model` - Switch AI Models

Change models mid-conversation:

You: /model

Available Models: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Anthropic: β€’ claude-sonnet-4-5 (current) β€’ claude-sonnet-3-7 β€’ claude-haiku-3-5

OpenAI: β€’ gpt-4-turbo β€’ gpt-4 β€’ gpt-3.5-turbo

Google: β€’ gemini-2.0-flash-exp β€’ gemini-pro

Select a model: β–ˆ

You: gpt-4

πŸ€– Switched to gpt-4

[Conversation continues with new model]


## Special Features

### Workspace Context Awareness

The CLI automatically understands your project:

$ lovelace chat

πŸ€– I can see you're working on a Next.js project with TypeScript and Prisma.

How can I help you today?

You: What's the best way to handle errors?

πŸ€– Based on your Next.js + TypeScript setup, I recommend...

[Tailored advice for your stack]


### Intelligent Follow-Ups

The AI remembers context and suggests next steps:

You: Create a user registration endpoint

πŸ€– I've created the registration endpoint in src/api/register.ts

Related next steps:

  1. Add input validation with Zod
  2. Set up email verification
  3. Create registration UI component
  4. Add rate limiting

Would you like help with any of these?

You: 1

πŸ€– Let's add Zod validation to your registration endpoint...


### Code Generation with Explanation

Get code with understanding:

You: Generate password reset flow

πŸ€– I'll create a complete password reset flow. Here's what it includes:

Architecture:

  1. User requests reset β†’ Email with token
  2. Click link β†’ Validate token
  3. Set new password β†’ Update database

Files I'll create: β€’ src/api/password-reset/request.ts β€’ src/api/password-reset/verify.ts β€’ src/api/password-reset/reset.ts β€’ src/components/PasswordResetForm.tsx β€’ src/emails/PasswordResetEmail.tsx

Ready to proceed? (y/n): y

[Generates code with explanations]

Each file explained: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ src/api/password-reset/request.ts β€’ Generates secure reset token β€’ Stores token with expiration β€’ Sends email with reset link

[Detailed explanation for each file]

Would you like me to explain any part in more detail?


## Session Management

### Saving Sessions

Save important conversations:

You: /save

Session saved! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ID: session_a1b2c3d4 Title: Authentication system implementation Created: 2024-01-15 14:30 Messages: 28 Context: 8 files

Resume with: lovelace chat --resume session_a1b2c3d4


### Resuming Sessions

Pick up where you left off:

$ lovelace chat --resume session_a1b2c3d4

πŸ€– Resuming session: Authentication system implementation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Last message: "Would you like me to explain any part in more detail?"

Loaded context: β€’ src/auth/login.ts β€’ src/auth/register.ts β€’ src/auth/session.ts β€’ [5 more files]

You: Yes, explain the token generation

πŸ€– [Continues from where you left off]


### Viewing Session History

$ lovelace sessions list

Recent Sessions: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ session_a1b2c3d4 Auth system implementation 28 msgs 2h ago session_x9y8z7w6 Code review session 15 msgs 1d ago session_m3n2p1q0 Next.js learning 42 msgs 3d ago

Use /resume SESSION_ID or lovelace chat --resume SESSION_ID


## Best Practices

### Effective Prompting

**Be conversational:**

βœ… Good: "Help me understand how sessions work in this auth system" ❌ Verbose: "I need you to provide a comprehensive explanation..."


**Provide context:**

βœ… Good: /context src/auth then ask questions ❌ Missing context: Ask about code without sharing it


**Iterate and refine:**

βœ… Good: You: "Create login form" You: "Add email validation" You: "Style it with Tailwind"

❌ One-shot: "Create perfect login form with everything"


### Managing Context

**Start focused:**
```bash
# Add only relevant files
/context src/auth/login.ts

Expand as needed:

bash
# Add related files when necessary
/context src/auth/session.ts
/context src/types/user.ts

Clear when switching topics:

bash
# Clear context before new topic
/context clear
/context src/api/posts.ts

Tips & Tricks

Quick Actions

Speed up common tasks:

bash
# Quick code review
lovelace chat "/context src/auth/login.ts review this for bugs"

# Instant refactor suggestion
lovelace chat "/context src/components/Form.tsx suggest improvements"

Multi-Step Workflows

Guide AI through complex tasks:

You: I want to add OAuth to my app. What's the plan?

πŸ€– Here's the step-by-step plan:
   1. Install dependencies
   2. Configure OAuth providers
   3. Set up database schema
   4. Create auth routes
   5. Add UI components

Let's start with step 1. Ready?

You: yes

πŸ€– [Guides through each step]

Related Guides

Examples

See these chat features in action:


Start chatting: lovelace chat and experience AI assistance that actually understands your needs.