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);
- 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:
- Add input validation with Zod
- Set up email verification
- Create registration UI component
- 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:
- User requests reset β Email with token
- Click link β Validate token
- 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:
# Add related files when necessary
/context src/auth/session.ts
/context src/types/user.ts
Clear when switching topics:
# Clear context before new topic
/context clear
/context src/api/posts.ts
Tips & Tricks
Quick Actions
Speed up common tasks:
# 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
- Agent Management - Run long tasks in background
- MCP REPL - Direct tool execution
- Workspace Operations - Organize projects
Examples
See these chat features in action:
- Hackathon Project Example - Building a complete app
- Learning Next.js Example - Interactive learning session
Start chatting: lovelace chat and experience AI assistance that actually understands your needs.