Skip to content

feat: add progress for ipfs get command#11235

Draft
ChayanDass wants to merge 5 commits intoipfs:masterfrom
ChayanDass:feedback-progress
Draft

feat: add progress for ipfs get command#11235
ChayanDass wants to merge 5 commits intoipfs:masterfrom
ChayanDass:feedback-progress

Conversation

@ChayanDass
Copy link
Copy Markdown

@ChayanDass ChayanDass commented Mar 14, 2026

Summary

Add progress output for ipfs get so users see fetching status, item/block counts, and a progress bar when downloading.

Fixes #10339

What changed

  • Progress output when -p / --progress is used (default on):
    • Fetching: Fetching CID: <cid>
    • Summary: Items: N files | Blocks: M
    • Saving: Saving to <path>
    • Blocks: Blocks: X / M updated during extraction
    • Byte progress bar (e.g. 82.08 MiB / 82.08 MiB [====] 100%)

How to test

  1. Start daemon: ipfs daemon
  2. In another terminal: ipfs get <cid> or ipfs get <cid> -p
./cmd/ipfs/ipfs get QmdXkUiqCvZS7zsJD2UY6ZJqLbV6xBpT1UdUHoCY7jaVo7
Fetching CID: QmdXkUiqCvZS7zsJD2UY6ZJqLbV6xBpT1UdUHoCY7jaVo7
Items: 9 files | Blocks: 341

Saving file(s) to QmdXkUiqCvZS7zsJD2UY6ZJqLbV6xBpT1UdUHoCY7jaVo7
Blocks: 341 / 341
 82.08 MiB / 82.08 MiB [=========================================================================] 100.00% 0s

Update stat to show file count

./cmd/ipfs/ipfs dag stat QmXyczUxKg8BeLQQQrqFKSgfP1qNKDgPVk2RRL1CWVwsrr      

CID                                             Blocks          Files           Size
QmXyczUxKg8BeLQQQrqFKSgfP1qNKDgPVk2RRL1CWVwsrr  417             64              94478435

Summary
Total Size: 94478435 (94 MB)
Unique Blocks: 417
Total Files: 64
Shared Size: 0 (0 B)
Ratio: 1.000000

@ChayanDass ChayanDass requested a review from a team as a code owner March 14, 2026 21:56
- get: show progress (Items: N files, Blocks, Saving to) using dag stat API
  output only;
- dag stat: add NumFiles (UnixFS file count, exclude chunk nodes); single
  traversal using file vs directory type; show Files column and Total Files
  in summary
- dag: add NumFiles to DagStat and DagStatSummary for JSON and text output

Signed-off-by: Chayan Das <01chayandas@gmail.com>
@ChayanDass
Copy link
Copy Markdown
Author

hi @lidel , could you review this ,when get time!

Copy link
Copy Markdown
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @ChayanDass, progress output for ipfs get is a welcome improvement, however I'm switching this to draft as this PR has to be reworked to address issues below and inline.

Split into two PRs

The dag stat NumFiles addition and ipfs get progress are independent features. The dag stat change modifies API that should be UnixFS-agnostic. Please split them.

Consider simplifying the ipfs get changes to avoid unixfs parsing overhead and only improving presentation of data that is already available. If you really want to add new data, it has to be done in efficient way.

No tests

No test coverage for any of the new code. At minimum:

  • Add test/cli cases for ipfs get progress output (visible with -p, suppressed with -p=false)
  • Unit tests for the file-counting logic covering: directories, multi-chunk files, single-chunk files, symlinks, and CIDv1 raw-leaf content

Performance and security problems

See details inline

@lidel lidel marked this pull request as draft March 16, 2026 18:30
Signed-off-by: Chayan Das <01chayandas@gmail.com>
@ChayanDass
Copy link
Copy Markdown
Author

I’ve updated the implementation to remove file count from dag stat and use only block-based progress.

Could you please take a look? If everything looks good, I’ll move forward with adding tests.
image

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.

Add progress feedback to ipfs get

2 participants