Formalize deep research tool as a clap CLI with gated logging and a spinner #3

Merged
schaefera merged 1 commit from worktree-deep-research-cli into master 2026-08-14 17:32:44 +00:00
Collaborator

Summary

  • Replace the raw env::args().nth(1) topic read with a proper clap-derive Cli ([TOPIC] positional + -l/--log-level <LEVEL>).
  • Logging is now opt-in: tracing_subscriber only initializes when --log-level is passed. Without it, the terminal stays clean.
  • Added src/deep_research/progress.rs: a small indicatif-backed Spinner (clears on Drop), shown around each phase (researcher/reviewer/writer) whenever logging is off, since the two would otherwise interleave badly.

Test plan

  • cargo build / cargo clippy clean (no new warnings).
  • doubleo7-research --help shows the expected usage.
  • Live run with no flags, captured via script to preserve terminal control codes: spinner messages ("Researching...", "Reviewing findings...", "Writing report...") appeared and animated, no log lines leaked, final report printed correctly with its Sources section.
  • Live run with --log-level info: tracing spans/INFO/WARN lines appeared as before, and none of the spinner messages showed — confirms the gate works both directions.

🤖 Generated with Claude Code

## Summary - Replace the raw `env::args().nth(1)` topic read with a proper `clap`-derive `Cli` (`[TOPIC]` positional + `-l/--log-level <LEVEL>`). - Logging is now opt-in: `tracing_subscriber` only initializes when `--log-level` is passed. Without it, the terminal stays clean. - Added `src/deep_research/progress.rs`: a small `indicatif`-backed `Spinner` (clears on `Drop`), shown around each phase (researcher/reviewer/writer) whenever logging is off, since the two would otherwise interleave badly. ## Test plan - `cargo build` / `cargo clippy` clean (no new warnings). - `doubleo7-research --help` shows the expected usage. - Live run with no flags, captured via `script` to preserve terminal control codes: spinner messages ("Researching...", "Reviewing findings...", "Writing report...") appeared and animated, no log lines leaked, final report printed correctly with its Sources section. - Live run with `--log-level info`: tracing spans/INFO/WARN lines appeared as before, and none of the spinner messages showed — confirms the gate works both directions. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude-bot added 1 commit 2026-08-14 17:32:28 +00:00
Adds a clap-derive Cli (topic argument, --log-level flag) so the
research loop is a proper command-line tool instead of a raw
env::args().nth(1) read. Logging is now opt-in: tracing only
initializes a subscriber when --log-level is passed, so the terminal
stays clean by default. When logging is off, each research phase
(researcher/reviewer/writer) shows an indicatif spinner instead, so
the user isn't staring at a blank terminal during the 1-3 minute
Gemma tool-calling turns.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
schaefera merged commit e4292edeb9 into master 2026-08-14 17:32:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: schaefera/doubleo7#3
No description provided.