feat(project): experimental project setup command (RFC / discussion)#109
Open
Xe wants to merge 1 commit into
Open
feat(project): experimental project setup command (RFC / discussion)#109Xe wants to merge 1 commit into
project setup command (RFC / discussion)#109Xe wants to merge 1 commit into
Conversation
Add a zero-config `tigris project setup` (t3) that wires a project to
Tigris in one command, as an RFC/experiment in prompt-guided setup:
1. Auth — pops the browser via the OAuth device flow when not logged
in; respects existing credentials otherwise.
2. Bucket — creates a randomly named color-adjective-animal bucket
(unique-names-generator), overridable with --bucket.
3. Access key — mints <bucket>-key and assigns it the Editor role
scoped to that bucket.
4. .env — writes TIGRIS_STORAGE_{ACCESS_KEY_ID,SECRET_ACCESS_KEY,
ENDPOINT,BUCKET} (mode 0600) for @tigrisdata/storage. Detects an
existing .env early and aborts unless --force.
5. npm packages — installs @tigrisdata/storage and @tigrisdata/agent-kit
into the project (--skip-install to opt out).
6. Agent skills — fetches the tigrisdata/skills tarball and installs the
Tigris storage skills into .agents/skills, with relative per-skill
symlinks in .claude/skills (--skip-agent-setup to opt out).
If bucket/key creation fails partway, the bucket is rolled back so a
retry isn't blocked. The npm and skills steps are best-effort: failures
are reported but never abort setup. Since installed skills don't load in
the running agent session, setup advises starting a fresh one.
Assisted-by: Claude Opus 4.8 via Claude Code
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9cb70c7. Configure here.
| writeFileSync(envPath, envContents, { mode: 0o600 }); | ||
| } catch (err) { | ||
| await rollbackBucket(); | ||
| return failWithError(context, err); |
There was a problem hiding this comment.
Rollback omits created access key
Medium Severity
After a successful createAccessKey, failure paths only call rollbackBucket and never delete the new key. The leftover ${bucketName}-key can block a retry with the same --bucket name, and leaves an orphaned credential if .env write fails after the secret was only in memory.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9cb70c7. Configure here.
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.


What this is
An experiment in a prompt-guided, zero-config setup flow for getting a project wired to Tigris in one command. It's opened as a draft PR to foster discussion — not a finished, ship-ready feature. The goal is to get eyes on the UX and the agent-resource bits and decide what (if anything) we want to keep.
tigris project setupRuns the whole onboarding flow end-to-end:
color-adjective-animalbucket (viaunique-names-generator), or--bucket <name>.<bucket>-keyand assigns it the Editor role scoped to that bucket.TIGRIS_STORAGE_{ACCESS_KEY_ID,SECRET_ACCESS_KEY,ENDPOINT,BUCKET}(mode0600) for@tigrisdata/storage. Detects an existing.envearly and aborts ("already set up") unless--force.npm install @tigrisdata/storage @tigrisdata/agent-kitin the project.--skip-installopts out.tigrisdata/skillstarball and installs the Tigris storage skills into.agents/skills/, with relative per-skill symlinks in.claude/skills/(won't clobber existing real dirs).--skip-agent-setupopts out.If bucket/key creation fails partway, the bucket is rolled back so a retry isn't blocked. The npm and skills steps are best-effort: a missing
npm/tar, no network, or a failed install is reported but never aborts setup.Because installed skills don't take effect in the agent session that launched setup, the command advises starting a fresh agent session to adapt the app to Tigris. (Earlier revisions optionally installed the Claude Code plugin under
CLAUDECODE; that path was dropped — installing a plugin mutates global config and can't take effect in the same session, so setup always installs skills instead.)Open questions for discussion
project setupthe right call, or should those be their own commands?.agents/skills+.claude/skillssymlink layout.npm install) be opt-in rather than opt-out?Testing
npm run build(tsc + tsup),npm test(727 passing / 187 skipped),npm run lint,npm run format:check— all clean.npm run updatedocs..agents/skills+ resolving.claude/skillssymlinks).Assisted-by: Claude Opus 4.8 via Claude Code
Note
Medium Risk
Creates real buckets and access keys in the user's org and writes secrets to disk; npm/tarball fetch and symlink writes are opt-out side effects on the local project.
Overview
Adds a new
tigris projectcommand group withproject setup, a one-shot onboarding flow that provisions cloud resources, writes local config, and optionally prepares the repo for app and agent use.tigris project setupruns auth (OAuth if needed), creates a bucket (randomcolor-adjective-animalname or--bucket), mints an Editor-scoped access key, and writes a mode-0600.envwithTIGRIS_STORAGE_*vars. It stops early if.envalready exists unless--force. Failed key/IAM steps trigger bucket rollback so retries are not blocked.By default it also runs best-effort
npm installfor@tigrisdata/storageand@tigrisdata/agent-kit(--skip-install), and downloads Tigris storage skills from GitHub into.agents/skillswith symlinks under.claude/skills(--skip-agent-setup). Those side effects never fail the core setup.Docs/specs/README are updated;
unique-names-generatoris added for default bucket names. Vitest coverage covers setup orchestration, npm install, and skill install behavior.Reviewed by Cursor Bugbot for commit 9cb70c7. Bugbot is set up for automated code reviews on this repo. Configure here.