feat: Select endpoint, token, workspace with a value, override with a flag - #618
Merged
Merged
Conversation
The endpoint and the workspace were set two different ways depending on the command: `select endpoint --endpoint`, but `login --workspace-id`, and nothing scoped a single command except an environment variable. Split the two jobs so each has one spelling: - `seam select endpoint <url>` and `seam select workspace <workspace-id>` take the value after the command and store it. They are the only commands that write those settings. Run either with no value to pick one interactively, as before. - `--endpoint` and `--workspace-id` are global flags that override what one command resolves to and store nothing. They win over `SEAM_CLI_ENDPOINT` and `SEAM_CLI_WORKSPACE_ID`, which still win over what is stored. `seam login` keeps storing the token, now under whatever endpoint is in effect: `seam login --endpoint <url> --token <token>` stores a token for that endpoint without selecting it, exactly as `SEAM_CLI_ENDPOINT` already behaved. Its own `--endpoint` and `--workspace-id` flags are gone, the global ones cover it, and the workspace it is given is only what the token is validated against. Selecting a workspace non-interactively is what `seam select workspace <workspace-id>` is for, which until now had no non-interactive path at all. The two flags are refused on `seam select ...`, where they would read as the value to store and quietly do nothing of the kind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGei65aQbdcHScx5QyuGKZ
razor-x
pushed a commit
that referenced
this pull request
Aug 12, 2026
main's #618 gives login a token rather than options, and resolves a flag over the environment over what is stored. Both are taken as they are; what changes is that the reads and writes underneath them are method calls. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
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.
Setting the endpoint and the workspace was spelled differently depending on the command —
select endpoint --endpoint, butlogin --workspace-id— and nothing scoped a single command except an environment variable. This splits the two jobs so each has one spelling.Selecting stores
The value goes after the command. These are now the only two commands that write those settings. Run either with no value to pick one interactively, as before.
seam select workspace <workspace-id>is new capability: until now the command had no non-interactive path at all, and its error told you to go useseam login --workspace-idinstead.Flags override one command
--endpointand--workspace-idare global flags on every other command. They change what that one invocation resolves to and store nothing:Precedence is flag → environment variable → stored → default, so
--endpointwins overSEAM_CLI_ENDPOINT, which still wins over what is selected.Because they never store anything, they are refused on the commands that do:
What login does now
seam loginkeeps storing the token, under whatever endpoint is in effect.seam login --endpoint <url> --token <token>stores a token for that endpoint without selecting it — exactly howSEAM_CLI_ENDPOINTalready behaved with login, now reachable as a flag.Its own
--endpointand--workspace-idflags are gone; the global ones cover it. The workspace it is given is only what a Personal Access Token is validated against.Breaking changes
seam select endpoint --endpoint <url>→seam select endpoint <url>seam login --endpoint <url>no longer changes what is selected; it stores the token for that endpoint. Useseam select endpoint <url>to switch.seam login --workspace-id <id>no longer leaves that workspace selected. Useseam select workspace <id>.Notes
--endpointand--workspace-idjoincliFlags, so they are never forwarded to the API as request params. Checked against the full blueprint first: no Seam endpoint takes a parameter by either name, so nothing is shadowed.lib/overrides.ts) with a setter and reset, mirroringgetConfigStore/getOutput, becauseresolveAuth()is called without a context in four modules and the flags have to reach all of them._→-) but the positional is not, so a URL or an id is stored exactly as typed. There is an e2e test pinning that.toCommandWordnow stringifies its argument: minimist reads a numeric word as a number, which previously crashed onseam devices list 123.Testing
278 tests pass, including new coverage for flag precedence over env and stored values, the token resolving under an overridden endpoint, both positionals storing what they are given, and the overrides being refused on
select. Also exercised by hand against a temp XDG home — help output, completion scripts, and the error paths above.🤖 Generated with Claude Code
https://claude.ai/code/session_01EGei65aQbdcHScx5QyuGKZ
Generated by Claude Code