Skip to content

cli/configure-machines: fix broken add-resource example, model triplets, and CLI ref link#5022

Merged
shannonbradshaw merged 1 commit intoviamrobotics:mainfrom
shannonbradshaw:configure-machines-correctness
Apr 26, 2026
Merged

cli/configure-machines: fix broken add-resource example, model triplets, and CLI ref link#5022
shannonbradshaw merged 1 commit intoviamrobotics:mainfrom
shannonbradshaw:configure-machines-correctness

Conversation

@shannonbradshaw
Copy link
Copy Markdown
Collaborator

Summary

Playbook 1 correctness assessment of docs/cli/configure-machines.md. Every CLI invocation on the page was verified against the v0.123.0 binary's --help and the rdk source at upstream/main (bb5e7153). Three breaking issues, one broken link, and one coverage gap fixed.

Breaking issues fixed

  1. add-resource example would error out as written. The page showed:

    viam machines part add-resource --part=<part-id> --name=my-camera --model-name=viam:camera:webcam
    

    The action requires --api or --resource-subtype and returns cannot add a resource of unknown subtype without one (rdk/cli/client.go:1386). Added --resource-subtype to the example, plus a second example for module-provided resources, plus a note about --api for custom subtypes.

  2. Four of six model triplets in the "Common model triplets" table do not exist in the registry. Verified via Typesense search of the registry index:

    • viam:camera:webcam — built-in is webcam (rdk:builtin:webcam)
    • viam:motor:gpio — built-in is gpio
    • viam:arm:fake — built-in is fake
    • viam:motor:fake — built-in is fake

    Replaced the table with correct model names and added a Subtype column so each example pairs --model-name with --resource-subtype correctly. Kept the two real module triplets (viam:raspberry-pi:rpi5, viam:ultrasonic:sensor).

  3. Triplet format description was wrong for built-ins. The page said the format is namespace:module-name:model-name and applied that framing to built-ins. Built-ins use a single name (which viam-server expands to rdk:builtin:<name>); the three-part triplet is the registry-module form. Fixed (cite: rdk/resource/model.go:16-22).

Broken link

  • "CLI reference" in Related pages pointed to /cli/ (the section landing page that redirects to /cli/overview/) instead of /cli/reference/. Updated to /cli/reference/#machines-aliases-robots-robot-machine, anchor verified in built HTML.

Coverage gap

  • Page introduces multi-part machines in §1 but never showed how to create or delete a part. Added a short "Add or delete a part" section using the verified machines part create / machines part delete commands, linked to /hardware/multi-machine/.

What was verified and is correct (no change)

  • machines list output format (id: X) (main part id: Y) matches rdk/cli/client.go:747.
  • machines create output (created new machine with id <id>) matches rdk/cli/client.go:875.
  • "Connected machines pick up configuration changes automatically" — 10s default config refresh (rdk/config/config.go:696).
  • machines update --machine --new-name --new-location flags match the v0.123.0 binary.
  • resource update, resource enable, resource disable, machines part fragments add | remove, machines delete, machines part restart — all flags and behaviors match the binary.
  • All 10 links resolve (9 internal, 2 external returning 200/307).
  • Vale, prettier, markdownlint, make build-prod: clean.

Test plan

  • prettier --write: clean
  • vale docs/cli/configure-machines.md: 0 errors, 0 warnings
  • markdownlint-cli2: 0 errors
  • make build-prod: clean
  • Spot-check the rendered page in the Netlify deploy preview (anchor link to /cli/reference/#machines-aliases-robots-robot-machine)

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 26, 2026

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 5da26f8
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/69ed84a062ebca0008778b23
😎 Deploy Preview https://deploy-preview-5022--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: 45 (🔴 down 1 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 shannonbradshaw force-pushed the configure-machines-correctness branch from 7463762 to 9a7e375 Compare April 26, 2026 03:15
Verified every CLI invocation against the v0.123.0 binary's --help and
the rdk source at upstream/main (bb5e7153). Findings:

Breaking — examples that error out as documented
- add-resource example was missing --resource-subtype (or --api). The
  action returns "cannot add a resource of unknown subtype" without one
  of these flags (rdk/cli/client.go:1386). Added the flag, plus a second
  example for module-provided resources, plus a note about --api for
  custom subtypes.
- Four of the six model triplets in the "Common model triplets" table
  do not exist in the registry (verified via Typesense search):
    viam:camera:webcam → built-in is `webcam` (rdk:builtin:webcam)
    viam:motor:gpio    → built-in is `gpio`
    viam:arm:fake      → built-in is `fake`
    viam:motor:fake    → built-in is `fake`
  Replaced the table with correct names and added a Subtype column so
  the example pairs `--model-name` with `--resource-subtype` correctly.
  Kept the two real module triplets (viam:raspberry-pi:rpi5,
  viam:ultrasonic:sensor).
- Reframed the "format" sentence: built-ins use a single name, registry
  modules use the three-part triplet (cite: rdk/resource/model.go:16-22).
  The original "namespace:module-name:model-name" framing was wrong for
  built-ins.

Broken link
- "CLI reference" link pointed to /cli/ (the section landing page,
  redirects to /cli/overview/) instead of /cli/reference/. Updated to
  /cli/reference/#machines-aliases-robots-robot-machine, anchor verified
  in the built HTML.

Coverage gap
- Page introduces multi-part machines in §1 but never showed how to
  create or delete a part. Added a short "Add or delete a part" section
  using the verified machines part create/delete commands, linked to
  /hardware/multi-machine/.

No-change findings (verified, page is correct):
- machines list output format ("(id: X) (main part id: Y)") matches
  rdk/cli/client.go:747.
- machines create output ("created new machine with id <id>") matches
  rdk/cli/client.go:875.
- "Connected machines pick up configuration changes automatically"
  matches the 10s default config refresh interval (rdk/config/config.go:696).
- machines update flags (--new-name, --new-location) match the binary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shannonbradshaw shannonbradshaw force-pushed the configure-machines-correctness branch from 9a7e375 to 5da26f8 Compare April 26, 2026 03:21
@shannonbradshaw shannonbradshaw merged commit 7569425 into viamrobotics:main Apr 26, 2026
12 checks passed
@github-actions
Copy link
Copy Markdown

🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs'

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