Skip to main content

Global Flags

These flags work with all commands:

--help, -h

Show help information for a command.

--version, -v

Show the installed version of Portless.

App Running Flags

These flags work with portless run and portless <name> commands:

--force

Override an existing route registered by another process.
Without --force, you’ll get an error if a route is already registered:
With --force, the old route is replaced with the new one.

--app-port <number>

Use a fixed port for the app instead of automatic assignment (4000-4999 range).
Port must be between 1 and 65535. Useful when:
  • Your app requires a specific port
  • You need to match a port in another config file
  • You’re debugging port-related issues

--name <name>

Force the use of a specific app name, bypassing subcommand dispatch. Useful for using reserved names.
Reserved names: run, get, alias, hosts, list, trust, proxy

--

Stop flag parsing. Everything after -- is passed directly to your command.
Useful when your command has flags that might conflict with Portless flags.

Proxy Flags

These flags work with portless proxy start:

--port <number>, -p <number>

Port for the proxy to listen on (1-65535).
Ports below 1024 require sudo:
Default: 1355 (or value from PORTLESS_PORT environment variable)

--https

Enable HTTP/2 with TLS using auto-generated certificates.
On first run:
  1. Generates local CA
  2. Adds CA to system trust store (prompts for sudo on Linux)
  3. Generates wildcard certificate for *.localhost
Browsers will trust certificates without warnings.

--cert <path>

Path to a custom TLS certificate in PEM format. Must be used with --key. Implies --https.
Certificate must start with -----BEGIN CERTIFICATE-----.

--key <path>

Path to a custom TLS private key in PEM format. Must be used with --cert. Implies --https.
Key must start with -----BEGIN PRIVATE KEY----- or similar.

--no-tls

Disable HTTPS even if PORTLESS_HTTPS environment variable is set.

--foreground

Run the proxy in the foreground instead of as a daemon. Useful for debugging.
Logs print to stdout/stderr. Press Ctrl+C to stop.

Alias Flags

These flags work with portless alias:

--force

Override an existing route when creating an alias.

--remove

Remove an existing alias.

Get Flags

These flags work with portless get:

--no-worktree

Skip worktree prefix detection when generating the URL.

Flag Placement

Flags can appear in different positions depending on the command:

Run Command

Flags must come before the command.

Named Mode

Flags can come before or after the app name, but before the command.

With --

Everything after -- is passed to your command untouched.

Examples

Multiple Flags

Flag Conflicts

See Also