Skip to content

Prefill the TUI from CLI flags and expose the resolver pool in the form #195

Closed

Description

@TMHSDigital

Summary

subenum -tui example.com -w big.txt -r resolvers.txt silently drops the domain, wordlist and resolver file: the help says all other flags are ignored with -tui. The resolver pool, a headline feature, is unreachable from the TUI at all.

Where

  • main.go:174 ("all other flags are ignored")
  • internal/tui/model.go:52 (the form already accepts Settings from env and config)
  • internal/tui/config.go:12-29 (no ResolverPool or -r field)
  • internal/scan/settings.go:16-25 (no resolver-pool token, so the "every setting has a label" test cannot catch the gap)

Proposal

Treat the positional domain and parsed CLI flags as the top layer of Options.Settings when launching the TUI, so the form opens pre-filled. Add a "Resolvers file" field and a SettingResolverPool token.

Who benefits

TUI users who already have a command line; teaching labs that want to launch the TUI with a prepared config.

Acceptance criteria

  • Flags given with -tui populate the form
  • Resolver pool configurable from the form and saved in last.json
  • Tests in internal/tui/form_test.go and main_test.go

Getting started

  • Relevant files: main.go, internal/tui/model.go, internal/tui/form.go, internal/tui/config.go, internal/scan/settings.go
  • How to run tests: go test ./internal/tui/ .
  • Related docs: README "TUI"

Related: #118, #35


Filed by repo-audit/full-audit at 3139c44. Severity: medium. Effort: M. audit-key: enhancement|internal/tui/model.go|tui-prefill-and-pool

Activity

  1. added
    enhancement
    help wanted
    area: tui
    severity: medium
    on Nov 9, 2026
  2. TMHSDigital commented on Nov 10, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in b1ee267.

    -tui now pre-fills the form from the command line: the domain argument and every flag the form has a field for are layered over SUBENUM_*, config file and remembered values. Flags it has no field for (and extra domains / extra -w files; the form takes the first -w) are named in a warning instead of being dropped silently. The form gains Resolver Pool (-r) and Rate/Resolver (-rate-per-resolver) fields, saved in last.json; the pool is ignored with Simulate on, as on the CLI, and a bad pool file is reported on the form. -r and -rate-per-resolver are no longer in tuiOmittedFlags, so TestSettingNamesAgreeAcrossFrontEnds covers them.

    Design choices: the new fields are plain labelled form fields rather than new scan.Setting tokens, since no engine message names them (the cross-front-end flag test now catches the gap the issue describes). After a scan, r restores the values just scanned rather than re-applying launch flags over the user's form edits.

    Verified: new tests TestLaunchOptionsPrefillTheForm, TestResolverPoolField (internal/tui/form_test.go), TestPoolErrorStaysOnForm, a last.json round-trip of the pool fields, and TestTUIOptionsFromFlags (main_test.go); go build, go vet, go test -race -shuffle=on ./... and golangci-lint run all clean.

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

    area: tuienhancementhelp wantedseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions