Command line
tfile works with your files from a shell: for scripts, backups and AI agents. It signs in with an API token and does what the token and your account allow.
On this page
Install
Each release has one program for each system. Download the one for yours:
| System | File |
|---|---|
| Linux (x86-64) | tfile-<version>-linux-amd64 |
| Linux (ARM64) | tfile-<version>-linux-arm64 |
| macOS (Apple silicon) | tfile-<version>-macos-arm64 |
| macOS (Intel) | tfile-<version>-macos-amd64 |
| Windows (x86-64) | tfile-<version>-windows-amd64.exe |
On Linux, check the download, make it runnable and put it where your shell finds it. On macOS use shasum -a 256 -c --ignore-missing SHA256SUMS for the check.
sha256sum -c --ignore-missing SHA256SUMS
chmod +x tfile-1.5.0-linux-amd64
sudo mv tfile-1.5.0-linux-amd64 /usr/local/bin/tfile
tfile --versionOn Windows, rename the file to tfile.exe and put it in a folder listed in PATH.
Every program is built by GitHub Actions and its origin can be verified:
gh attestation verify tfile-1.5.0-linux-amd64 -R ThirtyFile/ThirtyFilexattr -d com.apple.quarantine tfile after checking the download. Windows SmartScreen may warn: choose More info › Run anyway.Sign in
Run tfile auth login. It opens your browser at an address with a code; sign in there as usual (password, two-factor, passkey or single sign-on), check that the page shows the same code, choose what tfile may do, in which folder and for how long, and approve. tfile then receives its API token. --no-browser only prints the address, to open on another device. The code works once and for ten minutes.
tfile auth login --server https://drive.example.com
tfile auth whoamiOr make an API token in the web interface under API tokens in the account menu and paste it: tfile auth login --with-token, or pipe it in. It isn't shown as you paste, and it is never given as an argument.
For scripts and servers, give the address and the token in the environment instead; nothing is saved then:
export THIRTYFILE_URL=https://drive.example.com
export THIRTYFILE_TOKEN=tft_…- The address must be
https. Only this computer (localhost) may usehttp. - A token is only sent to the address it was given with. Redirects aren't followed, and no
.envfile is read. - An app password also works, with its own limits. An API token is the safer choice.
Naming files and folders
- A path from the top:
/My files/Reports/q3.pdf. What others shared is underShared with me. - A path relative to a space:
--spaceorTHIRTYFILE_SPACEchooses it, My files otherwise..is the space itself. - An id:
id:…. Results carry ids, which stay the same when something is renamed or moved. Items in the trash are named by id.
tfile files list "/My files/Reports"
tfile files list Reports
tfile files list . --space "Team"
tfile files get id:4f2c…/ is rewritten by the shell. Use relative paths or ids, or set MSYS_NO_PATHCONV=1.Commands
Commands read like tfile files move. Find one by what you want to do, and see what it takes:
tfile cli search "move files into a folder"
tfile schema files move
tfile files move --helpCommon tasks:
tfile files list Reports
tfile files search invoice --ext pdf
tfile files download Reports/q3.pdf --output q3.pdf
tfile files upload q3.pdf summary.md Reports
tfile files upload ./photos Reports
tfile files folders create "Reports/2026"
tfile files move Reports/q3.pdf Archive
tfile files rename id:4f2c… "q3 final.pdf"
tfile files archive create Reports Archive
tfile files versions list Reports/q3.pdf
tfile files trash Reports/old.txt --force
tfile trash list
tfile trash restore id:4f2c…
tfile files text get Reports/q3.docxfiles text getreturns the text read from a document for search inside files, when an administrator turned that on: what an agent can read without downloading and opening the file.- With a token limited to a folder, relative paths start in that folder:
tfile files list .lists it. Nothing outside it can be found. files downloadsaves a folder as a ZIP file.files uploadtakes files and folders. A folder goes with everything in it, except links and empty folders. If the connection breaks, the upload goes on by itself; if the command stops, run the same command again: what already arrived isn't sent twice. This works for a week, as long as the files haven't changed.tfile mcplets AI tools work with your files over MCP: see AI agents.- The commands come from your server's description of its API, kept when you sign in. After the server is updated, run
tfile auth whoamito get new ones.
Tab completion
tfile complete prints a completion script for bash, zsh, fish, PowerShell or elvish, with the commands of the server you signed in to. Load it from your shell's start-up file, and make it again after the server is updated.
# bash (~/.bashrc)
source <(tfile complete bash)
# zsh (~/.zshrc)
source <(tfile complete zsh)
# fish
tfile complete fish > ~/.config/fish/completions/tfile.fish
# PowerShell ($PROFILE)
tfile complete powershell | Out-String | Invoke-Expression
Changing things safely
--dry-runshows the request and sends nothing.- A change that takes something away asks first. In a script it stops unless you add
--force. - A name that is already taken is refused. Choose with
--on-conflict keep(both stay) orreplace. --if-versionsaves new content only if the file is still the version you read (updated_at).- Long tasks are followed until they end.
--no-waitreturns at once, andtfile jobs waitfollows one later.
tfile files move Reports/q3.pdf Archive --dry-run
tfile files upload q3.pdf Reports --on-conflict keep
tfile files content update Reports/notes.txt notes.txt --if-version 1790000000An administrator's token with View administration (admin.read) reads it: tfile users list, tfile settings get, tfile logs sign-ins list, tfile usage get, tfile storage list, tfile backups list and the other commands tfile cli search finds. Such a token lasts at most 90 days, can't be limited to a folder, and stops working once the account is no longer an administrator; secrets such as passwords and keys are never in the answers. Listing what a backup or a storage location holds (tfile backups snapshots browse, tfile storage objects list) waits for your approval, as the following do. Sharing (tfile shares, access, buckets, ftp-folders), deleting for good and emptying the trash, with a token that has that access, wait for your approval in the browser: tfile prints the address and waits until you approve or refuse, then prints the result. --no-wait prints the approval at once; tfile approvals wait <id> follows it later. --force doesn't skip an approval.
With Administer (admin.users, admin.spaces, admin.storage and admin.settings) an administrator's token changes the Control panel too. What can be undone runs at once: tfile spaces create, tfile branding update, tfile storage test, tfile moves pause. The rest waits for your approval as sharing does, and the approval page names the accounts, spaces or storage locations it is about: tfile users create, tfile users update, tfile groups update, tfile settings update, tfile storage update, tfile backups policies create. What only a person does in the web interface, such as the email settings, single sign-on or adding a storage location, isn't a command: tfile cli search and tfile schema find it and say browser only and why, and typing it fails with browser_only. A field only a person sends, such as an account's password or role, is refused with browser_only_field; tfile schema lists them under browser_only_fields.
tfile users create amy --display-name "Amy Chen"
tfile cli search "change the email server"
Output and exit codes
Results are JSON on standard output; messages and errors go to standard error. A list is {"items": […], "next": …}, 50 items a page. A search comes a page at a time too.
tfile files list Reports --limit 20
tfile files list Reports --limit 20 --cursor "…"
tfile files list Reports --allAn error is {"error": {"code": …, "message": …}}, and the exit code says what kind it is:
| Exit code | Meaning |
|---|---|
0 | Success |
1 | Another failure, or you said no |
2 | Wrong command or argument |
3 | Not signed in, or the token no longer works |
4 | Not found, or not visible to your account |
5 | Not permitted |
6 | A name is taken, or something changed meanwhile |
7 | Try again later |
9 | Partly done |
10 | Needs --force |
The error's code says more than the exit code, and stays the same between releases. The common ones:
| Code | Exit code | Meaning |
|---|---|---|
name_taken | 6 | An item with that name is already there |
version_conflict | 6 | The file changed since the version given with --if-version |
not_empty | 6 | The folder isn't empty |
busy | 7 | The item is still being changed |
space_moving | 7 | The space is being moved to another storage location |
storage_unavailable | 7 | The disk or storage service doesn't answer |
read_only | 5 | The space is read-only |
token_permission | 5 | The API token lacks the permission |
token_folder | 5 | The token is limited to a folder: outside it, or the folder itself |
token_folder_gone | 3 | The token's folder is gone, or the account can no longer open it |
token_not_admin | 3 | The token is for administration, and its account is no longer an administrator |
browser_only | 5 | Only a person does this, in the web interface |
browser_only_field | 5 | A field only a person sends, in the web interface (a password, a role, a credential) |
approval_refused | 5 | Refused in the browser: nothing changed |
approval_expired | 7 | Nobody approved it within ten minutes |
approval_failed | 1 | Approved, but it didn't run (something it names changed meanwhile) |
too_many_approvals | 7 | Five approvals of this token are waiting already |
too_many_items | 2 | More items than one request takes |
content_search_off | 6 | Search inside files is off |
Profiles
A profile keeps a server and a token. Use several for several servers or tokens, and tie one to a folder:
tfile auth create work --server https://drive.example.com
tfile auth activate work ~/projects/reports
tfile auth list
tfile files list --profile work- A command uses, in this order:
THIRTYFILE_TOKENwithTHIRTYFILE_URL,--profile,THIRTYFILE_PROFILE, the profile of the current folder, the default one. - Profiles are kept in
~/.config/tfile(Linux),~/Library/Application Support/tfile(macOS) or%APPDATA%\tfile(Windows);THIRTYFILE_CONFIG_DIRchanges it. The token is in a file only your user can read, without encryption, unless you sign in with--use-keyring. tfile auth login --use-keyringkeeps the token in the system's keychain instead: the Keychain on macOS, the Credential Manager on Windows, and on Linux the Secret Service (GNOME Keyring, KWallet) through thesecret-toolprogram (packagelibsecret-tools). Later sign-ins keep it there;--no-use-keyringmoves it back to the file.tfile auth whoamisays where it is.tfile auth logoutstops an API token on the server and forgets it on this computer. An app password is only forgotten here: remove it in the web interface.
Single-user mode
In single-user mode there are no tokens:
tfile auth login --server http://localhost:8080 --no-tokenTHIRTYFILE_KEEP_HISTORY=false there is no trash: tfile files trash deletes for good.