Skip to content

feat: add explicit "query" subcommand#16

Open
mfacenet wants to merge 1 commit into
mainfrom
feature/sting-query-subcommand
Open

feat: add explicit "query" subcommand#16
mfacenet wants to merge 1 commit into
mainfrom
feature/sting-query-subcommand

Conversation

@mfacenet
Copy link
Copy Markdown
Contributor

Summary

Implemented the sting query subcommand.

  • Added queryCmd in internal/cli/query.go (reuses the existing battle-tested runQuery + flag registration).
  • Wired it into the root command in internal/cli/root.go (flags registered on both root and the subcommand; added to AddCommand).
  • Updated root Long help text to document the new form.

Both styles continue to work:

  • sting query --author mendedlink --window 7d
  • sting --author mendedlink --window 7d (unchanged, still fully supported)

Why

The README (and getting-started section) documented sting query ..., but only the root-flag path existed. This closes the documentation vs. implementation gap with a minimal, additive change.

Testing performed

  • go -C tools tool task build → clean
  • go -C tools tool task test → all packages pass
  • Manual verification:
    • sting query --help (shows dedicated subcommand + flags)
    • sting query (no args → friendly help, exit 0)
    • sting --help (now lists query command + updated description)
    • Existing root-flag usage still functions identically

No behavior change for existing users or the MCP path. Purely additive for the documented CLI surface.

Checklist

  • Conventional Commit (feat:)
  • Cryptographically signed (-S) + DCO sign-off (-s)
  • Feature branch naming
  • Tests + build green

Both `sting query --author ...` and the direct root form (`sting --author ...`) now work.

This makes the documented getting-started example in README.md functional while preserving the existing ergonomic direct-invocation style.

Signed-off-by: Shawn Stratton <shawn.stratton@mface.net>
Copilot AI review requested due to automatic review settings May 31, 2026 00:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an explicit sting query subcommand to the CLI while preserving the existing “query via root flags” invocation style, aligning the implementation with documented usage.

Changes:

  • Introduced a new query subcommand that reuses the existing runQuery execution path.
  • Registered the existing query flags on both the root command and the query subcommand so sting query --author ... works.
  • Updated root command long help text to document sting query explicitly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/cli/root.go Wires queryCmd into the root command and registers query flags on both root and subcommand; updates help text.
internal/cli/query.go Adds the queryCmd cobra command definition that reuses runQuery.

Comment thread internal/cli/root.go
Comment on lines 63 to +66
registerQueryFlags(rootCmd)
// Also register on the query subcommand so `sting query --author ...` works
// with the exact same flag surface (and satisfies documented usage).
registerQueryFlags(queryCmd)
@mfacenet mfacenet force-pushed the feature/sting-query-subcommand branch from 63d2f0b to 077b59a Compare June 1, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants