Problem
Commands that take asset IDs as positional arguments (e.g., dashboards get <id>, dashboards delete <id>, teams get <id>) currently offer no shell completion for those arguments.
Users must look up IDs manually before running the command.
Desired behavior
Cobra's ValidArgsFunction allows commands to provide dynamic completions at runtime.
Commands that accept an asset ID (or similar dynamic value) as a positional argument should use ValidArgsFunction to query the Dash0 API and suggest matching IDs.
This would enable tab-completion workflows like:
dash0 dashboards get <TAB>
a1b2c3d4-... Production Overview
d4e5f6a7-... Staging Overview
Scope
Asset commands that take an ID argument:
dashboards get, dashboards update, dashboards delete
check-rules get, check-rules update, check-rules delete
views get, views update, views delete
synthetic-checks get, synthetic-checks update, synthetic-checks delete
teams get, teams update, teams delete
teams list-members, teams add-members, teams remove-members
members remove
traces get (trace ID)
config profiles select, config profiles update, config profiles delete (profile names)
Acceptance criteria
- Commands that accept a dynamic positional argument use
ValidArgsFunction to offer completions.
- Completions that require API calls gracefully degrade (return no suggestions) when credentials are unavailable or the API call fails.
- Profile commands complete from the local profile list (no API call needed).
Problem
Commands that take asset IDs as positional arguments (e.g.,
dashboards get <id>,dashboards delete <id>,teams get <id>) currently offer no shell completion for those arguments.Users must look up IDs manually before running the command.
Desired behavior
Cobra's
ValidArgsFunctionallows commands to provide dynamic completions at runtime.Commands that accept an asset ID (or similar dynamic value) as a positional argument should use
ValidArgsFunctionto query the Dash0 API and suggest matching IDs.This would enable tab-completion workflows like:
Scope
Asset commands that take an ID argument:
dashboards get,dashboards update,dashboards deletecheck-rules get,check-rules update,check-rules deleteviews get,views update,views deletesynthetic-checks get,synthetic-checks update,synthetic-checks deleteteams get,teams update,teams deleteteams list-members,teams add-members,teams remove-membersmembers removetraces get(trace ID)config profiles select,config profiles update,config profiles delete(profile names)Acceptance criteria
ValidArgsFunctionto offer completions.