Skip to content

TUI/CLI: support saved searches (saved filter sets) #119

Description

@thomaschristory

Summary

NetBox has a "saved searches" concept (saved filters/queries). It would be nice to use saved searches in the TUI — pick a saved search to apply its filters — and to reference them from the CLI too.

Current behavior

  • No support for saved searches anywhere in the code. Search of nsc/ for saved_search / saved search / bookmarks returns nothing.
  • Filter state in the TUI is transient: built in the FilterScreen, applied to the paginate call, never persisted. Config only persists column prefs (nsc/config/models.py, columns: dict[...]).

Open question — which kind of "saved search"?

There are two plausible interpretations; worth deciding before implementing:

  1. NetBox server-side saved searches — NetBox stores saved filters/bookmarks server-side. If the API exposes them, the TUI could list and apply them, and the CLI could reference them by name.
  2. Local saved searches — let nsc persist named filter sets locally (in config, like column prefs) and offer them in the TUI picker + a CLI flag (e.g. --saved <name> / nsc <resource> ls --saved foo).

(2) is self-contained and mirrors the existing column-prefs persistence; (1) depends on what the NetBox OpenAPI schema actually exposes.

Proposal

  • TUI: a "saved searches" picker (e.g. a key in the list/filter screen) to apply a saved filter set.
  • CLI: a flag to apply a saved search by name.
  • Persist named filter sets in config (per resource), reusing the column-prefs pattern, unless we go server-side.

Acceptance

  • Can save the current filter set under a name and re-apply it later in the TUI.
  • CLI can apply a saved search by name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions