Skip to content

Update CLI to simplify arguments and improve defaults - #60

Merged
j9t merged 2 commits into
mainfrom
cli-default-cwd
Aug 12, 2026
Merged

Update CLI to simplify arguments and improve defaults#60
j9t merged 2 commits into
mainfrom
cli-default-cwd

Conversation

@j9t

@j9t j9t commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Breaking Changes
    • The CLI now accepts an optional positional path instead of the removed -f/--folder option.
    • When no path is provided, it processes the current directory by default.
  • Bug Fixes
    • Missing files or directories now display a clear error message and exit with a non-zero status.
  • Documentation
    • Updated usage guidance and examples for processing directories, absolute paths, relative paths, and individual files.
  • Chores
    • Released as version 2.0.0.

Replaced `--folder` option with a positional argument for specifying paths. Changed the default behavior to check the current directory when no path is provided. Updated error handling to fail with a clear message and non-zero exit code when given paths do not exist.

(This commit message was AI-generated.)

Signed-off-by: Jens Oliver Meiert <jens@meiert.com>
@socket-security

socket-security Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedglobals@​17.9.0 ⏵ 17.10.010010086 +194 -1100
Updatedeslint@​10.8.0 ⏵ 10.8.197 +110010097100

View full report

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@j9t, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dd24446e-245a-4de6-8ef0-98d98b961492

📥 Commits

Reviewing files that changed from the base of the PR and between 2286942 and 111feb3.

📒 Files selected for processing (2)
  • bin/obsohtml.js
  • bin/obsohtml.test.js

Walkthrough

The CLI now accepts an optional positional path, uses the current directory when no path is provided, and reports missing paths with a non-zero exit. Tests, documentation, changelog content, package version, and development dependencies were updated.

Changes

CLI path argument update

Layer / File(s) Summary
CLI path handling
bin/obsohtml.js
The CLI uses the current directory by default, accepts a positional path, validates the path, and removes the --folder option.
CLI behavior tests
bin/obsohtml.test.js
Tests cover positional paths, default-directory scanning, missing paths, and rejection of the removed option.
Release and usage updates
README.md, CHANGELOG.md, package.json
Documentation and changelog entries describe the new CLI behavior. The package version is 2.0.0, with updated development dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant obsohtmlCLI
  participant Filesystem
  User->>obsohtmlCLI: Provide optional positional path
  obsohtmlCLI->>Filesystem: Resolve and check target path
  Filesystem-->>obsohtmlCLI: Return path status
  obsohtmlCLI->>User: Scan target or report error and exit
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes to simplify CLI arguments and improve default behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cli-default-cwd

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bin/obsohtml.js`:
- Around line 100-106: Update the lstatSync error handling around
projectDirectory so both ENOENT and ENOTDIR are treated as unresolved targets,
printing the existing “No such file or directory” message and exiting instead of
rethrowing; add a regression test covering a path whose parent is an existing
file.

In `@README.md`:
- Around line 23-25: Update the README usage/output documentation to describe
that a nonexistent target path produces an error and exits with status 1. Revise
the status 0 description to specify that it indicates a successful scan found no
obsolete HTML, not an invalid or missing target.
🪄 Autofix

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 757eb7da-e8f3-47bd-8cdd-f904cc1fc4a0

📥 Commits

Reviewing files that changed from the base of the PR and between cfce8b5 and 2286942.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • CHANGELOG.md
  • README.md
  • bin/obsohtml.js
  • bin/obsohtml.test.js
  • package.json

Comment thread bin/obsohtml.js
Comment thread README.md
Added support to handle `ENOTDIR` errors similarly to `ENOENT` when a path is below an existing file. Updated tests to verify proper error messaging and ensure no raw stack traces are displayed.

(This commit message was AI-generated.)

Signed-off-by: Jens Oliver Meiert <jens@meiert.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the ObsoHTML CLI interface to use a positional path argument (defaulting to the current directory) and improves failure behavior when the target path cannot be resolved, alongside corresponding documentation, tests, and a major version bump.

Changes:

  • Replaced the removed -f/--folder option with an optional positional [path] argument and defaulted to . when omitted.
  • Added explicit failure (non-zero exit + clearer message) for non-existent/unresolvable target paths, with updated CLI tests.
  • Updated README/CHANGELOG and released as 2.0.0 (plus minor devDependency bumps).

Reviewed changes

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

Show a summary per file
File Description
README.md Updates CLI usage text and examples for positional path + current-directory default.
package.json Bumps version to 2.0.0 and updates devDependency patch versions.
package-lock.json Locks updated devDependency versions and bumps lockfile package version to 2.0.0.
CHANGELOG.md Documents breaking CLI argument change and new failure behavior for missing paths.
bin/obsohtml.test.js Updates CLI tests for positional path, default-CWD behavior, and missing-path failures.
bin/obsohtml.js Implements positional argument parsing and new missing/unresolvable target error handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@j9t
j9t merged commit a9b1167 into main Aug 12, 2026
7 checks passed
@j9t
j9t deleted the cli-default-cwd branch August 12, 2026 13:45
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