Registry Mirror
Skip to content

Conversation

@vmfunc

@vmfunc vmfunc commented Nov 6, 2026

Copy link
Copy Markdown
Owner

what

  • dashboard by default. any scan on an interactive terminal runs under the live dashboard, after the picker or directly when scan flags are given.
  • interactive-only. shouldDashboard requires stdin and stdout to both be ttys, a non-zero window size, and TERM != dumb. -no-tui, -api, -silent, pipes and zero-size ptys fall back to the normal streaming output.
  • clean alt screen. engine chrome goes to io.Discard through the new output.SetWriter. charmbracelet/log output is buffered and replayed to stderr afterwards. finishRun (notify, reports, summary) runs after the dashboard closes. Quitting mid-scan returns tui.ErrQuit and aborts without partial reports.
  • w writes a report. It was a placeholder before. tui.Config.WriteReport runs async with every finding seen so far: json goes to the -json path, or to sif-report-<timestamp>.json if none was given. The footer shows the path or the error.
  • interactive summary. Findings are listed worst-first under the totals. j/k/g/G move, enter opens the detail, s and / narrow the list.
  • race fix. tui.Run read scanErr while the scan goroutine could still be writing it. It now uses a buffered done channel.

verification

  • go test -race ./... passes. New tests cover the gate table (including zero-size pty and TERM=dumb), summary navigation, the w success/error/unwired paths, and dashboardReport writing json.
  • In a 140×40 pty against a local http server, the run reached the summary. j and enter opened the detail, w wrote a report, q exited 0, and no console chrome leaked into the alt screen.
  • With piped stdout and with a 0×0 pty, the run produced the normal streaming output. The 0×0 case used to hang on "initializing".

🤖 Generated with Claude Code

every scan on an interactive terminal now runs under the live dashboard,
after the picker or straight away when scan flags are given. the gate,
shouldDashboard, requires stdin and stdout to both be ttys with a usable
window size and TERM != dumb; -no-tui, -api, -silent, pipes, and zero-size
ptys fall back to the plain streaming output unchanged.

while the alt screen is up, the engine's console chrome goes to io.Discard
via the new output.SetWriter and charmbracelet/log is buffered, then
replayed to stderr once the terminal is restored. finishRun (notify,
reports, summary) runs after the dashboard closes. quitting mid-scan
returns tui.ErrQuit and aborts without partial reports.

tui.Run no longer reads the scan error while the scan goroutine may still
be writing it (a data race); it waits on a buffered channel when the scan
is done and returns ErrQuit otherwise.

`w` now writes a report: tui.Config.WriteReport runs off the ui goroutine
with every finding seen so far, and sif writes it as json to the -json
path or sif-report-<timestamp>.json. the footer reports the path or error.

the summary screen is now interactive: findings sorted worst-first below
the totals, j/k/g/G to move, enter to open the detail, s and / to narrow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added docs documentation changes tests test changes config configuration changes deps dependency updates size/xl 500+ lines changed labels Nov 6, 2026
Comment thread internal/tui/run.go
type ScanFunc func(ctx context.Context, sink event.Sink) error

// ErrQuit is returned by Run when the user quit the dashboard before the scan
// finished. The scan context is cancelled; callers should treat the run as

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"cancelled" is a misspelling of "canceled"

Comment thread internal/tui/run.go
// error, if any, is returned once the ui has torn down.
// the event stream, and blocks until the program exits. If the scan already
// finished, its error is returned. If the user quit mid-scan, the scan context
// is cancelled and Run returns ErrQuit straight away instead of blocking on

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"cancelled" is a misspelling of "canceled"

Comment thread docs/tui.md
## the dashboard

> the live dashboard is a complete, tested component (`tui.Run`); auto-launching it as the picker's run screen is landing incrementally. today the picker configures the scan and runs it with sif's standard streaming output.
### when it opens

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD024/no-duplicate-heading Multiple headings with the same content [Context: "when it opens"]

Comment thread docs/tui.md
> the live dashboard is a complete, tested component (`tui.Run`); auto-launching it as the picker's run screen is landing incrementally. today the picker configures the scan and runs it with sif's standard streaming output.
### when it opens

the dashboard is the default view for any scan on an interactive terminal — after the picker, or straight away when scan flags are given. it only opens when stdin and stdout are both terminals with a usable size (and `TERM` isn't `dumb`); otherwise sif falls back to its normal streaming output:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 295]

Comment thread docs/tui.md
- `-silent`, `-api`, or piped stdin/stdout → plain output
- `-no-tui` → plain output (also skips the picker)

while the dashboard is up, sif's console chrome is suppressed (the dashboard shows the same findings); warnings and errors are buffered and printed when it closes. after you quit, the usual run steps — notify, `-sarif`/`-markdown`/`-json` reports and the run summary — happen on the normal screen. quitting mid-scan aborts the run without writing partial reports.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 363]

Comment thread docs/tui.md
while the dashboard is up, sif's console chrome is suppressed (the dashboard shows the same findings); warnings and errors are buffered and printed when it closes. after you quit, the usual run steps — notify, `-sarif`/`-markdown`/`-json` reports and the run summary — happen on the normal screen. quitting mid-scan aborts the run without writing partial reports.

the dashboard is a pure consumer of sif's scan event stream (`internal/event`). the scan engine runs in a background goroutine and emits events — target started, scanner started, each finding, scanner done, target done, run done — which the dashboard renders live. the engine does not know the tui exists; the tui is just one `event.Sink` among the console and report writers. quitting the dashboard cancels the scan context (reports still flush on the way out).
the dashboard is a pure consumer of sif's scan event stream (`internal/event`). the scan engine runs in a background goroutine and emits events — target started, scanner started, each finding, scanner done, target done, run done — which the dashboard renders live. the engine does not know the tui exists; the tui is just one `event.Sink` among the console and report writers. quitting the dashboard before the scan finishes cancels it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 436]

Comment thread docs/tui.md
| `enter` | expand the selected finding (target, module, evidence) |
| `c` | copy the selected finding's url |
| `w` | write a report now |
| `w` | write a json report of every finding so far (to the `-json` path if given, else `sif-report-<timestamp>.json` in the current directory) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 145]

Comment thread docs/tui.md
| --- | --- |
| `j` / `k` / `↑` / `↓` | move through the findings |
| `g` / `G` | jump to the first / last finding |
| `enter` | open the selected finding's detail (target, module, evidence); `enter` again closes it |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 100]

Comment thread docs/usage.md
### -i, --interactive / -pick / --no-tui

control the interactive scan picker. by default, running `sif <url>` (or `-u <url>`) with no scan flags on an interactive terminal opens a menu to choose scans from; see [the tui guide](tui.md). `-i` (alias `-pick`) forces the picker open even when scan flags are set; `--no-tui` disables it so sif runs with exactly the flags given:
control the interactive tui (the scan picker and the live dashboard). by default, running `sif <url>` (or `-u <url>`) with no scan flags on an interactive terminal opens a menu to choose scans from; see [the tui guide](tui.md). `-i` (alias `-pick`) forces the picker open even when scan flags are set; `--no-tui` disables both the picker and the live dashboard so sif runs with exactly the flags given and prints its normal streaming output:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 441]

Comment thread docs/usage.md
```

the picker never opens under `-silent`, `-api`, or when stdin/stdout is piped, so pipelines are unaffected.
on an interactive terminal every scan runs under the live dashboard. neither the picker nor the dashboard opens under `-silent`, `-api`, or when stdin/stdout is piped or isn't a usable terminal, so pipelines are unaffected.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 223]

Comment thread README.md
with no scan flags on a terminal, sif opens an interactive picker: a grouped checklist of scans (recon, web vulns, info, intel), each showing its flag and a one-line description, with presets (`quick`, `recon`, `web`, `full`, `passive`) on `p` and a live "equivalent command" line so you can graduate to flags. your last selection is remembered.

it stays out of pipelines: any scan flag present runs directly, and `-silent`/`-api`/piped stdin or stdout never open it. force it on with `-i` (or `-pick`), off with `-no-tui`. see [docs/tui.md](docs/tui.md) for the full keybindings.
it stays out of pipelines: any scan flag present runs directly, and `-silent`/`-api`/piped stdin or stdout never open it. force it on with `-i` (or `-pick`), off with `-no-tui`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 177]

Comment thread README.md
it stays out of pipelines: any scan flag present runs directly, and `-silent`/`-api`/piped stdin or stdout never open it. force it on with `-i` (or `-pick`), off with `-no-tui`. see [docs/tui.md](docs/tui.md) for the full keybindings.
it stays out of pipelines: any scan flag present runs directly, and `-silent`/`-api`/piped stdin or stdout never open it. force it on with `-i` (or `-pick`), off with `-no-tui`.

scans on an interactive terminal run under a live dashboard that streams findings as they land and ends on a browsable summary (`j`/`k` to move, `enter` for detail, `w` to write a report). anything non-interactive gets the plain streaming output, and `-no-tui` turns the dashboard off. see [docs/tui.md](docs/tui.md) for the full keybindings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
error MD013/line-length Line length [Expected: 80; Actual: 342]

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

pr summary

13 files changed (+494 -37)

category files
go source 9
tests 2
deps 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config configuration changes deps dependency updates docs documentation changes size/xl 500+ lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant