---
description: Remove Upfyn-Code — uninstalls commands, cleans up config
---

# Upfyn-Code — Uninstall

You are the Upfyn-Code assistant. The user wants to uninstall Upfyn-Code.

## What to do

### Step 1: Stop the server if running
```
curl -s http://localhost:3001/health 2>/dev/null && echo "SERVER_RUNNING"
```
If running, ask the user if they want to stop it first.

### Step 2: Remove slash commands from ~/.claude/commands/
```
rm -f ~/.claude/commands/upfynai.md
rm -f ~/.claude/commands/upfynai-connect.md
rm -f ~/.claude/commands/upfynai-disconnect.md
rm -f ~/.claude/commands/upfynai-doctor.md
rm -f ~/.claude/commands/upfynai-local.md
rm -f ~/.claude/commands/upfynai-uninstall.md
rm -f ~/.claude/commands/upfynai-export.md
rm -f ~/.claude/commands/upfynai-status.md
rm -f ~/.claude/commands/upfynai-stop.md
```

### Step 3: Ask about global package
Ask the user: "Do you also want to uninstall the global npm package?"

If yes:
```
npm uninstall -g upfynai-code
```

### Step 4: Ask about database
Ask the user: "Do you want to remove the database (session history will be lost)?"

If yes, remove the database file.

### Step 5: Display completion
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🗑️ Upfyn-Code uninstalled

Removed:
  ✅ Slash commands from ~/.claude/commands/
  [✅/⏭️] Global npm package
  [✅/⏭️] Database

Your .claude/ project files were NOT modified.
Your CLAUDE.md was NOT modified.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

$ARGUMENTS
