Skip to content

fix(cli): accept bare remote urls#27

Merged
mikeylong merged 1 commit intomainfrom
codex/interfacectl-url-input
Mar 14, 2026
Merged

fix(cli): accept bare remote urls#27
mikeylong merged 1 commit intomainfrom
codex/interfacectl-url-input

Conversation

@mikeylong
Copy link
Copy Markdown
Collaborator

Summary

  • normalize bare remote URL input before validation across init, analyze, and auth flows
  • default bare domains to https and localhost/private hosts to http
  • add coverage for bare-domain onboarding and CLI flag paths

Testing

  • node --test packages/interfacectl-cli/test/normalize.test.mjs packages/interfacectl-cli/test/bare-onboarding.test.mjs packages/interfacectl-cli/test/init-auth.test.mjs

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
interfacectl Ready Ready Preview, Comment Mar 12, 2026 8:30pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24aca6b652

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +158 to +161
const hostname = hostnameFromUrlInput(trimmed);
const scheme = isLocalHostname(hostname) ? "http://" : "https://";
const candidate = trimmed.replace(/^\/\//, "");
return new URL(`${scheme}${candidate}`).toString();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject path-only values before normalizing remote URLs

normalizeRemoteUrlInput will silently reinterpret path-only input as a hostname because it prefixes a scheme without first requiring a host. For example, /login becomes https:///login, which URL canonicalizes to https://login/ instead of throwing. This is a regression from the previous strict parsing and can make init, analyze, and auth run against an unintended remote host when users provide a relative path or mistyped URL.

Useful? React with 👍 / 👎.

@mikeylong mikeylong force-pushed the codex/interfacectl-url-input branch from 24aca6b to 5498cf3 Compare March 14, 2026 19:24
@mikeylong mikeylong merged commit 88dafcf into main Mar 14, 2026
2 checks passed
@mikeylong mikeylong deleted the codex/interfacectl-url-input branch March 14, 2026 19:58
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