Repository navigation
docs: write the CLI user guide - #122
Conversation
Rewrite the CLI page for ga4gh-sdk main (8b8030f): install with cargo install, configure API roots per service (REGISTRY, TES, DRS), find services in the Cloud Registry with the registry commands, run TES tasks, look up DRS objects, and list what's planned (WES, TRS, token support, device login, profiles, binaries) with links to the SDK issues. Tokens are still not sent, so the curl fallback stays. Closes #110 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Reviewer's GuideDocumentationRewrite the CLI guide as a tested end-user reference for installing and configuring
Update the researchers index entry to reflect the CLI's current supported services and requirements.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Documentation build overview
|
Linked issuesChecked at commit b778849 #123 docs: document the current CLI · 6 of 7 met · 1 to check by hand
|
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/researchers/cli.md" line_range="279" />
<code_context>
+```
+
+The answer can contain headers that you need to download the bytes. The CLI
+doesn't download them; use a tool such as `curl` with the URL. Both commands
+end with the exit code `1` on errors and `2` on missing arguments, like the
+`tes` commands.
</code_context>
<issue_to_address>
**DRS access URLs leak credentials**
When a DRS service returns a signed or bearer-capability URL and the researcher passes the literal URL to `curl`, `curl` receives the capability URL as an argument, exposing it in process listings and, when entered literally, shell history; anyone who can read either can fetch the object.
Warn that access URLs may be credentials and show a way to pass them to `curl` without putting them in command arguments or shell history.
</issue_to_address>
### Comment 2
<location path="docs/researchers/cli.md" line_range="57" />
<code_context>
-## Configure
+```bash
+mkdir -p ~/.ga4gh-cli
+cat > ~/.ga4gh-cli/config.json <<'JSON'
+{
+ "REGISTRY": {
</code_context>
<issue_to_address>
**Existing service settings disappear**
When the config already contains TES or DRS settings, or the heredoc write is interrupted, `cat >` truncates the existing config before writing the registry-only example, discarding those settings; an interrupted write leaves invalid JSON and CLI commands fail.
Change the instructions to preserve existing service sections and write config updates atomically.
</issue_to_address>
### Comment 3
<location path="docs/researchers/cli.md" line_range="255" />
<code_context>
```bash
-TASK_ID=$(cli tes create task.json)
-if [ -z "$TASK_ID" ]; then
+if ! TASK_ID=$(ga4gh-cli tes create task.json); then
echo "The task was not created" >&2
exit 1
</code_context>
<issue_to_address>
**Retries create duplicate tasks**
When the TES service accepts the create request but the response is lost or times out, the CLI returns an error and the script reports that the task was not created, so retrying creates a second task and duplicate executions.
Treat this outcome as unknown and instruct users to verify whether the task exists before retrying.
</issue_to_address>
### Comment 4
<location path="docs/researchers/cli.md" line_range="267" />
<code_context>
+an object, by its ID:
+
+```bash
+ga4gh-cli drs get <OBJECT_ID>
+```
+
</code_context>
<issue_to_address>
**DRS commands fail when copied**
When a reader copies either DRS command without replacing its angle-bracket placeholder, the shell parses `<OBJECT_ID>` or `<ACCESS_ID>` as redirection syntax, so the command fails before `ga4gh-cli` runs and the reader cannot look up the object as shown.
Use shell-safe placeholders and explain that readers must substitute the object or access ID before running the commands.
Also at `docs/researchers/cli.md:275`.
</issue_to_address>Sourcery assessment
Approval pending. 4 findings to address first.
Blocking findings: docs/researchers/cli.md:279, docs/researchers/cli.md:57, docs/researchers/cli.md:255, docs/researchers/cli.md:267
Keep an existing config file, warn that a failed tes create can still have created a task, use shell-safe DRS placeholders, and pass signed access URLs to curl through stdin. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV
Summary
Rewrites the researcher page "Use the Command Line" (
docs/researchers/cli.md) as the end-user guide forga4gh-cliwith ELIXIR On-Cloud, for ga4gh/ga4gh-sdk main at commit8b8030f. The old page described commit82432c3, before the CLI took API roots, so it said proTES couldn't work; that's no longer true.Outline:
cargo install --path cli --locked, pinned to the tested commit~/.ga4gh-cli/config.jsonwithREGISTRY,TESandDRSsections;base_pathis the API root (e.g./ga4gh/tes/v1for proTES)registry list [--type],get,types) athttps://elixir-on.cloud/ga4gh/registry/v1, and turn a registry entry into abase_pathcreate(file, inline JSON, stdin),listwith all options including--all --format jsonl,get,status,cancel, exit codesget,accesscurlfallback staysThe researchers index row is updated to match. The page was already in the
mkdocs.ymlnav.Closes #123
Part of #110; login, submission through the gateway and workflow runs follow in #124 (blocked by ga4gh/ga4gh-sdk#90 and #105).
Light lane: docs only. I reviewed the diff myself against
cli/srcof the SDK; every command and flag shown exists there.Verification
python scripts/check_names.py: passedmkdocs build --strict: passed, no warningspytest: 25 passed, 100% coveragega4gh-cliat8b8030finrust:1.97(cargo build -p ga4gh-cli --locked) and compared all--helpoutputs with the pageregistry list,list --type tes,get,typesagainst the public Cloud Registry, anonymously: output as showntesanddrscommands on the page against a local mock with the APIs at/ga4gh/tes/v1and/ga4gh/drs/v1: right paths and query parameters, output as shown; with a dummy token in the config, no request carried anAuthorizationheaderNotes
The issue also mentions logging in and running a workflow, and "works against the deployed services". The CLI can't do either yet, so the page documents what works now and marks the rest as planned, with the SDK issues linked. The page will need an update when ga4gh/ga4gh-sdk#105, #115 and #31 land; #124 tracks that.
🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMpmDCfbACLj3uy6xV