npm package: @markab21/fizzy-cli
Description: CLI for the Fizzy API - manage boards, cards, and tasks from the command line
Author: Mark Berry
Latest version: 0.1.2

# fizzy-cli

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/markab21/fizzy-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/markab21/fizzy-cli/actions/workflows/ci.yml)

CLI for the [Fizzy](https://fizzy.do) API - manage boards, cards, and tasks from the command line.

## Installation

Requires [Bun](https://bun.sh) runtime.

```bash
# Install globally
bun add -g @markab21/fizzy-cli

# Or run directly with bunx
bunx @markab21/fizzy-cli whoami
```

## Configuration

Set your API token via environment variable or flag:

```bash
# Environment variable (recommended)
export FIZZY_TOKEN="your-api-token"
export FIZZY_ACCOUNT="your-account-slug"  # e.g., "123456"

# Or use flags
fizzy --token "your-token" --account "123456" whoami
```

### Environment Variables

| Variable | Description |
|----------|-------------|
| `FIZZY_TOKEN` | API token (also accepts `FIZZY_API_KEY`) |
| `FIZZY_ACCOUNT` | Account slug for board/card operations |
| `FIZZY_URL` | Custom API base URL (default: `https://app.fizzy.do`) |

## Usage

### Global Options

```
--token <token>   API token (or use FIZZY_TOKEN env)
--account <slug>  Account slug (or use FIZZY_ACCOUNT env)
--url <url>       API base URL (or use FIZZY_URL env)
--json            Output as JSON (for scripting/agents)
-V, --version     Show version
-h, --help        Show help
```

### Commands

#### Identity

```bash
# Show current identity and accounts
fizzy whoami
```

#### Boards

```bash
# List all boards
fizzy boards

# Get board details
fizzy boards:get <board-id>

# Create a board
fizzy boards:create --name "My Board"

# Update a board
fizzy boards:update <board-id> --name "New Name"

# Delete a board
fizzy boards:delete <board-id>
```

#### Cards

```bash
# List all cards
fizzy cards

# List cards with filters
fizzy cards --board <board-id>
fizzy cards --tag <tag-id>
fizzy cards --assignee <user-id>
fizzy cards --status closed

# Get card details
fizzy cards:get <card-number>

# Create a card
fizzy cards:create --board <board-id> --title "New Card"
fizzy cards:create --board <board-id> --title "New Card" --description "Details here"

# Update a card
fizzy cards:update <card-number> --title "Updated Title"

# Delete a card
fizzy cards:delete <card-number>

# Close/reopen a card
fizzy cards:close <card-number>
fizzy cards:reopen <card-number>

# Assign/unassign a user
fizzy cards:assign <card-number> --user <user-id>

# Add/remove a tag
fizzy cards:tag <card-number> --tag "bug"
```

### JSON Output

Use `--json` flag for structured output (useful for scripting and AI agents):

```bash
fizzy --json cards
fizzy --json cards:get 42
```

## Examples

```bash
# Quick workflow: list cards, get details, close
export FIZZY_TOKEN="your-token"
export FIZZY_ACCOUNT="123456"

fizzy cards
fizzy cards:get 42
fizzy cards:close 42

# Create a card with JSON output
fizzy --json cards:create --board abc123 --title "Fix bug"

# Use with a custom Fizzy deployment
fizzy --url https://fizzy.mycompany.com whoami
```

## Development

```bash
# Install dependencies
bun install

# Run CLI locally
bun run index.ts whoami

# Run tests
bun test

# Lint
bun run lint
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License

[MIT](LICENSE)