Skip to content

feat(core): add port flag to dev and start#430

Open
fpasquet wants to merge 1 commit intoalpic-ai:mainfrom
fpasquet:feat/add-port-argument
Open

feat(core): add port flag to dev and start#430
fpasquet wants to merge 1 commit intoalpic-ai:mainfrom
fpasquet:feat/add-port-argument

Conversation

@fpasquet
Copy link

@fpasquet fpasquet commented Feb 3, 2026

Fixes #417

Add port flag to dev and start.

Example usage:

skybridge dev --port 4000
skybridge start --port 4000

or

skybridge dev -p 4000
skybridge start -p 4000

Greptile Overview

Greptile Summary

This PR adds a --port (-p) flag to both skybridge dev and skybridge start commands, allowing users to specify a custom port instead of the hardcoded default of 3000.

Key changes:

  • Created resolve-port.ts utility with port validation and resolution logic (flag → env → fallback)
  • Updated dev and start commands to accept --port flag and pass resolved port via PORT environment variable
  • Updated server code (server.ts, widgetsDevServer.ts, template index.ts, devtools index.ts) to read port from process.env.PORT
  • Documentation updated across multiple files to reflect the new flag and configuration options

The implementation follows a clear precedence: CLI flag > PORT environment variable > default (3000). All port parsing includes proper validation to ensure values are within valid port range (0-65535).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is clean and follows a consistent pattern across all files. Port resolution logic includes proper validation, the precedence order (flag > env > fallback) is sensible, and all code paths correctly read from process.env.PORT. The changes are backward compatible (defaults to 3000) and documentation is comprehensive.
  • No files require special attention

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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.

[FEAT] Support -p / --port option for skybridge dev and skybridge start

1 participant