feat(cli): surface project environment in config and doctor#93
Merged
Conversation
Users had no way to tell which project (environment) their API key is scoped to, or whether it is production. The API exposes this via GET /projects (name, slug, isProduction), so: - add src/api/projects.rs: /projects binding, response parsing, and current-project resolution (single project wins; among several, a sole default wins; ambiguity resolves to nothing rather than a guess) - steel doctor: new "Project" check after auth, fetched concurrently with the auth probe and silently skipped on error so doctor never degrades because of an informational check - steel config: print project name/slug and environment label, best effort with a 2s timeout so the command stays usable offline Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Users had no way to tell from the CLI which project (environment) their API key is scoped to, or whether it's production. The API exposes this via
GET /v1/projects(name,slug,isProduction), so this PR surfaces it in the two places users ask "where am I pointed?":steel doctor— new "Project" check after auth:Fetched concurrently with the existing auth probe (no added latency) and silently skipped on any error, so an informational check can never degrade doctor's overall status. JSON mode carries
{project_id, name, slug, is_production}in the check detail.steel config— printsproject: Default project (default)andenvironment: development. Best-effort with a 2s timeout and graceful skip (offline, local mode, or no key), so the command stays instant and usable offline.Implementation notes
src/api/projects.rsowns the/projectsbinding, response parsing, and current-project resolution: a single project wins outright; among several, a soleisDefaultwins; ambiguity resolves to nothing rather than a guess.src/api/generated.rsis untouched — the long-term home for this binding is taggingGET /projectswithx-steel-cliin the API's OpenAPI spec and regenerating.Testing
api.steel.dev:steel config,steel doctor --preflight(text +--json).🤖 Generated with Claude Code