Skip to content

fix(cli): set output mode before loadLocalEnv, normalise URLs#9

Merged
DuncanAForbes merged 1 commit into
mainfrom
develop
Apr 6, 2026
Merged

fix(cli): set output mode before loadLocalEnv, normalise URLs#9
DuncanAForbes merged 1 commit into
mainfrom
develop

Conversation

@DuncanAForbes
Copy link
Copy Markdown
Contributor

Summary

Addresses CodeRabbit feedback from PR #7:

  • Output mode ordering: setOutputMode now runs before loadLocalEnv() in the preAction hook, so --json / --quiet flags are active before any loader messages print
  • URL normalization: Adds normalizeUrl() helper that strips surrounding quotes, removes trailing slashes, and validates http(s):// scheme on .env.local URL values

Test plan

  • bagdock login --ngrok --json produces no text before JSON output
  • .env.local with BAGDOCK_API_URL="https://foo.ngrok.app/" resolves to https://foo.ngrok.app (no quotes, no trailing slash)
  • .env.local with BAGDOCK_API_URL=not-a-url exits with a clear error

- Reorder preAction hook so --json/--quiet flags are active before
  loadLocalEnv prints any messages
- Add normalizeUrl() to strip surrounding quotes, trailing slashes, and
  validate http(s) scheme on .env.local URL values
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 6, 2026

Warning

Rate limit exceeded

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

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 4 seconds.

⌛ 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 46b5aec2-f642-4738-8491-cd3946b2a075

📥 Commits

Reviewing files that changed from the base of the PR and between 47873a0 and fbd4632.

📒 Files selected for processing (2)
  • bin/bagdock.ts
  • src/config.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

@DuncanAForbes DuncanAForbes merged commit 0c85695 into main Apr 6, 2026
6 checks passed
@DuncanAForbes DuncanAForbes deleted the develop branch April 6, 2026 20:19
@DuncanAForbes DuncanAForbes restored the develop branch April 6, 2026 20:21
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