Skip to main content

lovelace reset

Reset Lovelace CLI to factory defaults

The reset command removes all configuration, data, and cached files, returning the CLI to a fresh installation state. This is useful for troubleshooting severe issues or starting over with a clean setup.

Overview

The reset command allows you to:

  • Complete reset - Remove all CLI data and configuration
  • Selective reset - Reset specific components only
  • Preserve data - Keep certain data while resetting configuration
  • Backup before reset - Automatic backup of important data
  • Fresh start - Resolve configuration conflicts and corruption

⚠️ WARNING: Reset operations are destructive and cannot be undone. Always back up important data before resetting.

Usage

bash
lovelace reset [options]

Options

OptionDescriptionDefault
--allReset everything (config, data, sessions, auth)false
--configReset configuration onlyfalse
--dataReset data and cache onlyfalse
--sessionsClear all session historyfalse
--authClear authentication credentialsfalse
--keep-workspacesPreserve workspace data during resetfalse
--no-backupSkip automatic backupfalse
--forceSkip confirmation promptsfalse

Interactive Examples

Complete Reset

$ lovelace reset --all

⚠️  CRITICAL WARNING: Complete CLI Reset
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This will permanently delete ALL Lovelace CLI data:

Configuration:
  • Provider settings and API keys
  • Workspace preferences
  • Custom paths and settings

Data:
  • 47 chat sessions (1.2 GB)
  • 12 MCP sessions (450 MB)
  • 8 agent executions (800 MB)
  • Cached data (2.1 GB)

Authentication:
  • Current session (user@example.com)
  • Saved credentials
  • API tokens (3 active)

Workspaces:
  • personal-projects (12 sessions)
  • work (8 sessions)

TOTAL DATA: ~4.5 GB will be deleted
This action CANNOT be undone!

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Backup will be created at:
  ~/.lovelace-backup-2025-10-19-14-30/

Type 'reset everything' to confirm: reset everything

Creating backup...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Backed up configuration
✓ Backed up sessions (47 files)
✓ Backed up workspaces (2 workspaces)
✓ Backed up authentication data
✓ Backup complete: ~/.lovelace-backup-2025-10-19-14-30/

Resetting CLI...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Removed configuration files
✓ Cleared session history
✓ Removed workspace data
✓ Cleared authentication
✓ Removed cached data
✓ Reset permissions

✓ Lovelace CLI reset to factory defaults

Next steps:
  1. Run: lovelace setup
     → Configure LLM providers
  2. Run: lovelace auth login
     → Sign in to your account
  3. Run: lovelace workspace create personal-projects
     → Recreate workspaces

Backup available at: ~/.lovelace-backup-2025-10-19-14-30/

Reset Configuration Only

$ lovelace reset --config

Reset Configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This will reset:
  • Provider settings (API keys preserved)
  • Workspace preferences
  • Custom paths
  • General settings

Will NOT affect:
  • Session history
  • Authentication data
  • Workspace files

Current configuration will be backed up.

Continue? (y/N): y

✓ Configuration backed up to ~/.lovelace/config.json.backup
✓ Configuration reset to defaults

Run 'lovelace setup' to reconfigure providers.

Clear Sessions Only

$ lovelace reset --sessions

Clear All Sessions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This will permanently delete:
  • 47 chat sessions (1.2 GB)
  • 12 MCP sessions (450 MB)
  • 8 agent executions (800 MB)
  • All conversation history
  • Session metadata

Configuration and authentication will NOT be affected.

Type 'clear sessions' to confirm: clear sessions

Clearing sessions...
✓ Removed 47 chat sessions
✓ Removed 12 MCP sessions
✓ Removed 8 agent executions
✓ Cleared session indices
✓ Freed 2.4 GB disk space

Session history cleared successfully.

Reset Authentication

$ lovelace reset --auth

Reset Authentication
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This will:
  • Sign you out
  • Remove saved credentials
  • Revoke 3 active API tokens
  • Clear authentication cache

You will need to sign in again.

Continue? (y/N): y

Resetting authentication...
✓ Session revoked
✓ Credentials cleared
✓ API tokens revoked (3 tokens)
✓ Authentication cache cleared

✓ Authentication reset successfully

Run 'lovelace auth login' to sign in again.

Reset with Workspace Preservation

$ lovelace reset --all --keep-workspaces

Complete Reset (Preserving Workspaces)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This will reset everything EXCEPT:
  ✓ Workspace files and structure
  ✓ Workspace-specific settings

Will delete:
  • Configuration
  • Session history
  • Authentication
  • Cached data

Workspaces to preserve:
  • personal-projects (12 sessions, 2.1 GB)
  • work (8 sessions, 1.4 GB)

Type 'reset but keep workspaces' to confirm: reset but keep workspaces

Creating backup...
✓ Backup complete

Resetting CLI (preserving workspaces)...
✓ Configuration reset
✓ Sessions cleared (but workspace metadata preserved)
✓ Authentication cleared
✓ Cache cleared
✓ Workspaces preserved

✓ Reset complete
✓ Workspace data intact

Run 'lovelace setup' and 'lovelace auth login' to reconfigure.

Force Reset (Skip Confirmation)

$ lovelace reset --config --force

⚠️  Force reset enabled - skipping confirmation

✓ Configuration backed up
✓ Configuration reset to defaults

Run 'lovelace setup' to reconfigure.

Reset Without Backup

$ lovelace reset --config --no-backup

⚠️  WARNING: No Backup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

--no-backup specified: Configuration will NOT be backed up
This makes reset completely unrecoverable!

Are you absolutely sure? (yes/NO): yes

Resetting configuration (no backup)...
✓ Configuration reset

No backup created as requested.
Run 'lovelace setup' to reconfigure.

Reset Scope Comparison

What Gets Reset--all--config--data--sessions--auth
Configuration---
Provider Settings---
API Keys---
Session History---
Workspace Data---
Authentication---
Cached Data---
Logs---

Common Use Cases

Troubleshoot Configuration Corruption

Reset config when it's broken:

$ lovelace config show
Error: Invalid configuration

$ lovelace reset --config
✓ Configuration reset

$ lovelace setup
[Reconfigure from scratch]

Clean Up Disk Space

Remove old sessions and cached data:

$ lovelace reset --sessions --data

✓ Cleared 4.2 GB
✓ Disk space freed

Start Fresh After Testing

Reset everything after experimental changes:

$ lovelace reset --all

✓ Complete reset
✓ Factory defaults restored

Switch to New Account

Clear auth to sign in with different account:

$ lovelace reset --auth

✓ Signed out
✓ Credentials cleared

$ lovelace auth login
Email: newuser@example.com
[Sign in with new account]

Resolve Permission Issues

Reset and fix permissions:

$ lovelace reset --all

✓ All data removed
✓ Permissions reset

$ lovelace setup
[Fresh installation with correct permissions]

Backup Location

Automatic backups are created before reset:

~/.lovelace-backup-YYYY-MM-DD-HH-MM/
├── config.json               # Configuration backup
├── sessions/                 # Session history
│   ├── chat/
│   ├── mcp/
│   └── agents/
├── workspaces/               # Workspace data
│   ├── personal-projects/
│   └── work/
└── auth/                     # Authentication data
    └── credentials.enc

Backup Retention: Backups are kept indefinitely. Manually delete old backups to free space.

Restore from Backup

To restore from a backup:

bash
# Stop CLI operations
# Find backup
ls -la ~/.lovelace-backup-*/

# Restore configuration
cp ~/.lovelace-backup-2025-10-19-14-30/config.json ~/.lovelace/config.json

# Restore sessions
cp -r ~/.lovelace-backup-2025-10-19-14-30/sessions/* ~/.lovelace/sessions/

# Restore workspaces
cp -r ~/.lovelace-backup-2025-10-19-14-30/workspaces/* ~/.lovelace/workspaces/

# Verify
lovelace config show
lovelace sessions

What Gets Removed

Complete Reset (--all)

~/.lovelace/
├── config.json          ✗ Deleted
├── auth/                ✗ Deleted
│   ├── credentials.enc  ✗ Deleted
│   └── session.json     ✗ Deleted
├── sessions/            ✗ Deleted
│   ├── chat/            ✗ Deleted
│   ├── mcp/             ✗ Deleted
│   └── agents/          ✗ Deleted
├── workspaces/          ✗ Deleted
├── data/                ✗ Deleted
├── logs/                ✗ Deleted
└── cache/               ✗ Deleted

Configuration Reset (--config)

~/.lovelace/
├── config.json          ✗ Reset to defaults
├── auth/                ✓ Preserved
├── sessions/            ✓ Preserved
├── workspaces/          ✓ Preserved (settings reset)
└── data/                ✓ Preserved

Sessions Reset (--sessions)

~/.lovelace/
├── config.json          ✓ Preserved
├── sessions/            ✗ Deleted
│   ├── chat/            ✗ Deleted
│   ├── mcp/             ✗ Deleted
│   └── agents/          ✗ Deleted
└── auth/                ✓ Preserved

Exit Codes

CodeMeaning
0Reset completed successfully
1Reset failed or cancelled
2Backup creation failed
3Insufficient permissions

Safety Features

Confirmation Prompts

  • Type exact phrases for destructive operations
  • Color-coded warnings for critical actions
  • Dry-run preview of what will be deleted
  • Size estimates for data removal

Automatic Backups

  • Default behavior: Always create backup unless --no-backup
  • Timestamped backups: Prevent overwriting previous backups
  • Backup verification: Ensure backup succeeded before reset
  • Restoration guide: Instructions included in backup

Permission Checks

  • Write access verification before attempting reset
  • Lock file prevention - won't reset if CLI is running
  • Safe cleanup - proper file deletion without corruption

Troubleshooting

Reset Fails

Error: Cannot reset - CLI is currently running

Solution:
1. Close all lovelace CLI sessions
2. Check for background processes: ps aux | grep lovelace
3. Kill if needed: pkill -f lovelace
4. Retry: lovelace reset

Backup Creation Fails

Error: Failed to create backup
Insufficient disk space

Solution:
1. Free up space: lovelace sessions clear --older-than 30
2. Skip backup (risky): lovelace reset --no-backup
3. Use custom backup location: export LOVELACE_BACKUP_DIR="/path/with/space"

Permission Denied

Error: Permission denied
Cannot remove ~/.lovelace/config.json

Solution:
$ chmod -R u+w ~/.lovelace/
$ lovelace reset

Partial Reset

Warning: Partial reset completed
Some files could not be removed

Check:
1. File permissions: ls -la ~/.lovelace/
2. Locked files: lsof | grep lovelace
3. Manually remove stubborn files

Related Commands

Related Guides


See the Command Reference for all available commands.