refactor: target bootstrap-admin at the active profile instance#66
Merged
Conversation
Drop the dead seamless.config.json presence gate from bootstrap-admin (its parsed contents were never used) and resolve the target instance from the active profile's instanceUrl instead. Precedence is SEAMLESS_API_URL override, then the active profile (respecting --profile / SEAMLESS_PROFILE), then the local http://localhost:3000 fallback. The bootstrap-secret Bearer auth is intentionally unchanged: bootstrap runs before any admin user exists, so it cannot authenticate as the profile's user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors
seamless bootstrap-adminto target instances through the CLI's profile system instead of gating on a localseamless.config.json.Previously the command loaded
./seamless.config.jsonpurely as a presence check — the parsed contents (services.auth.mode) were never read — and resolved the target fromSEAMLESS_API_URL, defaulting tohttp://localhost:3000. That coupled the command to being run from inside a scaffolded project directory.Now the target instance is resolved from the active profile, consistent with every other instance-facing command (
whoami,sessions,users,org, …).Behavior
Instance URL precedence:
SEAMLESS_API_URLenv override (backward compatible)instanceUrl— respects--profile <name>andSEAMLESS_PROFILEhttp://localhost:3000fallback when no profile is configured (preserves the zero-config local flow)Auth is intentionally unchanged
Bootstrap runs before any admin user exists, so it cannot authenticate as the profile's user. It continues to use the shared bootstrap secret (Bearer) resolved from
.env/auth/.env/docker-compose.yml, or prompts. The profile is used only for targeting, not auth.Changes
src/commands/bootstrapAdmin.ts— drop the deadseamless.config.jsongate; addresolveApiUrl()and--profileparsing (signature is now(args: string[])).src/index.ts— passargs.slice(1)through to the command.src/commands/help.ts— document--profileand the new targeting behavior.bootstrapAdmin.test.ts,index.test.ts) covering profile targeting,--profile, env override, and localhost fallback.Testing
vitest run— 549 passedtsctypecheck cleanbootstrapAdmin.tsat 100%