npm package: @reeverdev/cli
Description: Reever CLI - Productivity from your terminal
Author: Reever Team
Latest version: 0.1.3

# Reever CLI

Reever CLI - Productivity from your terminal. Manage your tasks, lists, events, and more directly from the command line.

## Installation

```bash
npm install -g @reeverdev/cli
```

### From Source

```bash
git clone https://github.com/ReeverApp/Reever.CLI.git
cd Reever.CLI
npm install
npm run build
npm link
```

## Quick Start

```bash
# Login to your account
reever login

# View today's tasks and events
reever today

# Add a task
reever add "Buy groceries"

# View your stats
reever stats
```

## Commands

### Authentication

```bash
reever login                      # Interactive login
reever login -e email -p pass     # Direct login
reever whoami                     # Show current user
reever logout                     # Logout
```

### Tasks

```bash
# List tasks
reever tasks                      # All pending tasks
reever tasks --today              # Today's tasks
reever tasks --week               # This week's tasks
reever tasks --important          # Important tasks
reever tasks --overdue            # Overdue tasks
reever tasks --completed          # Include completed
reever tasks --list <id>          # Filter by list
reever tasks --json               # JSON output

# Add task
reever add "Task title"
reever add "Meeting" --due "tomorrow 2pm" --priority high
reever add "Review PR" --list <id> --important

# Complete tasks
reever done <id>
reever done id1 id2 id3           # Multiple

# Delete task
reever task delete <id>
reever task delete <id> --force   # Skip confirmation

# Search tasks
reever search "keyword"
reever search "bug" --all         # Include completed
```

### Task Steps

```bash
reever steps <taskId>             # List steps
reever step add <taskId> "Step"   # Add step
reever step done <taskId> <stepId> # Complete step
```

### Lists

```bash
reever lists                      # List all
reever lists --json               # JSON output
reever list create "Work"         # Create list
reever list create "Personal" --color "#FF5733"
```

### Events

```bash
reever events                     # List events
reever events --today             # Today's events
reever events --week              # This week's events
reever events --json              # JSON output

# Create event
reever event create "Meeting" --start "tomorrow 2pm" --end "tomorrow 3pm"
reever event create "Birthday" --start "dec 25" --all-day
```

### Tags

```bash
reever tags                       # List all tags
reever tag create "urgent"        # Create tag
reever tag create "work" --color "#3498db"
```

### Git Integration

```bash
# Create branch from task
reever git branch <taskId>
reever git branch <taskId> --prefix feature
reever git branch <taskId> --checkout

# Commit with task reference
reever git commit                 # Auto-detect from branch
reever git commit --task <id>     # Specify task
reever git commit --message "Fix bug"
```

### Productivity

```bash
reever today                      # Today's tasks & events
reever stats                      # Productivity statistics
reever sync                       # Sync with server
```

### Configuration

```bash
reever config                     # Show all config
reever config --path              # Config file path
```

### Shell Completion

```bash
# Bash
reever completion bash >> ~/.bashrc

# Zsh
reever completion zsh >> ~/.zshrc

# Fish
reever completion fish > ~/.config/fish/completions/reever.fish
```

## Natural Language Dates

The `--due`, `--start`, and `--end` options support natural language:

- `today`, `tomorrow`, `yesterday`
- `next monday`, `next week`
- `in 2 hours`, `in 3 days`
- `december 25`, `2024-12-25`
- `tomorrow at 2pm`, `friday 10:30`

## JSON Output

All list commands support `--json` for scripting:

```bash
reever tasks --json | jq '.[] | select(.isImportant)'
reever lists --json | jq '.[].title'
```

## Configuration

Config stored at `~/.config/reever-cli/config.json`:

```json
{
  "apiUrl": "https://api.reever.app",
  "token": "...",
  "user": { ... }
}
```

## Project Structure

```
src/
├── commands/
│   ├── auth/       # login, logout, whoami
│   ├── tasks/      # tasks, add, done, delete, search
│   ├── lists/      # lists, create
│   ├── events/     # events, create
│   ├── tags/       # tags, create
│   ├── steps/      # steps, add, done
│   ├── git/        # branch, commit
│   ├── completion.ts
│   └── stats.ts
├── core/           # api, config, logger
├── lib/            # output, prompts, date
├── types/          # TypeScript types
└── constants/      # API endpoints, messages
```

## Development

```bash
npm install          # Install dependencies
npm run dev          # Development mode
npm run build        # Build
npm run lint         # Lint
npm test             # Run tests
```

## Tech Stack

- Node.js 18+
- TypeScript 5
- Commander.js
- Axios
- Inquirer
- Chalk, cli-table3, ora
- chrono-node
- conf

## License

MIT