Skip to content

Fix stale CLI docs, help text, and dead code - #173

Merged
neuromechanist merged 2 commits into
devfrom
172-fix-stale-cli-documentation-and-help-text
Feb 21, 2026
Merged

neuromechanist merged 2 commits into
devfrom
172-fix-stale-cli-documentation-and-help-text

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Comprehensive documentation audit found 40+ issues across CLI help text, generated docs, README, and CLAUDE.md. This PR fixes the most impactful ones.

generate-docs.ts

  • Added all missing subcommands to the commands object (clone, get, save, push, drop, release, update, collaborators, s3 lock/regenerate-iam, repo public/private, ci check/add, doi update/enrich, make-public, delete-dataset, whoami, switch)
  • Fixed static content: downloading guide (was wrong about default behavior, referenced non-existent --force/--get-data options, used datalad instead of nemar CLI), uploading guide (wrong resume instructions, missing options), quickstart (duplicate step numbering, missing retrieve-key/sandbox steps, missing ORCID), auth guide (missing ORCID, switch, logout --all)

CLI source help text

  • --name now says "defaults to BIDS Name, then directory name" (was just "directory name")
  • Admin help text now lists publish, make-public, delete-dataset
  • Sandbox warning for --sandbox mode says "EZID test shoulder" (was "sandbox.zenodo.org")
  • doi update --refresh description mentions .nemar/metadata.json (was only "BIDS dataset_description.json")
  • Removed emoji from make-public output

Code fixes

  • retrieve-key dead code: The "key already issued" branch was unreachable because backend returns HTTP 409 which always throws ApiError. Moved handling to the catch block with proper 409 detection and api_key_prefix extraction from error details
  • ApiError details: Now passes full response data as details when no explicit details field exists (was passing undefined)
  • Removed unused imports: commitRevert, createRevertBranch, listDatasetVersions from dataset.ts

CLAUDE.md

  • Replaced stale "CLI Commands (Target Structure)" (13 commands) with complete list of all 50+ implemented commands including root-level shortcuts

README.md

  • Added retrieve-key and sandbox steps to Quick Start
  • Replaced non-existent commands (pr create/list/show, version, list --all) with actual commands
  • Fixed download syntax (was showing positional [output] instead of --output flag)

Test plan

  • bun run build succeeds
  • bun test passes (120/120 core tests, 37/37 workflow tests)
  • bun run scripts/generate-docs.ts regenerates all docs
  • nemar dataset upload --help shows corrected --name description
  • nemar admin --help shows make-public and delete-dataset

Closes #172

- Update generate-docs.ts: add all missing subcommands (clone, get,
  save, push, drop, release, update, collaborators, s3 lock, repo,
  make-public, delete-dataset, etc.), fix static content (downloading
  guide, uploading guide, quickstart, auth guide)
- Fix CLI help text: --name describes BIDS Name fallback, admin help
  lists publish/make-public/delete-dataset, sandbox warning uses EZID
  instead of Zenodo, doi update --refresh mentions metadata.json
- Fix retrieve-key dead code: handle 409 in catch block instead of
  unreachable success branch, pass full response as ApiError details
- Remove unused imports (commitRevert, createRevertBranch,
  listDatasetVersions), remove emoji from make-public output
- Update CLAUDE.md CLI commands section with all 50+ implemented
  commands replacing stale 13-command "Target Structure"
- Update README.md: add retrieve-key/sandbox to quickstart, replace
  non-existent pr/version commands with actual commands
- Regenerate all docs from updated script
- Fix --bump to --type in quickstart docs
- Fix DataLad references to git-annex in index
- Add details wrapper to 409 response in backend
- Revert broad data.details fallback in api.ts
- Clean up RetrieveKeyResponse type (remove stale fields)
- Show actual error message in non-ApiError catch
@neuromechanist
neuromechanist merged commit 854d401 into dev Feb 21, 2026
7 checks passed
@neuromechanist
neuromechanist deleted the 172-fix-stale-cli-documentation-and-help-text branch February 21, 2026 01:09
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