Skip to content

Dashboard Language CLI Action Selectors

This section extends the Dashboard Language Specification with the contract for view- or toolbar-placed CLI action selectors.

An operate CLI action placed in a view or toolbar may declare a reusable selector dialog configuration: label, optional placeholder and allow-patterns, debounce-ms (100–2000), query: { command: "gh search repos", fields: [...], limit: 1–50 }, and mapping: { value, label, description?, target }. Mapping fields must be selected by the query; target must name one command template token. For example:

{
"id": "add-repository",
"level": "operate",
"verb": "add",
"label": "Add repository",
"icon": "plus",
"placement": "toolbar",
"command": "gh cao repos add {{repository}}",
"selector": {
"label": "Repository",
"debounce-ms": 300,
"query": { "command": "gh search repos", "fields": ["fullName", "description"], "limit": 20 },
"mapping": { "value": "fullName", "label": "fullName", "description": "description", "target": "repository" }
}
}

With allow-patterns: true, mapping.target must be repository-pattern. The selector offers a typed owner/repository pattern containing * for explicit selection without issuing a search for that pattern. All non-wildcard text, including complete owner/repository names, uses GitHub search results rather than an unverified typed option. Lookup starts only after a valid organization prefix and / are present and at least one repository character is entered. Command rendering quotes wildcard values as one literal argument. Ordinary repository tokens remain exact-only. Enrollment resolves current accessible matches to exact policy entries, rejects incomplete discovery or more than 100 matches, and does not enroll future matches or grant credential access.

Selectors render only when a command service is explicitly available. Declaring one does not authorize lookup or enrollment. The local native dashboard serves POST /__cli_commands/selector, authenticated by the local command capability and an exact same-origin header. Its HttpOnly, SameSite=Strict cookie is scoped to /__cli_commands and uses Secure on TLS, not plain loopback HTTP, so WebKit can send it locally. It resolves bounded read-only GitHub search through the owning CLI’s credentials, not canonical dashboard evidence, and requires no confirmation for lookup. Adding a repository requires dashboard confirmation and only stages review-mode policy. The local queue executes the confirmed command directly, without terminal prompts. The command console follows queued/running status changes without a manual refresh. Background collection output does not imply the command is executing. For a qualified name such as octo/serv, lookup scopes the search to octo and searches for serv, so partial repository names can resolve to suggestions. The server resolves the query and mapping from the declared action ID; clients cannot supply a command, fields, or mapping. Search input is a separate argv value, never shell-interpolated. These transient external choices do not become dashboard sources. Changing input immediately invalidates prior selection and cancels stale lookups. Closing or detaching the dialog cancels pending work. The presenter must label the textbox and disable spellcheck, automatic capitalization, and autocorrect for repository identifiers. It must announce loading, empty, and failed lookup states, and keep results in a viewport-bounded, independently scrollable list. Queries return at most their declared limit, even when hundreds of repositories match. At that limit, the presenter tells users to refine their search rather than implying that every match is shown. Slow lookups retain an explicit loading state and, after two seconds, explain that users can continue typing or cancel. The server bounds each GitHub CLI lookup to 15 seconds and never substitutes unverified input when GitHub is unavailable or returns no matches. Search input and cancellation remain available while waiting; abandoned lookups and their slow-search timers must not update later searches. Presenters support keyboard selection and disable execution until a mapped value passes command-template validation. Selection never executes a command; fresh, exact per-invocation approval and the selected service’s authorization remain mandatory. Unsupported operations must fail closed rather than use a browser callback or another executor.