Skip to content

SMOODEV-2345: th files — CLI for the org file system#177

Merged
brentrager merged 1 commit into
mainfrom
SMOODEV-2345-files-cli
Jul 6, 2026
Merged

SMOODEV-2345: th files — CLI for the org file system#177
brentrager merged 1 commit into
mainfrom
SMOODEV-2345-files-cli

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

What

Adds th files (and th api files) to the smooth CLI, wrapping the Smoo AI org file-system API (ADR-060 / SMOODEV-2228, shipped in the monorepo).

Commands

  • Browse/CRUD: ls [--folder], mkdir <name> [--parent], mv <file> [--to-folder] [--name], mvdir <folder> [--to-parent] [--name], rm, rmdir (root/empty → move to org root)
  • Transfer: upload <path> [--folder] [--name] (presigned PUT, MIME from extension), download <id> [--out] (presigned GET → local file)
  • Locks: lock|unlock <file|folder> <id> (org-admin deletion lock)
  • Shares: share <file|folder> <id> [--permission] [--password] [--expires-in-hours] [--max-downloads] (prints smoo.ai/share/<token>), shares (list), unshare <share_id> (revoke), invite <share_id> <email> (tracked email → smoo.ai/share/recipient/<token>)

Notes

  • Presigned upload/download hit S3 with a bearer-less reqwest client — a presigned URL is self-authorizing and an extra Authorization header makes S3 400.
  • Fixed a bug found while wiring: a type Org = Option<String> alias hid the Option from clap's derive, making --org-id wrongly required. Now Option<String> inline, matching th knowledge (falls back to SMOOAI_ORG_ID → active org).
  • Follows the th booking/th testing pattern: exposed both top-level and under th api.

Verification

  • cargo build clean; cargo clippy 0 errors (the # Errors doc warnings are pre-existing crate-wide, same as knowledge/booking).
  • 4 unit tests pass: guess_mime (incl. case-insensitive + unknown→octet-stream), dest_folder_value (root/empty→null), find_file_name.
  • th files --help + subcommand help render correctly against the built binary.
  • Changeset added (@smooai/smooth minor).

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 46d0f07

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager brentrager enabled auto-merge (squash) July 6, 2026 03:24
Adds `th files` (and `th api files`) wrapping the org file-system API:
ls/mkdir/upload/download/mv/mvdir/rm/rmdir, admin deletion lock/unlock,
and shares (anonymous link + tracked email invite, revoke, list).

Presigned upload/download go straight to S3 with a bearer-less client
(an extra Authorization header makes S3 400); MIME inferred from the
extension. Pure helpers (guess_mime, dest_folder_value, find_file_name)
have unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brentrager brentrager force-pushed the SMOODEV-2345-files-cli branch from 5a91fd0 to 46d0f07 Compare July 6, 2026 03:29
@brentrager brentrager merged commit 75d97b5 into main Jul 6, 2026
2 checks passed
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.

1 participant