Skip to content

Conversation

@SgtPooki
Copy link
Collaborator

@SgtPooki SgtPooki commented Nov 19, 2025

Add rm command to CLI. This command will remove a piece from a data set.

Usage

filecoin-pin rm --piece <cid> --data-set <id> --wait-for-confirmation

Options

  • --piece <cid>: The CID of the piece to remove.
  • --data-set <id>: The ID of the data set to remove the piece from.
  • --wait-for-confirmation: Wait for transaction confirmation before exiting.

still in draft because data-set show and rm are conflicting somewhere. See https://filecoinproject.slack.com/archives/C095WFA0QK1/p1763576428763319

@SgtPooki SgtPooki linked an issue Nov 19, 2025 that may be closed by this pull request
@FilOzzy FilOzzy added team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. labels Nov 19, 2025
@FilOzzy FilOzzy added this to FS Nov 19, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Nov 19, 2025
@SgtPooki SgtPooki mentioned this pull request Nov 19, 2025
6 tasks
@SgtPooki SgtPooki requested a review from Copilot November 19, 2025 18:31
Copilot finished reviewing on behalf of SgtPooki November 19, 2025 18:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new rm command to the CLI that enables users to remove pieces from data sets via the Synapse SDK. The implementation follows established patterns from similar commands (add, import) and provides both CLI and library usage patterns through a flexible API design.

Key changes:

  • New rm command with options for piece CID, data set ID, and optional transaction confirmation
  • Core removePiece function supporting both CLI (with dataSetId) and library (with StorageContext) usage patterns
  • Progress event system for tracking transaction submission and confirmation
  • Package export for the new core/piece module

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/commands/rm.ts Defines the CLI command interface with piece, data-set, and wait-for-confirmation options
src/rm/types.ts TypeScript interfaces for rm command options and results
src/rm/remove-piece.ts CLI orchestration layer with input validation, Synapse initialization, and progress tracking
src/rm/index.ts Export file for rm module
src/core/piece/remove-piece.ts Reusable core function for removing pieces with flexible API supporting both CLI and library usage
src/core/piece/index.ts Export file for core piece module
src/cli.ts Registers the new rm command with the main CLI program
package.json Adds package export entry for the new core/piece module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rm --piece $pieceCid command

3 participants