Skip to content

fragments: peer CLI on reuse-configuration; --fragment name-or-id#5023

Open
shannonbradshaw wants to merge 4 commits intoviamrobotics:mainfrom
shannonbradshaw:shannonbradshaw/reuse-configuration-cli-peer
Open

fragments: peer CLI on reuse-configuration; --fragment name-or-id#5023
shannonbradshaw wants to merge 4 commits intoviamrobotics:mainfrom
shannonbradshaw:shannonbradshaw/reuse-configuration-cli-peer

Conversation

@shannonbradshaw
Copy link
Copy Markdown
Collaborator

@shannonbradshaw shannonbradshaw commented Apr 26, 2026

Summary

Two related changes to fragment-application docs.

Surface the CLI as a peer to the UI on reuse-configuration.md

The "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:

  • In the Viam app — the existing 6 UI steps and sync paragraph, unchanged.
  • With the CLI — the existing viam machines part fragments add command, reframed as a peer single-machine option, plus a note about interactive selection when --fragment is omitted.

The multi-machine framing moves to a one-line pointer to Automate with scripts, where it belongs.

Correct --fragment as name-or-id across CLI docs

The --fragment flag for machines part fragments add and remove accepts either a fragment name or an ID, but cli/configure-machines.md, cli/reference.md, and the placeholder text in this PR's new section all implied ID-only.

Updates:

  • Placeholders changed to <fragment-name-or-id> (or <fragment name or id> in reference.md to match the page's existing placeholder style).
  • Flag descriptions in reference.md updated from "Fragment ID to add/remove" to "Fragment name or ID to add/remove."
  • Added the missing "prompts interactively when omitted" note to fragments remove in reference.md for parity with add.
  • 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.
  • "Available to your organization" widened to "available to you" — the add action's interactive list comes from ListFragments, which includes public fragments outside the user's org.

Verification

  • rdk/cli/client.go:3183RobotsPartAddFragmentAction matches by name or ID.
  • rdk/cli/client.go:3315-3335RobotsPartRemoveFragmentAction same.
  • rdk/cli/client.go:3338 — remove prompts interactively when --fragment is omitted.
  • app/ui/src/lib/name-validation.ts FRAGMENT_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

  • Confirm /fleet/reuse-configuration/ renders both H3 subsections under "Apply a fragment to a machine"
  • Confirm the existing ### Avoid resource name conflicts with a prefix H3 still appears as a peer subsection (not nested)
  • Confirm cli/configure-machines.md "Apply a fragment" section shows the <fragment-name-or-id> placeholder
  • Confirm cli/reference.md machines part fragments add and remove sections both show name-or-id in syntax and flag descriptions

🤖 Generated with Claude Code

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>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 26, 2026

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 755afe2
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/69ed8442eef1c8000831c94a
😎 Deploy Preview https://deploy-preview-5023--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 44 (🔴 down 2 from production)
Accessibility: 99 (no change from production)
Best Practices: 92 (no change from production)
SEO: 89 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Apr 26, 2026
shannonbradshaw and others added 3 commits April 25, 2026 23:03
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>
@shannonbradshaw shannonbradshaw changed the title reuse-configuration: surface CLI as peer to UI for applying fragments fragments: peer CLI on reuse-configuration; --fragment name-or-id Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants