product:port

Show the real URL and port where the active product is running.


Usage

Inspect default environment (resolved automatically):

splent product:port

Inspect a specific environment:

splent product:port --env dev
splent product:port --env prod

Development environment

In development, SPLENT prints the URL of the running product based on the published Docker port.

If running inside the official Vagrant VM, SPLENT uses:

  • 10.10.10.10

Otherwise it uses:

  • localhost

Production environment

In production mode, the command behaves the same: it selects the compose file for prod and prints the actual published port.


Description

This command:

  1. Loads /workspace/.env to determine the active product (SPLENT_APP).
  2. Loads the product env file: <product>/docker/.env.
  3. Resolves the environment in this order:
    • --env
    • SPLENT_ENV in the product .env
    • default: dev
  4. Chooses the compose file in:
    • docker-compose.<env>.yml
    • docker-compose.yml (fallback)
  5. Finds the product web service (service name containing the product name).
  6. Reads the published runtime ports from Docker.
  7. Prints the final URL.

Requirements

  • /workspace/.env must exist and include SPLENT_APP.
  • <product>/docker/.env must exist.
  • The product must be running (a container must exist with published ports).