Skip to content

feat: Select endpoint, token, workspace with a value, override with a flag - #618

Merged
razor-x merged 1 commit into
mainfrom
claude/rename-server-to-endpoint-jcwv9n
Aug 12, 2026
Merged

feat: Select endpoint, token, workspace with a value, override with a flag#618
razor-x merged 1 commit into
mainfrom
claude/rename-server-to-endpoint-jcwv9n

Conversation

@razor-x

@razor-x razor-x commented Aug 12, 2026

Copy link
Copy Markdown
Member

Setting the endpoint and the workspace was spelled differently depending on the command — select endpoint --endpoint, but login --workspace-id — and nothing scoped a single command except an environment variable. This splits the two jobs so each has one spelling.

Selecting stores

seam select endpoint https://connect.getseam.com
seam select workspace $MY_WORKSPACE

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 use seam login --workspace-id instead.

Flags override one command

--endpoint and --workspace-id are global flags on every other command. They change what that one invocation resolves to and store nothing:

# Another workspace, without switching to it
seam devices list --workspace-id $OTHER_WORKSPACE

# One command against a local instance
seam devices list --endpoint http://localhost:3020

Precedence is flag → environment variable → stored → default, so --endpoint wins over SEAM_CLI_ENDPOINT, which still wins over what is selected.

Because they never store anything, they are refused on the commands that do:

$ seam select endpoint https://x --endpoint https://y
--endpoint cannot be used with seam select endpoint: it overrides a single command rather than changing what is selected.
Run 'seam select endpoint <url>' to change what is selected.

What login does now

seam login keeps 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 how SEAM_CLI_ENDPOINT already behaved with login, now reachable as a flag.

Its own --endpoint and --workspace-id flags 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. Use seam select endpoint <url> to switch.
  • seam login --workspace-id <id> no longer leaves that workspace selected. Use seam select workspace <id>.

Notes

  • --endpoint and --workspace-id join cliFlags, 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.
  • The overrides are held in a small ambient module (lib/overrides.ts) with a setter and reset, mirroring getConfigStore/getOutput, because resolveAuth() is called without a context in four modules and the flags have to reach all of them.
  • The command path is normalized (lowercased, _-) but the positional is not, so a URL or an id is stored exactly as typed. There is an e2e test pinning that.
  • toCommandWord now stringifies its argument: minimist reads a numeric word as a number, which previously crashed on seam 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

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 razor-x changed the title Select with a value, override with a flag feat: Select endpoint, token, workspace with a value, override with a flag Aug 12, 2026
@razor-x
razor-x merged commit 25b415b into main Aug 12, 2026
14 checks passed
@razor-x
razor-x deleted the claude/rename-server-to-endpoint-jcwv9n branch August 12, 2026 04:26
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
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.

2 participants