Skip to content

feat: show highlighted absolute output path on completion - #1378

Open
dormeneur wants to merge 4 commits into
yamadashy:mainfrom
dormeneur:feat/show-absolute-output-path
Open

dormeneur wants to merge 4 commits into
yamadashy:mainfrom
dormeneur:feat/show-absolute-output-path

Conversation

@dormeneur

@dormeneur dormeneur commented Apr 3, 2026 •

Copy link
Copy Markdown

Problem

After packing completes, the CLI only shows a relative path in the Pack Summary:

Output: repomix-output.xml

This is ambiguous — users have to guess which directory that file was written to,
especially when running repomix from a deeply nested or unfamiliar path.

Solution

  1. Pack Summary — Output: now shows the full absolute path instead of relative.
  2. Completion section — Added a prominent 📁 Output file generated at: block
    with the absolute path styled as bold + cyan + underlined, so it is impossible to miss.

Before

       Output: repomix-output.xml

🎉 All Done!
Your repository has been successfully packed.
💡 Repomix is now available in your browser! Try it at https://repomix.com

After

       Output: /home/user/project/repomix-output.xml

🎉 All Done!
Your repository has been successfully packed.

📁 Output file generated at:
   /home/user/project/repomix-output.xml   ← bold, cyan, underlined

💡 Repomix is now available in your browser! Try it at https://repomix.com

Changes

  • src/cli/cliReport.ts — resolve and pass absolute output path to reportCompletion();
    remove getDisplayPath() wrapping in reportSummary() for both single and multi-part output.
  • tests/cli/cliReport.test.ts — add bold to picocolors mock; update reportCompletion
    test to pass a path argument and assert the new output lines.

All 15 existing tests pass.


Open with Devin

@dormeneur
dormeneur requested a review from yamadashy as a code owner April 3, 2026 12:10
Copilot AI review requested due to automatic review settings April 3, 2026 12:10
@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aec82e89-60af-45c8-b905-d9ce2c073a73

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The CLI reporting functionality was updated to compute and pass output file paths to the reporting functions. The reportCompletion function now accepts an output path parameter and logs it with styled formatting. Output path resolution logic was modified to prefer the first entry from packed output files or fall back to the configured output file path.

Changes

Cohort / File(s) Summary
Output Path Handling
src/cli/cliReport.ts
Added output path computation in reportResults (prioritizing packResult.outputFiles[0] or config.output.filePath), updated reportCompletion signature to accept outputPath: string and log formatted output location, and modified reportSummary to use absolute paths instead of display paths.
Test Updates
tests/cli/cliReport.test.ts
Updated reportCompletion test invocation to pass output path argument and expanded assertions to validate the new styled output path logging lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • PR #95: Modifies how config.output.filePath is determined and defaulted, directly related to the output path resolution fallback logic introduced in this PR.
  • PR #852: Also modifies reportSummary function in the same file, adding Git Logs token-count block alongside this PR's path logging changes.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: show highlighted absolute output path on completion' accurately and concisely summarizes the main change—adding highlighted absolute output paths to the CLI completion messages.
Description check ✅ Passed The description is comprehensive, including a clear problem statement, solution overview, before/after examples, detailed change list, and test status confirmation. It substantially exceeds the minimal template requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates CLI post-pack messaging to make the generated output location unambiguous by showing absolute paths in the summary and a prominent completion block.

Changes:

  • Print absolute output paths in the Pack Summary (single and multi-part outputs).
  • Add a completion section that highlights the output path (bold + cyan + underlined).
  • Update unit tests/mocks to support the new formatting and completion signature.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/cli/cliReport.ts Switch summary output to absolute paths and add a highlighted completion block with an output path parameter.
tests/cli/cliReport.test.ts Update picocolors mock and adjust completion test to assert new output lines.

Comment thread src/cli/cliReport.ts Outdated
Comment thread src/cli/cliReport.ts Outdated
Comment thread src/cli/cliReport.ts
Comment on lines 100 to 112
if (packResult.outputFiles && packResult.outputFiles.length > 0) {
const first = packResult.outputFiles[0];
const last = packResult.outputFiles[packResult.outputFiles.length - 1];
const firstDisplayPath = getDisplayPath(path.resolve(cwd, first), cwd);
const lastDisplayPath = getDisplayPath(path.resolve(cwd, last), cwd);
const firstAbsPath = path.resolve(cwd, first);
const lastAbsPath = path.resolve(cwd, last);

logger.log(
` Output: ${firstDisplayPath} ${pc.dim('…')} ${lastDisplayPath} ${pc.dim(`(${packResult.outputFiles.length} parts)`)}`,
` Output: ${firstAbsPath} ${pc.dim('…')} ${lastAbsPath} ${pc.dim(`(${packResult.outputFiles.length} parts)`)}`,
);
} else {
const outputPath = path.resolve(cwd, config.output.filePath);
const displayPath = getDisplayPath(outputPath, cwd);
logger.log(` Output: ${displayPath}`);
logger.log(` Output: ${outputPath}`);
}

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

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

The PR changes reportSummary() to print absolute paths for both single and multi-part output, but the existing cliReport unit tests don't assert the Output: line at all. Adding assertions for the absolute-path output (including the multi-part first … last (N parts) case) would help prevent regressions and ensure the new UX is covered.

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/cli/cliReport.test.ts (1)

327-335: Add one regression test for output-path selection.

This only proves that reportCompletion() formats the string it receives. It will not catch mismatches between options.skillDir, outputFiles[0], and config.output.filePath, which is where the new behavior can drift.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/cli/cliReport.test.ts` around lines 327 - 335, Add a regression test
that verifies the actual output-path selection logic (not just formatting) by
exercising the code path that picks between options.skillDir, outputFiles[0],
and config.output.filePath and asserting the final printed path is the chosen
one; specifically, in the test suite that calls reportCompletion, construct a
scenario where options.skillDir, outputFiles (array with first element), and
config.output.filePath differ, invoke the function or command that resolves the
output path, and assert that the logger received the message containing the
resolved path (referencing options.skillDir, outputFiles[0],
config.output.filePath and reportCompletion to locate the relevant code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/cli/cliReport.ts`:
- Around line 59-67: The completion banner uses a raw file path while the
summary uses getDisplayPath(options.skillDir...), causing inconsistent output in
skill mode; update the outputPath computation in the reportCompletion call to
pass the same display path used by reportSummary (use
getDisplayPath(options.skillDir, path.resolve(cwd, ...)) or, if options.skillDir
is falsy, fall back to the resolved path) so reportCompletion receives the
identical display string; also apply the same change to the other similar blocks
that compute outputPath (the other reportSummary/reportCompletion pairs).

---

Nitpick comments:
In `@tests/cli/cliReport.test.ts`:
- Around line 327-335: Add a regression test that verifies the actual
output-path selection logic (not just formatting) by exercising the code path
that picks between options.skillDir, outputFiles[0], and config.output.filePath
and asserting the final printed path is the chosen one; specifically, in the
test suite that calls reportCompletion, construct a scenario where
options.skillDir, outputFiles (array with first element), and
config.output.filePath differ, invoke the function or command that resolves the
output path, and assert that the logger received the message containing the
resolved path (referencing options.skillDir, outputFiles[0],
config.output.filePath and reportCompletion to locate the relevant code).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6ff589ae-b444-42d8-81b8-bedf8241b7e5

📥 Commits

Reviewing files that changed from the base of the PR and between a579381 and a985467.

📒 Files selected for processing (2)
  • src/cli/cliReport.ts
  • tests/cli/cliReport.test.ts

Comment thread src/cli/cliReport.ts Outdated
Comment on lines +59 to +67
reportSummary(cwd, packResult, config, options);
logger.log('');

reportCompletion();
const outputPath =
packResult.outputFiles && packResult.outputFiles.length > 0
? path.resolve(cwd, packResult.outputFiles[0])
: path.resolve(cwd, config.output.filePath);

reportCompletion(outputPath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Keep the --skill output location consistent across summary and completion.

Line 97 still renders options.skillDir through getDisplayPath(), while Lines 62-65 ignore options.skillDir and pass the regular file path into reportCompletion(). In skill mode the summary can stay relative and the new completion banner can point at a different target entirely.

💡 Proposed fix
   reportSummary(cwd, packResult, config, options);
   logger.log('');

   const outputPath =
-    packResult.outputFiles && packResult.outputFiles.length > 0
-      ? path.resolve(cwd, packResult.outputFiles[0])
-      : path.resolve(cwd, config.output.filePath);
+    config.skillGenerate !== undefined && options.skillDir
+      ? path.resolve(cwd, options.skillDir)
+      : packResult.outputFiles && packResult.outputFiles.length > 0
+        ? path.resolve(cwd, packResult.outputFiles[0])
+        : path.resolve(cwd, config.output.filePath);

   reportCompletion(outputPath);
@@
   if (config.skillGenerate !== undefined && options.skillDir) {
-    const displayPath = getDisplayPath(options.skillDir, cwd);
-    logger.log(`       Output: ${displayPath} ${pc.dim('(skill directory)')}`);
+    const skillDirPath = path.resolve(cwd, options.skillDir);
+    logger.log(`       Output: ${skillDirPath} ${pc.dim('(skill directory)')}`);
   } else {
@@
-  logger.log(`📁 Output file generated at:`);
+  logger.log('📁 Output generated at:');

Also applies to: 95-111, 244-250

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/cli/cliReport.ts` around lines 59 - 67, The completion banner uses a raw
file path while the summary uses getDisplayPath(options.skillDir...), causing
inconsistent output in skill mode; update the outputPath computation in the
reportCompletion call to pass the same display path used by reportSummary (use
getDisplayPath(options.skillDir, path.resolve(cwd, ...)) or, if options.skillDir
is falsy, fall back to the resolved path) so reportCompletion receives the
identical display string; also apply the same change to the other similar blocks
that compute outputPath (the other reportSummary/reportCompletion pairs).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the CLI reporting to include the absolute output file path in the completion message and summary. The review feedback suggests deduplicating the path calculation logic and improving the handling of multi-file outputs to ensure labels and formatting correctly reflect whether one or multiple files were generated.

Comment thread src/cli/cliReport.ts Outdated
Comment on lines +62 to +65
const outputPath =
packResult.outputFiles && packResult.outputFiles.length > 0
? path.resolve(cwd, packResult.outputFiles[0])
: path.resolve(cwd, config.output.filePath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The logic for determining the output path is duplicated here and in reportSummary. Additionally, this implementation only considers the first file when multiple output files are generated (split output), which makes the completion message singular and potentially misleading.

Comment thread src/cli/cliReport.ts Outdated

logger.log(
` Output: ${firstDisplayPath} ${pc.dim('…')} ${lastDisplayPath} ${pc.dim(`(${packResult.outputFiles.length} parts)`)}`,
` Output: ${firstAbsPath} ${pc.dim('…')} ${lastAbsPath} ${pc.dim(`(${packResult.outputFiles.length} parts)`)}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The range display (e.g., path … path (1 parts)) is used even when only a single output file is generated. It would be cleaner to show a single path in that case.

        packResult.outputFiles.length === 1
          ? `       Output: ${firstAbsPath}`
          : `       Output: ${firstAbsPath} ${pc.dim('…')} ${lastAbsPath} ${pc.dim(`(${packResult.outputFiles.length} parts)`)}`,

Comment thread src/cli/cliReport.ts Outdated
logger.log('Your repository has been successfully packed.');

logger.log('');
logger.log(`📁 Output file generated at:`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The label "Output file generated at:" is singular. If the user has configured split output, multiple files are generated. Consider a more neutral label like "Output generated at:" or pluralizing based on the input.

dormeneur and others added 3 commits April 3, 2026 18:26
- Extract resolveOutputPath() helper to eliminate duplicated path logic
- Fix skill-mode bug: completion banner now correctly points to skillDir
- Show absolute path for skill directory in Pack Summary Output line
- Avoid range display when outputFiles has exactly one entry
- Change completion label to neutral 'Output generated at:'
- Add tests for Output: line in reportSummary (single, single-entry array, multi-part)
- Add resolveOutputPath test suite covering all three path-selection branches
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 7 additional findings in Devin Review.

Open in Devin Review


expect(logger.log).toHaveBeenCalledWith('GREEN:🎉 All Done!');
expect(logger.log).toHaveBeenCalledWith('Your repository has been successfully packed.');
expect(logger.log).toHaveBeenCalledWith('📁 Output generated at:');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Test expects wrong heading string — missing the word "file"

The test asserts '📁 Output generated at:' but getOutputSummary at src/cli/cliReport.ts:265 returns '📁 Output file generated at:' (note the extra word "file"). This test will fail at runtime because the strings don't match.

Suggested change
expect(logger.log).toHaveBeenCalledWith('📁 Output generated at:');
expect(logger.log).toHaveBeenCalledWith('📁 Output file generated at:');
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread src/cli/cliReport.ts
Comment on lines +34 to +36
if (packResult.outputFiles && packResult.outputFiles.length > 0) {
return path.resolve(cwd, packResult.outputFiles[0]);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 resolveOutputPath only returns first file, making multi-file completion banner unreachable

resolveOutputPath returns string and only returns the first output file (packResult.outputFiles[0]) at src/cli/cliReport.ts:35. reportCompletion at line 285 accepts string | string[] and getOutputSummary (lines 270-282) has multi-file logic for shared directories. However, since resolveOutputPath always produces a single string, the multi-file branches in getOutputSummary are dead code. When split output generates multiple files, the completion banner misleadingly shows only the first file instead of all output files or their shared directory.

Prompt for agents
The resolveOutputPath function returns a single string, but reportCompletion and getOutputSummary are designed to handle string | string[]. When packResult.outputFiles has multiple entries (split output), only the first file path is returned, making the multi-file display logic in getOutputSummary unreachable dead code.

To fix this, resolveOutputPath should return string | string[] and pass all output file paths through:
- Change the return type of resolveOutputPath to string | string[]
- When packResult.outputFiles has multiple entries, return all of them (mapped through path.resolve)
- When it has one entry, return the single resolved path
- The skill dir and fallback branches stay as single strings

Alternatively, if the intent is to always show a single path in the completion banner, then the multi-file branches in getOutputSummary should be removed as they are misleading dead code.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

This branch has not been deployed

No deployments
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