- Add cmd/keys.go with six subcommands backed by the Plan 04 query layer - keys list prints masked findings with id/provider/confidence/source columns and supports --provider/--verified/--limit/--unmask filters - keys show <id> renders a finding fully unmasked with verify metadata - keys export --format=json|csv reuses the formatter registry, atomic file writes when --output is set - keys copy <id> uses atotto/clipboard for clipboard handoff - keys delete <id> prompts via cmd.InOrStdin unless --yes is passed - keys verify <id> gates on verify.EnsureConsent, then updates the stored row inline via UPDATE findings SET verify_* using db.SQL() - Remove the keysCmd stub from cmd/stubs.go (single declaration) - All subcommands read config via openDBWithKey() mirroring scan.go
61 lines
1.6 KiB
Go
61 lines
1.6 KiB
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// notImplemented returns a RunE function that prints a "not yet implemented" message.
|
|
// Each stub command is registered in root.go and satisfies CLI-01's 11-command requirement.
|
|
func notImplemented(name, phase string) func(cmd *cobra.Command, args []string) error {
|
|
return func(cmd *cobra.Command, args []string) error {
|
|
fmt.Printf("%s: not implemented in this phase (coming in %s)\n", name, phase)
|
|
return nil
|
|
}
|
|
}
|
|
|
|
var verifyCmd = &cobra.Command{
|
|
Use: "verify",
|
|
Short: "Actively verify found API keys (Phase 5)",
|
|
RunE: notImplemented("verify", "Phase 5"),
|
|
}
|
|
|
|
var importCmd = &cobra.Command{
|
|
Use: "import",
|
|
Short: "Import findings from TruffleHog or Gitleaks output (Phase 7)",
|
|
RunE: notImplemented("import", "Phase 7"),
|
|
}
|
|
|
|
var reconCmd = &cobra.Command{
|
|
Use: "recon",
|
|
Short: "Run OSINT recon across internet sources (Phase 9+)",
|
|
RunE: notImplemented("recon", "Phase 9"),
|
|
}
|
|
|
|
// keysCmd is implemented in cmd/keys.go (Phase 6).
|
|
|
|
var serveCmd = &cobra.Command{
|
|
Use: "serve",
|
|
Short: "Start the web dashboard (Phase 18)",
|
|
RunE: notImplemented("serve", "Phase 18"),
|
|
}
|
|
|
|
var dorksCmd = &cobra.Command{
|
|
Use: "dorks",
|
|
Short: "Manage and run dork queries (Phase 8)",
|
|
RunE: notImplemented("dorks", "Phase 8"),
|
|
}
|
|
|
|
var hookCmd = &cobra.Command{
|
|
Use: "hook",
|
|
Short: "Install or manage git pre-commit hooks (Phase 7)",
|
|
RunE: notImplemented("hook", "Phase 7"),
|
|
}
|
|
|
|
var scheduleCmd = &cobra.Command{
|
|
Use: "schedule",
|
|
Short: "Manage scheduled recurring scans (Phase 17)",
|
|
RunE: notImplemented("schedule", "Phase 17"),
|
|
}
|