Skip to content

feat: add unpin all subcommand with safety guards#39

Merged
pcfreak30 merged 1 commit into
developfrom
feat/unpin-all-command
May 17, 2026
Merged

feat: add unpin all subcommand with safety guards#39
pcfreak30 merged 1 commit into
developfrom
feat/unpin-all-command

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented May 17, 2026

Copy link
Copy Markdown
Member

Add unpin all subcommand with safety guards for bulk pin removal

This PR introduces the pinner unpin all subcommand, which allows users to remove all pins (optionally filtered by status) in a single operation. Given the destructive nature of this action, multiple safety guards are implemented:

  • --confirm flag required: The command will not execute without explicitly passing --confirm to acknowledge the destructive operation.
  • Interactive safety prompt: By default, users must type the exact number of pins being removed to confirm the action.
  • --yes flag for non-interactive use: In scripts or CI environments, --yes skips the interactive prompt (but --confirm remains required).
  • --dry-run support: Preview which pins would be removed without actually unpinning them.
  • --status filter: Optionally target only pins with a specific status (e.g., --status failed to unpin only failed pins).
  • Batch options: Supports --parallel and --continue flags for controlling concurrency and error handling.

Key changes:

  • New UnpinAll method added to the PinningService interface and implemented in PinningServiceDefault (lists pins, extracts CIDs, delegates to UnpinBatch)
  • New ErrUnpinAllAborted error type for when the safety prompt is cancelled
  • New --yes flag constant (FlagYes)
  • Updated unpin command description and registered all as a subcommand
  • Comprehensive unit tests for the new command

@kody-ai

kody-ai Bot commented May 17, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 33.9%

Generated from commit: a276c9a
Repository: LumeWeb/pinner-cli

@pcfreak30 pcfreak30 merged commit 76b42fb into develop May 17, 2026
2 checks passed
@pcfreak30 pcfreak30 deleted the feat/unpin-all-command branch May 17, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant