fragments: peer CLI on reuse-configuration; --fragment name-or-id#5023
Open
shannonbradshaw wants to merge 4 commits intoviamrobotics:mainfrom
Open
fragments: peer CLI on reuse-configuration; --fragment name-or-id#5023shannonbradshaw wants to merge 4 commits intoviamrobotics:mainfrom
shannonbradshaw wants to merge 4 commits intoviamrobotics:mainfrom
Conversation
The "Apply a fragment to a machine" section currently shows a UI walkthrough followed by an appended CLI footnote framed as "for many machines." Restructures into two peer subsections, "In the Viam app" and "With the CLI," so a reader following the CLI flow finds the single-machine command at the same level as the UI steps. Multi- machine framing moves to a one-line link to automate-with-scripts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The viam machines part fragments add command prompts the user to select a fragment interactively if --fragment is omitted. Verified against rdk/cli/app.go (flag usage) and client.go (selectFragment). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The --fragment flag for machines part fragments add/remove accepts either a fragment name or an ID, but the placeholder and explanation implied ID only. Updates the placeholder to <fragment-name-or-id> and rewrites the find-your-fragment sentence to cover both. Also notes that Viam app names are kebab-case and don't need quoting. Widens "available to your organization" to "available to you" — the add action's interactive list comes from ListFragments, which includes public fragments outside the user's org. Verified in rdk/cli/client.go (RobotsPartAddFragmentAction line 3183 matches by name OR id; RobotsPartRemoveFragmentAction lines 3315-3335 same). Naming rules verified in app/ui/src/lib/name-validation.ts (FRAGMENT_OPTIONS: letters, numbers, dashes only at the UI layer). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same docs accuracy fix applied to the CLI section pages: - configure-machines.md: "specifying its fragment ID" → "specifying its name or ID"; <fragment-id> → <fragment-name-or-id> placeholder in both add and remove snippets. - reference.md: <fragment id> → <fragment name or id> in both add and remove syntax blocks; "Fragment ID to add/remove" → "Fragment name or ID to add/remove" in flag descriptions; added the "if omitted, prompts interactively" note to the remove flag for parity with add. Verified in rdk/cli/client.go:3183 (add matches by name or id) and :3315-3335 (remove same), and in rdk/cli/client.go:3338 (remove prompts interactively when --fragment is omitted). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Two related changes to fragment-application docs.
Surface the CLI as a peer to the UI on
reuse-configuration.mdThe "Apply a fragment to a machine" section showed a UI walkthrough followed by an appended CLI footnote framed as "for many machines." A reader following the CLI flow (for example, from Set up machines with the CLI) had to scroll past the entire UI walkthrough to find the CLI command, and then it was pitched as a fleet-only convenience rather than a peer single-machine option.
Restructured into two H3 subsections under the existing H2:
viam machines part fragments addcommand, reframed as a peer single-machine option, plus a note about interactive selection when--fragmentis omitted.The multi-machine framing moves to a one-line pointer to Automate with scripts, where it belongs.
Correct
--fragmentas name-or-id across CLI docsThe
--fragmentflag formachines part fragments addandremoveaccepts either a fragment name or an ID, butcli/configure-machines.md,cli/reference.md, and the placeholder text in this PR's new section all implied ID-only.Updates:
<fragment-name-or-id>(or<fragment name or id>inreference.mdto match the page's existing placeholder style).reference.mdupdated from "Fragment ID to add/remove" to "Fragment name or ID to add/remove."fragments removeinreference.mdfor parity withadd.reuse-configuration.md's "With the CLI" subsection includes a sentence noting that names created in the Viam app are kebab-case and don't need shell quoting.addaction's interactive list comes fromListFragments, which includes public fragments outside the user's org.Verification
rdk/cli/client.go:3183—RobotsPartAddFragmentActionmatches by name or ID.rdk/cli/client.go:3315-3335—RobotsPartRemoveFragmentActionsame.rdk/cli/client.go:3338— remove prompts interactively when--fragmentis omitted.app/ui/src/lib/name-validation.tsFRAGMENT_OPTIONS— UI restricts fragment names to letters, numbers, and dashes (server-side enforces only max length, so an API-created fragment could in theory have other characters, but that's out of scope here).Test plan
/fleet/reuse-configuration/renders both H3 subsections under "Apply a fragment to a machine"### Avoid resource name conflicts with a prefixH3 still appears as a peer subsection (not nested)cli/configure-machines.md"Apply a fragment" section shows the<fragment-name-or-id>placeholdercli/reference.mdmachines part fragments addandremovesections both show name-or-id in syntax and flag descriptions🤖 Generated with Claude Code