SMOODEV-2345: th files — CLI for the org file system#177
Merged
Conversation
🦋 Changeset detectedLatest commit: 46d0f07 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
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>
5a91fd0 to
46d0f07
Compare
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
Adds
th files(andth api files) to the smooth CLI, wrapping the Smoo AI org file-system API (ADR-060 / SMOODEV-2228, shipped in the monorepo).Commands
ls [--folder],mkdir <name> [--parent],mv <file> [--to-folder] [--name],mvdir <folder> [--to-parent] [--name],rm,rmdir(root/empty → move to org root)upload <path> [--folder] [--name](presigned PUT, MIME from extension),download <id> [--out](presigned GET → local file)lock|unlock <file|folder> <id>(org-admin deletion lock)share <file|folder> <id> [--permission] [--password] [--expires-in-hours] [--max-downloads](printssmoo.ai/share/<token>),shares(list),unshare <share_id>(revoke),invite <share_id> <email>(tracked email →smoo.ai/share/recipient/<token>)Notes
reqwestclient — a presigned URL is self-authorizing and an extraAuthorizationheader makes S3 400.type Org = Option<String>alias hid theOptionfrom clap's derive, making--org-idwrongly required. NowOption<String>inline, matchingth knowledge(falls back toSMOOAI_ORG_ID→ active org).th booking/th testingpattern: exposed both top-level and underth api.Verification
cargo buildclean;cargo clippy0 errors (the# Errorsdoc warnings are pre-existing crate-wide, same asknowledge/booking).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.@smooai/smoothminor).🤖 Generated with Claude Code