Slack CLI `slack run`: pinning a stable tunnel URL across local sessions
0 reputation · 22 Nov 2020, 16:49 UTC
0 reputation · 22 Nov 2020, 16:49 UTC
slack run: pinning a stable tunnel URL across local sessionsSlack's CLI supports repeatable local development: slack run starts the app locally, connects over Socket Mode for events, and provisions a tunnel so HTTP endpoints — slash commands, interactivity, OAuth redirects — stay reachable. Configuration lives in manifest.yaml with secrets in .env, so a fresh clone should behave identically on every machine.
The weak link is the tunnel hostname. ngrok free-tier subdomains are typically random per session, so a redirect URI or request URL hardcoded in the manifest can mismatch on the next restart and break the OAuth round-trip. Assuming Slack CLI v2.x, it is unclear whether the command supports a reserved or pinned subdomain, or whether manifest values can interpolate .env variables at run time. Recent releases may have changed this; verify against current CLI docs.
For a team sharing one app definition, the desired behavior is a manifest that either avoids absolute local URLs or resolves them per session without manual edits.
slack run support a stable tunnel hostname, such as an ngrok static domain, on the free tier?manifest.yaml reference environment variables for redirect and request URLs so each session injects its own hostname?35275 reputation · 23 Nov 2020, 00:44 UTC
There is no well-established, documented slack run flag for pinning a stable tunnel hostname, and manifest.yaml does not interpolate .env variables at run time — URL values are written literally when the manifest is created or applied. But for most apps the pinned-hostname problem never arises, because slack run uses Socket Mode for events and interactivity, which is an outbound WebSocket and needs no public URL at all. The only features that genuinely need a stable hostname are HTTP-facing ones, primarily OAuth redirect URIs.
Confirmed by design: Socket Mode triggers (events, slash commands, interactivity) travel over the CLI's outbound connection, so a random ngrok subdomain cannot break them. Manifests are static definitions applied via Slack's app config APIs; there is no documented runtime variable interpolation.
Likely, but version-sensitive: whether your installed CLI exposes any tunnel configuration (provider, domain, authtoken passthrough). This has changed across releases, so treat it as unverified until you check locally.
slack --version
slack run --helpLook for a flag related to tunneling, domain, or hostname. If none exists in your version, the CLI does not support pinning — full stop.apps.manifest.update API). Script it; never hand-edit, and never commit a random hostname or .env secrets into the shared manifest.Exact flags and tunnel behavior vary by CLI release; this reflects well-established behavior as of recent v2.x versions. Confirm against your installed version's help output before scripting around it.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.