Skip to content

docs(cli): object and array-of-object params do work via CLI - #646

Open
Ethan-Arrowood wants to merge 2 commits into
mainfrom
docs/cli-object-params
Open

docs(cli): object and array-of-object params do work via CLI#646
Ethan-Arrowood wants to merge 2 commits into
mainfrom
docs/cli-object-params

Conversation

@Ethan-Arrowood

Copy link
Copy Markdown
Member

What

reference/cli/operations-api-commands.md asserted in three places that nested objects and arrays of objects cannot be passed as CLI arguments. They can, and the page contradicted itself: it showed a working ids='["1","2","3"]' array a few lines above the "objects not supported" text.

Verified against

harper @ origin/main:

  • bin/cliOperations.tsbuildRequest() splits each argv entry on the first = and JSON.parses the value, falling back to the raw string when the parse throws. Scalars, arrays, and objects all take that one path, so there is no code basis for treating objects differently from the array example already on the page.
  • bin/cliOperations.tsRAW_STRING_FIELDS is new Set(['ref']). ref is the only field exempted from the parse (added so ref=1.0 is not rewritten into the number 1, then the tag "1"). The exception list has not grown.
  • bin/deploySetup.ts prints credentials='${JSON.stringify([credentialEntry])}' as the recommended command after sealing a git or npm token, i.e. an array-of-objects CLI argument is the documented happy path, not an edge case.
  • bin/backup.tsrunBackupCommand() / downloadBackup() streams get_backup to a file, and PREPARE_OPERATION.deploy_component in cliOperations.ts does a multipart upload with SSE progress. Both disprove the old "File upload operations / Streaming operations" limitation entries.

Changes

Restricted to reference/cli/operations-api-commands.md only (avoiding overlap with #624).

  • Supported Operations intro — replaced the "must be executed through the HTTP API" claim with the actual parse rule and a pointer to Parameter Formatting.
  • Parameter Formatting — states the JSON-parse-with-string-fallback rule once up front, which explains string, array, object, and boolean parameters uniformly. Notes the ref exception.
  • Object Parameters — now documents that objects and arrays of objects are supported, with the worked deploy_component credentials example, the shell quoting rules that genuinely apply (single quotes, one argument, embedding a literal '), and a warning that arguments are visible in shell history, ps, and CI logs.
  • Limitations — rewritten around real constraints: raw binary request bodies, the OS argument-length cap with no stdin form, and command-line secret exposure. Dropped the four false/misleading entries.

Checks

  • npm run format:check clean
  • npm run build succeeds (the two reported broken anchors are pre-existing, in backups/overview and release-notes/v5-lincoln/5.1, and unrelated to this file)

Closes #639

🤖 Generated with Claude Code

@Ethan-Arrowood
Ethan-Arrowood requested a review from a team as a code owner August 27, 2026 20:36
@github-actions
github-actions Bot temporarily deployed to pr-646 August 27, 2026 20:39 Inactive
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-646

This preview will update automatically when you push new commits.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the CLI operations API documentation to clarify that nested objects and arrays of objects are supported via JSON-parsed argument values. It adds detailed explanations of parameter formatting, quoting rules, and security warnings regarding command-line arguments, while updating the limitations section to accurately reflect constraints like raw binary bodies and large payloads. There are no review comments, so no feedback is provided.

The Operations API commands page asserted in three places that nested
objects and arrays of objects cannot be passed as CLI arguments. That is
not true, and the page contradicted itself: it showed a working
`ids='["1","2","3"]'` array a few lines above the claim.

`buildRequest()` in `bin/cliOperations.ts` JSON-parses every argument
value, falling back to the raw string when the parse throws. Scalars,
arrays, and objects all take that one path, so there is no basis for
treating objects differently. `RAW_STRING_FIELDS` is `new Set(['ref'])` --
`ref` is the sole field exempted from the parse, so a numeric-looking git
tag is not rewritten into a number.

- State the actual parse rule once, at the top of Parameter Formatting,
  and note the `ref` exception.
- Replace the "objects not supported" section with the `deploy_component`
  `credentials` array-of-objects example that `harper deploy setup=true`
  itself prints, plus the shell quoting rules that do apply.
- Rewrite Limitations around real constraints: raw binary bodies, the
  OS argument-length cap, and secrets being visible in shell history,
  `ps`, and CI logs. Drop the false nested-JSON and array-of-objects
  entries, and the "file upload / streaming" entries that
  `deploy_component` and `get_backup` disprove.

Closes #639

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The `deploy_component` example linked to
`github.com/HarperDB/application-template`, which now only resolves via
the org-rename redirect. Verified `HarperFast/application-template` exists
and is not archived (`gh repo view`), so the canonical URL is used
directly.

The other two GitHub URLs on the page (`user/repo`,
`myorg/my-component`) are deliberate placeholders and are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-646

This preview will update automatically when you push new commits.

@dawsontoth dawsontoth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very helpful for understanding how it works, nice.

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.

CLI docs claim array-of-object parameters are unsupported, but they work

2 participants