feat: add following CLI commands #93

Merged
erik merged 1 commit from feat/task-35671335-following-cli into main 2026-06-04 07:40:44 -05:00
Owner

Summary

Implement Slugkit following management commands and simplify pending cancellation through unfollow.

Task

#task-35671335

Changes

  • Add slug following list [--json]
  • Add slug following follow <target> [--json]
  • Add slug following unfollow <id> [--json]
  • Remove separate CLI/API cancel behavior; /following/{id}/unfollow now handles accepted records and pending follow requests
  • Remove /following/{id}/cancel route and OpenAPI entry
  • Update following API/CLI docs for unified unfollow semantics
  • Add mocked CLI and API tests for list, follow, unfollow, pending cancellation via unfollow, JSON output, common errors, 501, and invalid usage

Testing

  • Unit tests added/updated
  • Manual testing performed

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated
  • No unrelated changes included
## Summary Implement Slugkit following management commands and simplify pending cancellation through unfollow. ## Task #task-35671335 ## Changes - Add `slug following list [--json]` - Add `slug following follow <target> [--json]` - Add `slug following unfollow <id> [--json]` - Remove separate CLI/API cancel behavior; `/following/{id}/unfollow` now handles accepted records and pending follow requests - Remove `/following/{id}/cancel` route and OpenAPI entry - Update following API/CLI docs for unified unfollow semantics - Add mocked CLI and API tests for list, follow, unfollow, pending cancellation via unfollow, JSON output, common errors, `501`, and invalid usage ## Testing - [x] Unit tests added/updated - [ ] Manual testing performed ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated - [x] No unrelated changes included
feat: add following CLI commands
All checks were successful
CI / build-lint-test (pull_request) Successful in 33s
72247ada45
Task: #task-35671335
Author
Owner

PR Review

Summary

Reviewed PR #93 against task task-35671335, docs/cli-specs/09-following-commands.md, and the user-approved scope update to remove separate cancel semantics. The PR adds the following CLI commands, unifies pending cancellation and accepted unfollow through unfollow, removes the /following/{id}/cancel route/OpenAPI entry, updates docs, and adds CLI/API tests.

Acceptance criteria

  • Can resolve a follow target. — slug following follow <target> sends the target exactly as { target }; API resolves handles/URLs into profile details, and CLI human output displays returned handle/profile.
  • Can follow a target. — tests assert POST /api/v1/following with { target: "@alice@remote.example" } and successful output.
  • Can list following state. — tests assert GET /api/v1/following and human list output.
  • Can unfollow an accepted following record. — API tests cover accepted records through /following/{id}/unfollow.
  • Can cancel a pending following record. — scope update makes pending cancellation use /following/{id}/unfollow; API tests cover pending records through unfollow, and /cancel is removed.
  • JSON output is valid when requested. — CLI tests parse JSON list and unfollow output.
  • 501 Not Implemented responses are displayed clearly. — CLI/API tests cover standardized 501 behavior.
  • Tests cover success and common API errors. — tests cover success, validation, auth, not-found, conflict, 501, and invalid usage.
  • Relevant lint/test checks pass. — ./scripts/pre-pr.sh passed locally and Forgejo CI succeeded.

Blocking issues

None.

Warnings

None.

Verification

  • ./scripts/pre-pr.sh passed locally.
  • Forgejo CI status for CI / build-lint-test (pull_request) is success.

Verdict

Approved. Ready for human merge approval.

## PR Review ### Summary Reviewed PR #93 against task `task-35671335`, `docs/cli-specs/09-following-commands.md`, and the user-approved scope update to remove separate cancel semantics. The PR adds the following CLI commands, unifies pending cancellation and accepted unfollow through `unfollow`, removes the `/following/{id}/cancel` route/OpenAPI entry, updates docs, and adds CLI/API tests. ### Acceptance criteria - [x] Can resolve a follow target. — `slug following follow <target>` sends the target exactly as `{ target }`; API resolves handles/URLs into profile details, and CLI human output displays returned handle/profile. - [x] Can follow a target. — tests assert `POST /api/v1/following` with `{ target: "@alice@remote.example" }` and successful output. - [x] Can list following state. — tests assert `GET /api/v1/following` and human list output. - [x] Can unfollow an accepted following record. — API tests cover accepted records through `/following/{id}/unfollow`. - [x] Can cancel a pending following record. — scope update makes pending cancellation use `/following/{id}/unfollow`; API tests cover pending records through unfollow, and `/cancel` is removed. - [x] JSON output is valid when requested. — CLI tests parse JSON list and unfollow output. - [x] `501 Not Implemented` responses are displayed clearly. — CLI/API tests cover standardized `501` behavior. - [x] Tests cover success and common API errors. — tests cover success, validation, auth, not-found, conflict, `501`, and invalid usage. - [x] Relevant lint/test checks pass. — `./scripts/pre-pr.sh` passed locally and Forgejo CI succeeded. ### Blocking issues None. ### Warnings None. ### Verification - `./scripts/pre-pr.sh` passed locally. - Forgejo CI status for `CI / build-lint-test (pull_request)` is `success`. ### Verdict Approved. Ready for human merge approval.
erik merged commit 85d2360c5d into main 2026-06-04 07:40:44 -05:00
erik deleted branch feat/task-35671335-following-cli 2026-06-04 07:40:44 -05:00
Sign in to join this conversation.
No description provided.