Dashboards as code
Overview
Section titled “Overview”Every Osuite dashboard is a JSON document. The osuite dashboard CLI pulls those documents to local files, previews changes, and applies them back to the platform. This lets you review a dashboard in a pull request and commit it to source control like any other config, instead of only clicking it together in the UI.
Local JSON files are the source of truth. You edit the files; the CLI reconciles them with the remote state.
The CLI is installed as part of the one-time agent setup.
The three commands
Section titled “The three commands”osuite dashboard pull # fetch all dashboards to the current directoryosuite dashboard plan [path] # preview what would changeosuite dashboard apply [path] # apply local files to the platformosuite dashboard pull fetches every dashboard from the platform and writes each one to a JSON file in the current directory, named after the dashboard. On later pulls it reconciles the remote state with your local files: unchanged files are left alone, remote-only changes are written down, and if a file has local edits and the remote changed, the two are merged with a three-way merge. A merge conflict is written into the file for you to resolve, opening $EDITOR if it is set.
osuite dashboard plan [path] compares your local files to the platform and prints what apply would do, without changing anything. Each dashboard is reported as one of:
- create — a local file with no
id, or anidnot found on the platform. - update — an existing dashboard whose local file differs from the platform.
- no-change — already in sync.
- needs-pull — the remote changed since you last pulled; run
pullto merge before applying.
If [path] is omitted, every *.json file in the current directory is used. You can also pass a single file or a directory.
osuite dashboard apply [path] writes your local files to the platform. Dashboards without an id are created — and the assigned id is written back into the local file — while dashboards with an id are updated. Unchanged dashboards are skipped.
Preview first with --dry-run:
osuite dashboard apply --dry-runosuite dashboard apply ./dashboards/osuite dashboard apply my-dashboard.jsonIf any dashboard is in the needs-pull state, apply refuses to run and tells you to pull first, so a concurrent edit in the UI is never silently overwritten.
A git workflow
Section titled “A git workflow”osuite dashboard pullgit add .git commit -m "Snapshot dashboards"
# edit a dashboard JSON file, then:osuite dashboard planosuite dashboard apply --dry-runosuite dashboard applygit commit -am "Update service dashboard"Because the files are plain JSON, dashboards diff cleanly in review. Keep them in a directory in your repo and treat apply as the deploy step.
File discovery and validation
Section titled “File discovery and validation”- A JSON file is treated as a dashboard only if it has a
namefield; other JSON files in the directory are skipped with a warning. - Before contacting the platform,
planandapplyvalidate each file locally — every widget must have a validchart_type, the required layout fields, and aqueriesarray, and widgetwidthmust be within the 24-column grid. Invalid files fail before anything is sent. - Never set
idon a new dashboard (the platform assigns it) and never change theidof an existing dashboard or widget.
The full structure is documented in the dashboard JSON schema.
JSON output
Section titled “JSON output”Add the global -o json flag for machine-readable output, useful in CI:
osuite -o json dashboard planosuite -o json dashboard applyLet an agent do it
Section titled “Let an agent do it”The Visualizer Agent drives exactly this workflow. Its osuite-edit-dashboard skill reads and writes the same JSON files, runs osuite dashboard plan to show you the change, and runs osuite dashboard apply once you approve — so you can generate and apply a dashboard from a plain-English request without hand-editing JSON.
Next steps
Section titled “Next steps”- Dashboard JSON schema — the fields you edit
- Dashboard builder — the UI equivalent
- Visualizer Agent — generate and apply dashboards from natural language