Skip to content

feat(host): manage multiple Ellipsis instances (agent host)#37

Merged
hbrooks merged 1 commit into
mainfrom
feat/cli-hosts
Jul 11, 2026
Merged

feat(host): manage multiple Ellipsis instances (agent host)#37
hbrooks merged 1 commit into
mainfrom
feat/cli-hosts

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 11, 2026

Copy link
Copy Markdown
Member

What

Adds an agent host command group so the CLI can target multiple Ellipsis instances — Ellipsis Cloud, a preview environment, or a self-hosted deployment — and switch between them without re-exporting env vars.

agent host add beta https://beta-api.ellipsis.dev   # register + switch to it
agent host add prod https://api.ellipsis.dev
agent host list                                      # active marked *
agent host use beta
agent host current                                   # api + app + how it resolves
agent host set beta --rename staging --app-base https://dash…
agent host delete beta

agent host sets where the CLI points; agent login sets the credential for wherever it's pointing. No overlap, no --login shortcut.

Model

  • Config becomes { version: 2, activeHost, hosts: { <name>: { apiBase, appBase?, token?, enrolledRepos? } } }.
  • Token and enrolled-repos are per host — switching instances never reuses another instance's credential or sync consent.
  • App/dashboard URL is per host: derived from the API URL (api.app.) by default, or set explicitly with --app-base for a self-hosted instance whose dashboard host isn't a mechanical swap. Every dashboard link the CLI prints (including the login verification URL) uses it.
  • Precedence unchanged: explicit arg → ELLIPSIS_API_BASE_URL/ELLIPSIS_API_TOKEN env → active host → prod default. Sandbox env injection still works untouched.
  • A pre-hosts (v1) config is migrated in place on first load — the existing login becomes a host named for its API base — so nobody has to re-login.

Login fix (supersedes #36)

agent login now builds the approval URL from the active host's app base instead of the server's verification_uri_complete. The backend fills that from ELLIPSIS_APP_BASE_URL, which is unset in every env and defaults to prod — so a beta/self-hosted login was sent to the prod dashboard, where the code can't be approved (login hung). Closes #36.

The backend is still wrong for non-prod (separate consolidation: set ELLIPSIS_APP_BASE_URL per instance + unify the app-host helpers); the CLI no longer depends on it. Server-authoritative app-URL learning is a clean future enhancement once that lands.

Test plan

  • bun run typecheck, bun run test (202 pass — new host/migration/cliAuthUrl cases), bun run build, compile smoke — all green locally.
  • Manual: add/use/list/current/set/delete verified end to end; --app-base override and v1→v2 migration confirmed.

Adds an `agent host` command group so the CLI can target Ellipsis Cloud, a preview environment, or a self-hosted deployment, and switch between them without re-exporting env vars. Config becomes a named set of hosts + an active pointer; each host keeps its own token (switching doesn't re-auth) and its own dashboard/app URL.

The app/dashboard URL is derived from the API URL (api. -> app.) or set explicitly per host (--app-base) for self-hosted instances whose dashboard isn't a mechanical swap. `login` builds the device-code approval URL from the active host's app base, not the server's verification_uri_complete (which the backend defaults to prod) — this fixes beta/dev/self-hosted login and supersedes #36.

Precedence unchanged (arg -> env -> active host -> prod default), so sandbox env injection still works. A pre-hosts v1 config is migrated in place on first load. Closes #36.
@hbrooks hbrooks merged commit c1b77e2 into main Jul 11, 2026
1 check passed
@hbrooks hbrooks deleted the feat/cli-hosts branch July 11, 2026 14:26
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