Repository navigation
Add list pagination, --owner filter, ds->on download redirect - #320
Merged
neuromechanist merged 4 commits intoMar 21, 2026
Merged
Conversation
Backend: - GET /datasets: add owner query param, return total_count/limit/offset - GET /datasets: include source/source_id in managed dataset responses - GET /datasets/resolve/:sourceId: new endpoint for ds->on lookup - executeAndReturn: parallel COUNT query for total_count CLI list: - Default to 20 results per page (was 50) - Add -n/--limit, --page, --offset, --all pagination options - Add --owner <username> filter - Show pagination footer with page info and next page hint - JSON output includes total_count, limit, offset CLI download: - For ds###### datasets, check for on###### NEMAR counterpart - If found, prompt user to download from NEMAR instead (git-annex) - Falls through to OpenNeuro download if no counterpart or declined Closes #319
- Separate API call from inquirer prompt in resolveOpenNeuroId so Ctrl+C propagates correctly instead of being swallowed - Add try-catch and input validation to resolve endpoint - Use Promise.allSettled so COUNT query failure does not crash the main dataset list query - Fix NaN propagation when limit/offset are non-numeric strings - Use != null check for limit param in API client - Fallback query now respects user's limit/offset - Update JSDoc to document new params and pagination response
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR320Version: 🤖 Updated on each push. |
- Resolve endpoint only matches public datasets to prevent leaking private dataset metadata via source ID enumeration - Remove visibility from resolve response (always public) - Make --mine and --owner mutually exclusive with clear error
The list --json output changed from a plain array to
{ datasets, total_count, limit, offset }. Update tests
to match the new pagination-aware response shape.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /datasetsnow returnstotal_count,limit,offsetfor proper pagination; addsownerquery param and includessource/source_idfields. NewGET /datasets/resolve/:sourceIdendpoint for ds->on lookup.-n/--limit,--page,--offset,--allpagination and--owner <username>filter. Shows pagination footer.ds######(OpenNeuro), checks for NEMARon######counterpart. If found, prompts to download from NEMAR instead (git-annex version tracking).Test plan
bun run build)bun test test/openneuro.test.ts)nemar dataset listshows 20 results by defaultnemar dataset list --page 2shows next pagenemar dataset list -n 50shows 50 resultsnemar dataset list --owner yahyafilters by ownernemar dataset list --allshows all (up to 200)nemar dataset download ds007315checks for on counterpart/datasets?limit=20&offset=0returnstotal_count/datasets/resolve/ds007315returns on counterpartCloses #319