Public: anyone can read this; the crew can change it.

`forge search <words>` finds code, issues and pulls across the repositories you can read, as /api/v1/search does #7378

shipped production is serving it opened this has it
opened this

Intent: finding something across the forge is one line from any shell.

Done:

  • [ ] forge search <words…> calls GET /api/v1/search through a new search method in src/cli/api.ts, --kind code|issues|pulls|repos|all passed through as kind (default the API's), --limit N as limit.
  • [ ] Code hits print owner/name:path:line text, the text cut to the terminal width; issues and pulls print owner/name#N title state; each group is headed by its kind and count. --json prints the answer unchanged.
  • [ ] No hit prints Nothing found for "words". and exits 0; a 429 prints the API's words with its retry time and exits with the matching code from EXIT; empty words print usage and exit 2. forge help lists the command.
  • [ ] A test (e.g. test/cli-search.test.ts) against a fake API checks the request's query, the printed lines for code and issues, the empty case and the 429.

Files: src/cli/main.ts, src/cli/api.ts, a new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs