feat(cli): implement CLI for jigaido bounty tracker #32

Merged
shoko merged 2 commits from fix/issue-11 into main 2026-04-03 16:14:07 +02:00
Owner

Summary

Implement CLI for jigaido bounty tracker per issue #11.

CLI Commands

Command Description
jigaido-cli --group-id 123 add <text> [--link url] [--due date] Add a new bounty
jigaido-cli --group-id 123 list List all bounties in room
jigaido-cli --group-id 123 my List tracked bounties for user
jigaido-cli --group-id 123 update <id> [text] [--link url] [--due date] [--clear-link] [--clear-due] Update a bounty
jigaido-cli --group-id 123 delete <id> Delete a bounty
jigaido-cli --group-id 123 --user-id 456 track <id> Track a bounty
jigaido-cli --group-id 123 --user-id 456 untrack <id> Untrack a bounty

Context Flags

  • --group-id <id> - Group context (negative for Telegram groups)
  • --user-id <id> - User context (Telegram user ID)

Usage

# Add bounty to a group
PYTHONPATH=. python3 cli/main.py --group-id=-1001 add "Fix bug" --link "https://github.com/..."

# List bounties
PYTHONPATH=. python3 cli/main.py --group-id=-1001 list

# Track a bounty
PYTHONPATH=. python3 cli/main.py --group-id=-1001 --user-id=123 track 1

Fixes #11

## Summary Implement CLI for jigaido bounty tracker per issue #11. ## CLI Commands | Command | Description | |---------|-------------| | `jigaido-cli --group-id 123 add <text> [--link url] [--due date]` | Add a new bounty | | `jigaido-cli --group-id 123 list` | List all bounties in room | | `jigaido-cli --group-id 123 my` | List tracked bounties for user | | `jigaido-cli --group-id 123 update <id> [text] [--link url] [--due date] [--clear-link] [--clear-due]` | Update a bounty | | `jigaido-cli --group-id 123 delete <id>` | Delete a bounty | | `jigaido-cli --group-id 123 --user-id 456 track <id>` | Track a bounty | | `jigaido-cli --group-id 123 --user-id 456 untrack <id>` | Untrack a bounty | ## Context Flags - `--group-id <id>` - Group context (negative for Telegram groups) - `--user-id <id>` - User context (Telegram user ID) ## Usage ```bash # Add bounty to a group PYTHONPATH=. python3 cli/main.py --group-id=-1001 add "Fix bug" --link "https://github.com/..." # List bounties PYTHONPATH=. python3 cli/main.py --group-id=-1001 list # Track a bounty PYTHONPATH=. python3 cli/main.py --group-id=-1001 --user-id=123 track 1 ``` Fixes #11
shoko added 1 commit 2026-04-03 14:38:12 +02:00
Create cli/main.py with the following commands:
- add <text> [--link url] [--due date] - Add a new bounty
- list - List all bounties in room
- my - List tracked bounties for user
- update <id> [text] [--link url] [--due date] [--clear-link] [--clear-due]
- delete <id> - Delete a bounty
- track <id> - Track a bounty
- untrack <id> - Untrack a bounty

Context flags:
- --group-id <id> - Group context
- --user-id <id> - User context

Requires either --group-id or --user-id for all commands.

Fixes #11
Collaborator

is it possible to have unit tests for the cli? in a way that we can mock the dependency, but at least making sure that all of these commands are exists, processing the right flags and inputs, and returning the right format

is it possible to have unit tests for the cli? in a way that we can mock the dependency, but at least making sure that all of these commands are exists, processing the right flags and inputs, and returning the right format
shoko added 1 commit 2026-04-03 15:19:07 +02:00
- Tests mock dependencies and verify command existence, flag processing, and output format
- Tests use --group-id=-1001 format (equals sign) to avoid argparse treating -1001 as a flag
- All 17 tests passing
han approved these changes 2026-04-03 16:00:17 +02:00
han left a comment
Collaborator

lgtm

lgtm
shoko merged commit 44bd0488c4 into main 2026-04-03 16:14:07 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jigaido#32