Skip to content

flows: wire search_by_name into a --name/--search flag on kosli list flows #943

Description

@dangrondahl

Problem

kosli list flows calls GET /api/v2/flows/{org} with no query parameters and renders the full array. There is no way to narrow results from the CLI, which is awkward for scripting and slower than necessary on orgs with many flows.

API capability already available

GET /flows/{org} already accepts:

  • search_by_name (string) — flows whose name contains the substring. Only alphanumeric characters and - are allowed.
  • case_sensitive (boolean, default true) — whether search_by_name is case sensitive.

These are not currently exposed by the CLI.

Proposed change

Add flags to kosli list flows, passed through as query params:

  • --name (string) → search_by_name (consider --search as an alias)
  • --case-sensitive (bool, default true) → case_sensitive

Wire into the request URL in cmd/kosli/listFlows.go. Response shape is unchanged (still an array), so this is additive and non-breaking.

Out of scope

  • Regex matching: not supported by the API (substring only). Not in scope.
  • Pagination / large-list latency: the flows endpoint returns the full array with no page/per_page support. Reducing latency needs a server-side change first; tracked separately. See feat: kosli list environments: add pagination and filtering flags #934 for the equivalent environments work as a pattern.

Definition of Done

  • --name (+ optional --search alias) and --case-sensitive flags added and wired into the request URL
  • kosli list flows --help documents the new flags
  • Integration tests cover --name match, no-match, and --case-sensitive
  • Docs updated if list-command flags are documented centrally

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions