feat: Use Seam CLI adapter to store state - #7
Merged
Conversation
This was referenced Aug 12, 2026
The wizard reached into the Seam CLI's cli.json for the developer's login, re-derived the CLI's paths with its own copy of env-paths, and reimplemented its auth precedence. It also adopted whatever SEAM_API_KEY it found without recording anything, so it could not tell a project set up against one workspace from the same project now pointed at another. It now asks its adapter for both, which leaves three states. Nothing recorded, and the developer chooses, with what the environment already holds offered first. Recorded and still matching, and the run carries on without a question. Recorded and not matching, and what moved is named and the developer says which side is right. The key is never recorded, only a digest to compare it and the last four characters to recognize it by. .seam/onboarding.json is gone: a run is local to whoever ran it. What the team needs is written into the project instead — the key in .env, the variable in .env.example, and .env in .gitignore. @seamapi/cli is a devDependency, so npm run wizard runs this wizard as `seam wizard` through the real CLI, which hands it a real adapter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
razor-x
force-pushed
the
claude/wizard-file-store-cli-4njgxv
branch
from
August 12, 2026 05:09
1610147 to
656aeae
Compare
The dev entry ran `seam wizard` and nothing else, so testing how the wizard sits alongside the rest of the CLI — logging in, selecting a workspace — meant leaving the repository. It now passes through whatever it is given: npm run seam -- login npm run seam -- devices list npm run wizard -- --cwd <project> All of them the CLI from devDependencies, with @seamapi/wizard pointed at this checkout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
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.
Summary
The wizard reached into the Seam CLI's
cli.jsonfor the developer's login, re-derived the CLI's XDG paths with its own copy ofenv-paths, and reimplemented its auth precedence — two codebases agreeing by coincidence. And it adopted whateverSEAM_API_KEYit found without recording anything, so it could not tell a project set up against one workspace from the same project now pointed at another.WizardAdapterarrived in #11 and0.7.0. This is what puts it to use. The Seam CLI implements it as of@seamapi/cli@0.23.0.What it asks the adapter for
cli.json—cli-auth.tsand its copies of the CLI's paths and precedence are gone, along with theconfigstoreandenv-pathsdependencies. The hand-rolledseam_at/seam_cstprefix matching goes too: an adapter that knows what an API key is says so..seam/onboarding.json— a run is local to whoever ran it, so it does not belong in someone's repository.What the whole team needs is written into the project instead: the key in
.env, the variable in.env.example, and.envadded to.gitignore.What a project connects with
The wizard records what a project was set up to talk to — endpoint, workspace, and a fingerprint of the key — leaving three states, of which only the last asks a question:
The key itself is never recorded — only a digest to compare and the last four characters to recognize it by. Enough to notice a key changing, not enough to use one, which is why the second option asks for a key rather than putting the old one back.
Changed
lib/steps/connection.ts— comparing what a project was set up with against what its environment says now, as a pure function over a record.lib/util/api-key.ts— the fingerprint.lib/store/— the record (connection/plan/result), and the remembered SDK, read and written through the adapter.lib/app.tsx— the three states and the prompts for each. The record is written when the connection settles rather than only when the agent runs, since that is what a later run reads.@seamapi/clias a devDependency —npm run wizardruns this wizard asseam wizardthrough the real CLI, which now hands it a real adapter.Verified
Driven through the published CLI, with the dev entry's own resolution:
117 tests, including every state transition and that no record ever contains a key.
Not done here
The README documents the wizard as it was, so this flow is undocumented.