Conversation
- Replace bare `timberlogs` invocation with a persistent REPL session - Add `timberlogs repl` as an alias entry point - Implement shell-style input parsing (quoted strings, two-word commands) - Flag parser uses Zod v3 shape introspection to type-coerce CLI args - Command history persisted to ~/.config/timberlogs/history.json (max 500) - Up/down arrow history navigation with draft preservation in ReplPrompt - Three render phases: idle (prompt), running (fetching), interactive (full-screen) - Interactive commands (logs, stats, flows show) take over screen; q returns to REPL - Static commands (whoami, flows list, config list) render inline in scroll buffer - login runs the device flow inline; logout/config reset handled synchronously - Add onBack? prop to LogTable, FlowTimeline, StatsView so q returns to REPL instead of process.exit Closes #72 🤖 Auto-generated
- Display version and auth status on launch - Prompt to run `login` if not authenticated - Hint to type `help` for available commands 🤖 Auto-generated
- Extract persistent ReplHeader component shown above scroll buffer - Async fetch org name on startup; updates after login/logout - Shows ▲ Timberlogs vX.X.X · ● Org Name when authenticated - Shows ● Not logged in hint when unauthenticated - Separator line below header for visual separation - Remove startup banner from entries[] scroll buffer 🤖 Auto-generated
Use spawn with windowsHide: true instead of exec('start ...') to
prevent a visible CMD window appearing when launching the browser
for device flow auth on Windows.
🤖 Auto-generated
Display available commands inline below the auth status so users don't need to type `help` to discover what's available. 🤖 Auto-generated
- Add REPL section with usage example and annotated output - Document builtins (help, clear, exit) and history navigation - Note that config reset requires --force inside the REPL 🤖 Auto-generated
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a new interactive REPL mode and associated UI, command parsing, flag parsing, history persistence, multiple command views (login, whoami, logs, flows, stats, flow show), and navigation/back callbacks; updates CLI entry to render the REPL and adjusts browser-open behavior. Changes
Sequence DiagramsequenceDiagram
actor User
participant ReplView
participant ReplParser
participant FlagParser
participant ApiClient
participant ConfigStore
participant SubView as SubView (Logs/Flows/Stats/Login/Whoami)
User->>ReplView: Start CLI (no args)
ReplView->>ConfigStore: load history & token
ReplView->>ReplView: render header & prompt
loop REPL loop
User->>ReplView: enter input
ReplView->>ReplParser: parseReplInput(input)
ReplParser-->>ReplView: ParsedCommand
alt builtin
ReplView->>ReplView: handle builtin (help/clear/exit)
else command
ReplView->>FlagParser: parseFlags(tokens, schema?)
FlagParser-->>ReplView: flags,positional,error
ReplView->>ApiClient: create client(token) / call endpoints
ApiClient-->>SubView: response
SubView->>ReplView: onDone(output, interactive) or onError(msg)
ReplView->>ConfigStore: save history
end
ReplView->>User: render output & prompt
end
User->>ReplView: press 'q' or back
ReplView->>SubView: onBack or exit
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Remove double org name fetch on startup (was firing twice via direct call + token watcher effect) - FlowShowView: show error message instead of silent no-op when no logs found for a flow - flagParser: surface unknown flags as an error instead of silently ignoring them 🤖 Auto-generated
Summary
timberlogsinvocation with a persistent REPL sessiontimberlogs replalso works as an aliaslogs,stats,flows show) take over the screen with keyboard nav;qreturns to the promptwhoami,flows,config list) render inline in the scroll bufferloginruns the device flow inline (no subprocess);logoutis synchronous~/.config/timberlogs/history.json(max 500,↑/↓to navigate)New files
src/lib/history.ts— history load/savesrc/lib/replParser.ts— shell tokenizer →ParsedCommandsrc/lib/flagParser.ts—string[]args → typed options via Zod v3src/components/ReplOutput.tsx— scroll buffer entry renderersrc/components/ReplPrompt.tsx— prompt line with history navigationsrc/components/ReplView.tsx— root REPL componentsrc/components/commandViews/— async fetch adapters per commandsrc/commands/repl.tsx— alias entry pointChanged files
src/commands/index.tsx— replaced static help with<ReplView />src/components/LogTable.tsx,StatsView.tsx,FlowTimeline.tsx— addedonBack?prop soqreturns to REPL instead ofprocess.exit(0)src/commands/login.tsx,src/components/commandViews/LoginView.tsx— usespawnwithwindowsHide: trueto suppress CMD flash on Windowsdocs/cli/overview.mdx— REPL section addedTest plan
timberlogslaunches REPL with header showing version + org nametimberlogs replalso launches REPLlogs,stats,flows showtake over screen;qreturns to promptwhoami,flowsrender inline in scroll bufferloginruns device flow inline, header updates with org name after authlogoutclears session, header updates to not-logged-in state↑/↓navigates history; history persists across sessionsclearempties scroll buffer;exitquitsconfig reset --forceresets config; without--forceshows errorSummary by CodeRabbit
New Features
Bug Fixes
Documentation