Skip to content

Conversation

@kylecarbs
Copy link
Member

Summary

Allow blink login to accept an optional host URL argument (defaulting to blink.coder.com), store it alongside the auth token, and reuse it across all CLI commands.

Changes

  • Extended auth.ts config format from {token} to {token, host}
  • Added getHost() function with priority: BLINK_HOST env var → config file → default
  • Added setHost(), normalizeHost(), and toWsUrl() helper functions
  • Updated login command to accept optional [url] argument
  • Updated deploy.ts, connect.ts, chat.ts to use getHost()
  • Updated setup-github-app.ts and setup-slack-app.ts to use getHost()

Usage Examples

# Login to default host (blink.coder.com)
blink login

# Login to custom host
blink login https://my-blink.example.com
blink login my-blink.example.com  # https:// auto-added

# Override via environment variable (useful for CI)
BLINK_HOST=https://staging.blink.coder.com blink deploy

Config File Format (After)

Path: ~/.local/share/blink/auth.json (XDG)

{
  "_": "This is your Blink credentials file. DO NOT SHARE THIS FILE WITH ANYONE!",
  "token": "eyJhbG...",
  "host": "https://my-blink.example.com"
}

Testing

  • blink package typechecks successfully with bun run typecheck

Allow `blink login` to accept an optional host URL argument
(defaulting to blink.coder.com), store it alongside the auth token,
and reuse it across all CLI commands.

Changes:
- Extended auth.ts config format from {token} to {token, host}
- Added getHost() with priority: BLINK_HOST env var → config → default
- Added setHost(), normalizeHost(), toWsUrl() helper functions
- Updated login command to accept optional [url] argument
- Updated deploy.ts, connect.ts, chat.ts to use getHost()
- Updated setup-github-app.ts and setup-slack-app.ts to use getHost()

Usage examples:
  blink login                              # Login to default host
  blink login https://my-blink.example.com # Login to custom host
  blink login my-blink.example.com         # https:// auto-added
  BLINK_HOST=https://staging.blink.coder.com blink deploy  # env override
@vercel
Copy link

vercel bot commented Jan 13, 2026

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

Project Deployment Review Updated (UTC)
blink Ready Ready Preview, Comment Jan 13, 2026 3:37pm

@kylecarbs kylecarbs merged commit a1ad1e6 into main Jan 13, 2026
6 checks passed
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