npm package: @mindsync/cli
Description: MindSync CLI - Command-line interface for MindSync productivity app
Author: MindSync
Latest version: 0.1.0

# MindSync CLI

Command-line interface for the MindSync productivity application. Manage tasks, journal entries, and interact with AI directly from your terminal.

## Installation

```bash
npm install -g @mindsync/cli
```

## Configuration

Before using the CLI, you need to configure it with your MindSync instance:

```bash
mindsync config init
```

You'll be prompted to enter:
- API URL (your Supabase project URL)
- Anon Key (your Supabase anon key)

## Authentication

Login to your MindSync account:

```bash
mindsync login
```

Check your current session:

```bash
mindsync whoami
```

Logout:

```bash
mindsync logout
```

## Commands

### Tasks

```bash
# List all tasks
mindsync tasks list

# Filter tasks
mindsync tasks list --status done --priority high

# Create a new task
mindsync tasks add "Task title" -d "Description" -p high

# Update a task
mindsync tasks update <task-id> --status done

# Complete a task
mindsync tasks complete <task-id>

# Delete a task
mindsync tasks delete <task-id>

# Search tasks
mindsync tasks search "keyword"
```

### Journal

```bash
# List journal entries
mindsync journal list

# View a specific entry
mindsync journal view <entry-id>

# Create a new entry
mindsync journal new

# Edit an entry
mindsync journal edit <entry-id>

# Delete an entry
mindsync journal delete <entry-id>

# Search entries
mindsync journal search "keyword"

# Export entries
mindsync journal export --format markdown -o journal.md
```

### AI Assistant

```bash
# Ask a question
mindsync ai ask "How can I be more productive?"

# Start interactive chat
mindsync ai chat

# Get task suggestions
mindsync ai suggest-tasks

# Generate journal prompt
mindsync ai journal-prompt

# Analyze productivity
mindsync ai analyze-productivity

# Use different AI provider
mindsync ai ask "question" --provider groq
```

### Notifications & Reminders

```bash
# List notifications
mindsync notifications list

# Clear all notifications
mindsync notifications clear

# List reminders
mindsync reminders list

# Add a reminder
mindsync reminders add

# Snooze a reminder
mindsync reminders snooze <reminder-id> --minutes 30

# Delete a reminder
mindsync reminders delete <reminder-id>
```

### Statistics

```bash
# View overview dashboard
mindsync stats

# View task statistics
mindsync stats tasks

# View journal statistics
mindsync stats journal

# Export analytics data
mindsync stats export --format csv -o stats.csv
```

### Backup & Restore

```bash
# Create a backup
mindsync backup -o backup.json

# Restore from backup
mindsync restore backup.json
```

## Output Formats

Most list commands support multiple output formats:

```bash
# Table format (default)
mindsync tasks list

# JSON format
mindsync tasks list --json

# CSV format
mindsync tasks list --csv
```

## Environment Variables

### AI Providers

Set API keys for AI features:

```bash
export OPENAI_API_KEY="your-key"
export GROQ_API_KEY="your-key"
export HUGGINGFACE_API_KEY="your-key"
```

### Debug Mode

Enable debug output:

```bash
export DEBUG=true
```

## Examples

### Daily Workflow

```bash
# Check today's tasks
mindsync tasks list --status todo

# Add a new task
mindsync tasks add "Review pull requests" -p high

# Get AI suggestions
mindsync ai suggest-tasks

# Create journal entry
mindsync journal new

# View statistics
mindsync stats
```

### Scripting

Use JSON output for scripting:

```bash
# Get tasks as JSON
mindsync tasks list --json > tasks.json

# Count completed tasks
mindsync tasks list --status done --json | jq 'length'
```

## Development

```bash
# Install dependencies
npm install

# Run in development mode
npm run dev

# Build
npm run build

# Type check
npm run typecheck
```

## License

MIT