Skip to content

feat: add info command for system diagnostics#137

Merged
subsy merged 3 commits intomainfrom
feat/system-info-and-issue-template
Jan 18, 2026
Merged

feat: add info command for system diagnostics#137
subsy merged 3 commits intomainfrom
feat/system-info-and-issue-template

Conversation

@subsy
Copy link
Copy Markdown
Owner

@subsy subsy commented Jan 18, 2026

Summary

  • Adds ralph-tui info command that collects and displays system information useful for bug reports
  • Updates GitHub bug report template to request ralph-tui info -c output
  • Includes comprehensive test coverage (71.84% lines, 83.33% functions)

What the info command provides

  • ralph-tui version
  • Runtime (Bun/Node) version
  • OS details (platform, release, arch)
  • Config file locations and status
  • Installed templates
  • Agent detection status
  • Tracker configuration

Output formats

  • Default: Human-readable display
  • --json: Machine-readable JSON for scripts
  • -c/--copyable: Markdown code block for GitHub issues

Example output

$ ralph-tui info -c
ralph-tui: 0.2.0
runtime: bun 1.3.5
os: linux 6.18.3-2-cachyos (x64)
agent: claude v2.1.12
tracker: json
global-config: no
project-config: yes
templates: default.hbs, beads.hbs, json.hbs

Test plan

  • bun run typecheck passes
  • bun run build passes
  • bun run lint passes (only pre-existing warnings)
  • bun test src/commands/info.test.ts - 25 tests pass
  • Test coverage: 71.84% lines, 83.33% functions
  • Manual test: ralph-tui info displays system info
  • Manual test: ralph-tui info -c outputs copyable format
  • Manual test: ralph-tui info --json outputs valid JSON
  • Manual test: ralph-tui info --help shows help

Summary by CodeRabbit

Release Notes

  • New Features
    • Added info subcommand to display comprehensive system diagnostic information (version, runtime, OS, configuration, templates, agent, and tracker details)
    • Multiple output formats supported: human-readable display, JSON output, and copyable bug report snippet for quick sharing
    • Enhanced bug report template to request structured system information, improving issue reporting quality and troubleshooting efficiency

✏️ Tip: You can customize this high-level summary in your review settings.

Adds `ralph-tui info` command that collects and displays system information
useful for bug reports, including:
- ralph-tui version
- Runtime (Bun/Node) version
- OS details
- Config file locations and status
- Installed templates
- Agent detection status
- Tracker configuration

Available output formats:
- Default: Human-readable display
- --json: Machine-readable JSON
- -c/--copyable: Markdown code block for GitHub issues

Also updates the GitHub bug report template to request `ralph-tui info -c`
output instead of manual version/platform fields.
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
ralph-tui Ignored Ignored Jan 18, 2026 10:02am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 18, 2026

Warning

Rate limit exceeded

@subsy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 77db31a and 2549a30.

📒 Files selected for processing (4)
  • .beads/issues.jsonl
  • .github/ISSUE_TEMPLATE/bug_report.yaml
  • src/commands/info.test.ts
  • src/commands/info.ts

Walkthrough

This PR introduces a new info subcommand for ralph-tui that collects and formats system diagnostic information including runtime, OS, configuration, templates, and agent/tracker details. It updates the bug report template to request this structured system data and adds corresponding CLI integration with comprehensive test coverage.

Changes

Cohort / File(s) Summary
Issue template update
.github/ISSUE_TEMPLATE/bug_report.yaml
Replaced version input with system information textarea, removed platform dropdown, added configuration field (TOML), and enhanced logs field guidance with ralph-tui specific instructions
CLI integration
src/cli.tsx
Added import of executeInfoCommand and introduced handling for new info subcommand with corresponding help text documentation
Commands module exports
src/commands/index.ts
Re-exported executeInfoCommand, collectSystemInfo, formatSystemInfo, and formatForBugReport from new info module
System info implementation
src/commands/info.ts
New module providing system diagnostic collection and formatting: detects Bun/Node runtime, gathers OS data, discovers templates, initializes agents and trackers, supports multiple output formats (human-readable, copyable bug report, JSON) with CLI option handling (--json, --copyable, --cwd, --help)
Comprehensive test suite
src/commands/info.test.ts
Added 351 lines of test coverage for system info collection and formatting, including edge cases (missing config, unavailable agents, empty templates) with temporary directory isolation utilities

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as CLI Handler
    participant InfoCmd as Info Command
    participant Collector as System Collector
    participant Config as Config/Templates
    participant Agent as Agent Registry
    participant Formatter as Output Formatter

    User->>CLI: ralph-tui info [--json|--copyable]
    CLI->>InfoCmd: executeInfoCommand(args)
    InfoCmd->>Collector: collectSystemInfo(cwd)
    
    par Parallel Collection
        Collector->>Collector: Detect runtime (Bun/Node)
        Collector->>Collector: Read OS info
        Collector->>Config: Load stored config
        Collector->>Config: Enumerate templates
        Collector->>Agent: Initialize agents
        Collector->>Agent: Resolve tracker
    end
    
    Collector-->>InfoCmd: SystemInfo object
    
    alt Format Type
        InfoCmd->>Formatter: formatSystemInfo() or
        InfoCmd->>Formatter: formatForBugReport() or
        InfoCmd->>Formatter: JSON serialization
    end
    
    Formatter-->>InfoCmd: Formatted output
    InfoCmd-->>User: Display diagnostics
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A new command hops into view,
Gathering system info, tried and true!
Bun or Node, config and more—
Diagnostics aplenty to help us explore!
Bug reports now flow like carrots galore! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the main change: addition of a new 'info' command for system diagnostics, which is the primary feature introduced across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 73.27189% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.69%. Comparing base (42c3dfa) to head (2549a30).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/commands/info.ts 73.27% 58 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
+ Coverage   47.28%   47.69%   +0.41%     
==========================================
  Files          60       61       +1     
  Lines       13447    13664     +217     
==========================================
+ Hits         6358     6517     +159     
- Misses       7089     7147      +58     
Files with missing lines Coverage Δ
src/commands/info.ts 73.27% <73.27%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.github/ISSUE_TEMPLATE/bug_report.yaml:
- Around line 18-21: Update the placeholder example in the bug report template
so the ralph-tui version matches the stated requirement for the info command;
replace the placeholder line "ralph-tui: 0.2.0" with "ralph-tui: 0.2.1" within
the placeholder block so the example and the "info command requires v0.2.1 or
higher" note are consistent.

In `@src/commands/info.ts`:
- Around line 284-298: The help text and parsing in executeInfoCommand disagree:
the code currently reads cwd via args.find((a) =>
a.startsWith('--cwd='))?.split('=')[1] which both enforces an equals form and
breaks on paths containing '='; update parsing to accept both forms and avoid
split-truncation by checking for a standalone flag or an equals assignment
(e.g., if an arg equals '--cwd' take the next args element, else if it
startsWith('--cwd=') take the substring after the first '=' using indexOf) and
fall back to process.cwd(); alternatively, if you prefer the simpler change,
update the displayed help to show --cwd=<path> to match the current
implementation, but the preferred fix is to make executeInfoCommand robust to
both '--cwd path' and '--cwd=path' and handle '=' characters safely when
extracting the value.
🧹 Nitpick comments (2)
src/commands/info.ts (2)

17-40: Redundant outer try-catch block.

The outer try-catch (lines 38-40) is unnecessary since all errors from the inner loop are already caught by the inner try-catch at line 34. The version detection logic is sound, but the structure could be simplified.

Suggested simplification
 // Package version - imported at runtime
 let packageVersion = 'unknown';
-try {
-  // Try to read from package.json in various locations
-  const possiblePaths = [
-    join(__dirname, '../../package.json'),
-    join(__dirname, '../package.json'),
-    join(process.cwd(), 'package.json'),
-  ];
-  for (const p of possiblePaths) {
-    try {
-      const pkg = await readFile(p, 'utf-8');
-      const parsed = JSON.parse(pkg);
-      if (parsed.name === 'ralph-tui') {
-        packageVersion = parsed.version;
-        break;
-      }
-    } catch {
-      // Try next path
-    }
+// Try to read from package.json in various locations
+const possiblePaths = [
+  join(__dirname, '../../package.json'),
+  join(__dirname, '../package.json'),
+  join(process.cwd(), 'package.json'),
+];
+for (const p of possiblePaths) {
+  try {
+    const pkg = await readFile(p, 'utf-8');
+    const parsed = JSON.parse(pkg);
+    if (parsed.name === 'ralph-tui') {
+      packageVersion = parsed.version;
+      break;
+    }
+  } catch {
+    // Try next path
   }
-} catch {
-  // Version remains unknown
 }

119-128: Redundant dynamic import of readdir.

readdir could be imported statically alongside readFile at line 9, avoiding the dynamic import overhead on each call.

Suggested fix

Update the import at line 9:

-import { access, constants, readFile } from 'node:fs/promises';
+import { access, constants, readFile, readdir } from 'node:fs/promises';

Then simplify the usage:

   // Check templates directory
   const templatesDir = join(getUserConfigDir(), 'templates');
   const installedTemplates: string[] = [];
   try {
-    const { readdir } = await import('node:fs/promises');
     const files = await readdir(templatesDir);
     installedTemplates.push(...files.filter((f) => f.endsWith('.hbs')));
   } catch {
     // Directory doesn't exist or can't read
   }

AI Agent and others added 2 commits January 18, 2026 09:52
- Update bug report template placeholder to show v0.2.1 (matches stated requirement)
- Fix --cwd argument parsing to handle both '--cwd path' and '--cwd=path' forms
- Use substring instead of split to preserve '=' characters in paths
- Add tests for parseCwdArg covering edge cases
@subsy subsy merged commit a30e59e into main Jan 18, 2026
9 checks passed
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
…mplat

feat: add info command for system diagnostics
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.

1 participant