Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version-file: '.ruby-version'
bundler-cache: true

- name: Run tests
run: bundle exec rake test
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.7
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "https://rubygems.org"

gem "thor", "~> 1.3"

group :development, :test do
gem "minitest", "~> 5.20"
gem "webmock", "~> 3.19"
gem "rake", "~> 13.0"
end
32 changes: 32 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
bigdecimal (3.3.1)
crack (1.0.1)
bigdecimal
rexml
hashdiff (1.2.1)
minitest (5.26.2)
public_suffix (7.0.0)
rake (13.3.1)
rexml (3.4.4)
thor (1.4.0)
webmock (3.26.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
minitest (~> 5.20)
rake (~> 13.0)
thor (~> 1.3)
webmock (~> 3.19)

BUNDLED WITH
2.5.21
232 changes: 231 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,233 @@
# Fizzy CLI

CLI client for accessing the Fizzy API
A command-line interface for the [Fizzy](https://app.fizzy.do) API.

## Installation

Download the latest release from [GitHub Releases](https://github.com/fizzy/fizzy-cli/releases) and add it to your PATH.

**From source**
```bash
git clone https://github.com/fizzy/fizzy-cli.git
cd fizzy-cli
bundle install
./bin/fizzy --help
```

## Quick Start

1. Get your API token from your [Fizzy profile](https://app.fizzy.do/my/profile) under "Personal access tokens"

2. Configure the CLI:

```bash
fizzy auth login --token YOUR_TOKEN
```

3. List your accounts:

```bash
fizzy identity show
```

4. Set your default account:

```bash
export FIZZY_ACCOUNT=897362094
```

## Usage

```
fizzy <resource> <action> [options]
```

### Global Options

| Option | Environment Variable | Description |
|--------|---------------------|-------------|
| `--token` | `FIZZY_TOKEN` | API access token |
| `--account` | `FIZZY_ACCOUNT` | Account ID |
| `--format` | | Output format: `json` (default), `text` |
| `--quiet` | | Suppress non-essential output |
| `--verbose` | | Show request/response details |

## Commands

### Boards

```bash
# List all boards
fizzy board list

# Show a board
fizzy board show BOARD_ID

# Create a board
fizzy board create --name "Engineering"

# Update a board
fizzy board update BOARD_ID --name "New Name"

# Delete a board
fizzy board delete BOARD_ID
```

### Cards

```bash
# List cards (with optional filters)
fizzy card list
fizzy card list --board BOARD_ID
fizzy card list --status published
fizzy card list --assignee USER_ID

# Show a card
fizzy card show 42

# Create a card
fizzy card create --board BOARD_ID --title "Fix login bug"
fizzy card create --board BOARD_ID --title "New feature" --description "Details here"

# Update a card
fizzy card update 42 --title "Updated title"

# Delete a card
fizzy card delete 42
```

### Card Actions

```bash
# Close/reopen
fizzy card close 42
fizzy card reopen 42

# Move to "Not Now"
fizzy card postpone 42

# Move into a column
fizzy card column 42 --column COLUMN_ID

# Send back to triage
fizzy card untriage 42

# Assign/unassign (toggles)
fizzy card assign 42 --user USER_ID

# Tag/untag (toggles, creates tag if needed)
fizzy card tag 42 --tag "bug"

# Watch/unwatch
fizzy card watch 42
fizzy card unwatch 42
```

### Columns

```bash
fizzy column list --board BOARD_ID
fizzy column show COLUMN_ID --board BOARD_ID
fizzy column create --board BOARD_ID --name "In Progress"
fizzy column update COLUMN_ID --board BOARD_ID --name "Done"
fizzy column delete COLUMN_ID --board BOARD_ID
```

### Comments

```bash
fizzy comment list --card 42
fizzy comment show COMMENT_ID --card 42
fizzy comment create --card 42 --body "Looks good!"
fizzy comment update COMMENT_ID --card 42 --body "Updated comment"
fizzy comment delete COMMENT_ID --card 42
```

### Users

```bash
fizzy user list
fizzy user show USER_ID
```

### Tags

```bash
fizzy tag list
```

### Notifications

```bash
fizzy notification list
fizzy notification read NOTIFICATION_ID
fizzy notification unread NOTIFICATION_ID
fizzy notification read-all
```

## Output Format

All commands output JSON by default:

```json
{
"success": true,
"data": { ... },
"meta": {
"timestamp": "2025-12-10T10:00:00Z"
}
}
```

Errors return a non-zero exit code and structured error info:

```json
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Card not found",
"status": 404
}
}
```

### Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 3 | Authentication failure |
| 4 | Permission denied |
| 5 | Not found |
| 6 | Validation error |
| 7 | Network error |

## Configuration

The CLI looks for configuration in:
- `~/.fizzy/config.yaml`
- `~/.config/fizzy/config.yaml`

```yaml
token: fizzy_abc123...
account: 897362094
api_url: https://app.fizzy.do
```

Environment variables and command-line flags override the config file.

## Pagination

List commands return paginated results. Use `--page` to fetch specific pages or `--all` to fetch everything:

```bash
fizzy card list --page 2
fizzy card list --all
```

## License

MIT
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end

task default: :test
7 changes: 7 additions & 0 deletions bin/fizzy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)

require "fizzy"

Fizzy::CLI.start(ARGV)
16 changes: 16 additions & 0 deletions lib/fizzy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require "thor"
require "json"
require "yaml"
require "net/http"
require "uri"
require "fileutils"
require "time"

require_relative "fizzy/error"
require_relative "fizzy/config"
require_relative "fizzy/client"
require_relative "fizzy/response"
require_relative "fizzy/commands/base"
require_relative "fizzy/commands/auth"
require_relative "fizzy/commands/identity"
require_relative "fizzy/cli"
20 changes: 20 additions & 0 deletions lib/fizzy/cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Fizzy
class CLI < Thor
def self.exit_on_failure?
true
end

class_option :token, type: :string, desc: "API access token (or FIZZY_TOKEN env var)"
class_option :account, type: :string, desc: "Account ID (or FIZZY_ACCOUNT env var)"
class_option :api_url, type: :string, desc: "API base URL (default: https://app.fizzy.do)"
class_option :format, type: :string, default: "json", desc: "Output format: json, text"
class_option :quiet, type: :boolean, default: false, desc: "Suppress non-essential output"
class_option :verbose, type: :boolean, default: false, desc: "Show request/response details"

desc "auth SUBCOMMAND", "Manage authentication"
subcommand "auth", Commands::Auth

desc "identity SUBCOMMAND", "Manage identity"
subcommand "identity", Commands::Identity
end
end
Loading
Loading