Skip to content

feat: tab completion, command cleanup, presign --key, fork rework#27

Merged
designcode merged 7 commits into
mainfrom
feat/auto-complete
May 21, 2026
Merged

feat: tab completion, command cleanup, presign --key, fork rework#27
designcode merged 7 commits into
mainfrom
feat/auto-complete

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented May 21, 2026

Summary

  • Tab-complete commands (REPL + custom + just-bash built-ins), bucket names, mount points, and filesystem paths inside the virtual FS.
  • New src/commands/args.ts helper with argError / sdkError / parseFlags — used by all custom commands so error formatting is consistent and unknown options / missing values are rejected up front.
  • Tighten parsers for presign, snapshot, fork: reject unknown flags / extra positionals, validate --expires, forbid conflicting flags, distinguish missing source vs missing name.
  • Print No snapshots. / No forks. (instead of silent output) when listings are empty.
  • Merge forks into fork --list.
  • presign --key <accessKeyId> — wins over config.accessKeyId; required when logged in via login (no access key in session). Passed via GetPresignedUrlOptions.accessKeyId.
  • snapshot [<bucket>] and fork [<source-bucket>] — bucket positional is now optional; falls back to the cwd's mounted bucket.
  • fork reshape: <fork-name> positional becomes --name <fork-name> flag. New shape:
    fork [<source>] --name <name> [--snapshot V]   # create
    fork [<source>] --list                         # list
    
  • Fix: disable just-bash v3's default defenseInDepth. It was blocking the Tigris/AWS SDK's process.env reads inside TigrisAdapter, so ls inside a mounted bucket threw a SecurityViolationError.
  • .gitignore: ignore .claude/ so local Claude Code session files don't trip the pre-commit biome hook.

161 tests, all passing.

Test plan

  • ls works inside a mounted bucket (was failing on feat/auto-complete before the defense-in-depth fix).
  • Tab completion: type a partial command (pres<TAB>, gr<TAB>), a partial bucket (mount my<TAB>), and a partial path (ls /work<TAB>).
  • presign /file.txt works after configure; errors with a usage message after login until you pass --key tid_xxx.
  • Inside a mounted bucket: snapshot, snapshot --list, fork --name newbucket, fork --list all work without naming the bucket.
  • Outside a mount: same commands error with (cwd not in a mounted bucket).

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk due to upgrading core deps (just-bash, @tigrisdata/storage) and disabling just-bash defenseInDepth, which changes runtime sandboxing behavior and could affect execution/security expectations.

Overview
REPL UX: Adds async tab-completion via ReplSession.complete() and new repl/complete.ts, completing command names (REPL + custom + just-bash), bucket names, mount points, and virtual-FS paths.

Command cleanup: Introduces commands/args.ts (parseFlags, argError, sdkError) and refactors presign, snapshot, and fork to reject unknown flags/extra positionals, validate values, and format errors consistently. presign now supports --key (required for OAuth sessions) and passes accessKeyId to getPresignedUrl; snapshot/fork can omit the bucket/source and fall back to the cwd mount, and empty listings now print No snapshots. / No forks..

Fork rework: Removes the separate forks command and replaces listing with fork --list; creation now uses fork [<source>] --name <fork> [--snapshot …] and uses SDK listForks.

Runtime/tooling: Disables just-bash defenseInDepth in TigrisShell to avoid SDK process.env blocking, bumps multiple deps (notably just-bash v3, @tigrisdata/storage), and updates ignores/lint config to exclude .claude/. Tests are expanded substantially to cover new parsing and completion behavior.

Reviewed by Cursor Bugbot for commit 8eb642a. Bugbot is set up for automated code reviews on this repo. Configure here.

designcode and others added 7 commits May 21, 2026 14:32
Adds a position-aware completer covering built-in bash commands
(via just-bash's getCommandNames), REPL + custom commands, bucket
names for mount/snapshot/fork/forks, mount points for umount/flush,
and filesystem paths inside the virtual FS.

Also ignore .claude/ session files so they don't trip the
pre-commit biome check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add src/commands/args.ts with argError/sdkError/parseFlags helpers
  so error formatting is consistent and unknown options / missing
  values are rejected up front.
- Tighten presign, snapshot, fork parsers: reject unknown flags and
  extra positional args, validate --expires as a positive integer,
  forbid --name+--list, distinguish missing source vs missing name,
  reject source == name.
- Print 'No snapshots.' / 'No forks.' on stdout when listings are
  empty (matching df's pattern), instead of silent output.
- Merge the standalone 'forks' command into 'fork --list'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
just-bash v3 enabled defense-in-depth by default, which blocks
process.env reads during script execution. The Tigris/AWS SDK reads
env (e.g. AWS_PROFILE) inside TigrisAdapter, so ls inside a mounted
bucket threw a SecurityViolationError. We don't enable js-exec /
python / node, so the sandbox provides no value in our setup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- presign: add --key flag. Wins over config.accessKeyId when both
  exist, required when logged in via 'login' (no access key in
  session). Passed to GetPresignedUrlOptions.accessKeyId so the
  URL signer is whatever the user names.
- snapshot: <bucket> is now optional; falls back to the cwd's
  mounted bucket via the shell's resolveBucket helper.
- fork: same cwd fallback for <source-bucket>; the previous
  <fork-name> positional becomes a --name flag, so the shape is
  fork [<source>] --name <name> [--snapshot V] for create and
  fork [<source>] --list for listing.

Help text and tests updated to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@designcode designcode merged commit b93e7e2 into main May 21, 2026
3 checks passed
@designcode designcode deleted the feat/auto-complete branch May 21, 2026 15:00
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants