Skip to content

parity(#261): CLI --format text and a TTY-only indexing progress bar #119

Description

@amondnet

Summary

Upstream semble #261 (b5cdcf0) made two CLI UX additions:

  1. --format {json,text} on search and find-related. Text mode prints path:start-end followed by the snippet, or the error string.
  2. An indexing progress bar on stderr, shown only when stderr is a TTY (tqdm(..., file=sys.stderr, leave=False)).

csp status

  • The CLI is JSON-only. search_output / find_related_output in bin/csp/main.rs always return JSON.
  • There is no progress UI. create.rs has no hook in the file loop and the crate has no indicatif dependency.

Proposal

  • --format text|json (default json). Text mode handles the {"error": ...} shape and omits the snippet when content is absent (--max-snippet-lines 0).
  • A show_progress option threaded through LoadOrBuildOptions / from_path_with_previous, enabled only when stderr is a TTY and never under csp mcp, because MCP owns stdout and the progress bar must not corrupt the protocol stream.

Acceptance

  • csp search q --format text prints path:start-end blocks; JSON output is unchanged.
  • Piped stderr shows no progress output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions