使用指南

简体中文

快速开始

# 发送文件:密码自动生成,打印链接和密码
$ ttl send secret.pdf
No password provided. Generate one? [Y/n]:
Generated password: aB3kL9mXq7Rt
·✧★◉ Thank goodness, secret.pdf is in orbit (1.2 MB, expires 2026-10-08 12:00)
Keep your password somewhere safe. We can't see or recover it, and the file can't be opened without it.
Password: aB3kL9mXq7Rt
Manage key: k7Qm2vXpL9aR4tB8cD1eF6gH3jK5mN0oP2qS4uV7wYz (ttl status / ttl delete -k)
SHA-256: 8fa66ff10c5b1474ea1ade90a21ee9bebf6fae1ea62f8ac9bc1e58759d518f70
Link with password: https://ttlspaceusercontent.com/aBcDeFgHiJ#p=aB3kL9mXq7Rt
https://ttlspaceusercontent.com/aBcDeFgHiJ

# 下载:交互式提示输入密码
$ ttl get https://ttlspaceusercontent.com/aBcDeFgHiJ
Enter password: ********
Password verified
◉★✧· Phew, secret.pdf landed safe and sound (1.2 MB)
SHA-256: 8fa66ff10c5b1474ea1ade90a21ee9bebf6fae1ea62f8ac9bc1e58759d518f70
✓ Same as the sender's fingerprint

# 用带密码的链接下载:无需输入密码
$ ttl get 'https://ttlspaceusercontent.com/aBcDeFgHiJ#p=aB3kL9mXq7Rt'
Password verified

CLI 自动处理加密、上传、下载和解密。服务器永远看不到您的密码或明文数据。

安装

Homebrew (macOS)

$ brew install --cask tweenietomatoes/ttl/ttl

winget (Windows)

$ winget install tweenietomatoes.ttl

Scoop (Windows)

$ scoop bucket add ttl https://github.com/tweenietomatoes/scoop-ttl
$ scoop install ttl

Debian / Ubuntu (apt)

# 软件包名为 ttl-space,安装的命令是 ttl
$ sudo install -d -m 0755 /etc/apt/keyrings
$ sudo curl -fsSL -o /etc/apt/keyrings/ttl-archive-keyring.gpg https://pkg.ttl.space/ttl-archive-keyring.gpg
$ sudo curl -fsSL -o /etc/apt/sources.list.d/ttl.sources https://pkg.ttl.space/ttl.sources
$ sudo apt update && sudo apt install ttl-space

Fedora / RHEL (dnf)

$ sudo curl -fsSL -o /etc/yum.repos.d/ttl.repo https://pkg.ttl.space/rpm/ttl.repo
$ sudo dnf install ttl-space

openSUSE (zypper)

$ sudo zypper addrepo https://pkg.ttl.space/rpm/ttl.repo
$ sudo zypper refresh && sudo zypper install ttl-space

Linux, macOS, BSD (curl)

$ curl -fsSL https://pkg.ttl.space/install.sh | sh

预编译二进制文件

# 从发布页面下载适合您平台的版本
$ curl -Lo ttl.tar.gz \
  https://github.com/tweenietomatoes/ttl/releases/download/v1.6.5/ttl_1.6.5_linux_amd64.tar.gz
$ tar xzf ttl.tar.gz && sudo mv ttl /usr/local/bin/

Go install

$ go install github.com/tweenietomatoes/ttl/cmd/ttl@latest

从源码编译

$ git clone https://github.com/tweenietomatoes/ttl
$ cd ttl && go build -o ttl ./cmd/ttl/
$ sudo mv ttl /usr/local/bin/

验证

$ ttl version
ttl 1.6.5

发送文件

基本发送

# 自动生成密码,默认 7 天 TTL
$ ttl send report.xlsx

在终端中未提供密码时,CLI 会询问:

No password provided. Generate one? [Y/n]:

按 Enter 或输入 y 自动生成。

自定义密码

$ ttl send -p mySecretPass -t 1h document.pdf

阅后即焚

# 下载后即删除;中断的下载可以继续,文件不会被用掉
$ ttl send -b photo.jpg

自定义 TTL

$ ttl send -t 5m temp-credentials.txt   # 5 分钟后过期
$ ttl send -t 30m meeting-link.txt      # 30 分钟后过期
$ ttl send -t 6h backup.tar.gz          # 6 小时后过期
$ ttl send -t 1d daily-report.pdf       # 1 天后过期
$ ttl send -t 3d project-archive.zip    # 3 天后过期
$ ttl send -t 5d design-assets.zip      # 5 天后过期
$ ttl send report.xlsx                  # 7 天后过期(默认)

大文件

不超过 16 MiB 的文件通过一次请求发送;更大的文件则分成可续传的 16 MiB 分块,每次并行发送两块。每个请求都会用 SHA-256 摘要校验,传输中失败的请求会重新发送,已发送的分块会保留。按 Ctrl+C 可干净地取消。

下载文件

交互式(终端)

$ ttl get https://ttlspaceusercontent.com/aBcDeFgHiJ
Enter password: ********
Password verified
◉★✧· Phew, document.pdf landed safe and sound (4.2 MB)
SHA-256: 3b1f0c5e9a7d2468ace13579bdf02468ace13579bdf02468ace13579bdf02468
✓ Same as the sender's fingerprint

密码不会显示在终端中。原始文件名会被保留;如果输出目录中已存在同名文件,则不会覆盖它,而是保存为 name (1).ext。

仅使用令牌

# 可以只使用 10 位令牌,无需完整 URL
$ ttl get aBcDeFgHiJ

输出目录

$ ttl get -o ~/Downloads aBcDeFgHiJ

默认情况下,文件保存到当前目录。使用 -o / --output 指定其他目录。

使用密码参数

$ ttl get -p mySecretPass https://ttlspaceusercontent.com/aBcDeFgHiJ

中断的下载

中断的下载会从最后收到的字节处继续;每个 64 KiB 数据块都会单独验证,因此结果与未中断的传输完全相同。阅后即焚(一次性)文件只有在某次下载将其完整取回后才会被用掉:中途断开的下载会从停止处继续,文件仍会保留,可以再次尝试。

浏览器

您也可以通过直接访问链接在浏览器中下载和解密文件。Web 界面使用相同的文件格式和算法(Argon2id、XChaCha20-Poly1305),并提示输入密码。无需安装任何软件。

管理密钥

每次上传都附带一个管理密钥,由 ttl send 打印一次(在 --json 中为 manage_key)。服务器只保存它的哈希值。无论使用哪种计划,您都可以用它查看上传的状态或提前结束上传;任何持有该密钥的人都可以删除这次上传,因此请像保管密码一样妥善保管它。

# 查看您自己上传的状态、下载次数和过期时间
$ ttl status aBcDeFgHiJ -k k7Qm2vXpL9aR4tB8cD1eF6gH3jK5mN0oP2qS4uV7wYz
Token:      aBcDeFgHiJ
State:      active
Size:       4.2 MB
Created:    2026-10-01 12:00
Expires:    2026-10-08 12:00
Downloads:  1 (last 2026-10-02 09:12)

# 提前删除
$ ttl delete aBcDeFgHiJ -k k7Qm2vXpL9aR4tB8cD1eF6gH3jK5mN0oP2qS4uV7wYz
Deleted: aBcDeFgHiJ

状态为 active、expired、burned 或 deleted 之一。

密码管理

密码是加密密钥的种子。它永远不会离开您的设备,也永远不会发送到服务器。有六种方式提供密码:

1. 自动生成(仅发送时)

$ ttl send notes.txt
No password provided. Generate one? [Y/n]: y
Generated password: aB3kL9mXq7Rt

从 [0-9A-Za-z] 字符集生成加密安全的 12 位随机密码。仅在执行 send 时可用(交互式,或在 --json 模式下自动生成)。

2. 交互式提示

$ ttl send notes.txt
No password provided. Generate one? [Y/n]: n
Enter password: ********
Confirm password: ********

$ ttl get https://ttlspaceusercontent.com/aBcDeFgHiJ
Enter password: ********

密码不会回显到终端。send 时会先询问是否自动生成;如果您自行输入密码,需要再次确认。get 时直接提示输入。

3. 参数:-p / --password

$ ttl send -p mySecretPass file.zip
$ ttl get --password mySecretPass https://ttlspaceusercontent.com/aBcDeFgHiJ
-p / --password 在 ps aux 输出中可见,且可能保存在 shell 历史记录(~/.bash_history)中。在共享环境和脚本中请避免使用。请改用 --password-stdin 或 --password-file。

4. 标准输入:--password-stdin

# 通过 echo 管道传递
$ echo "mySecretPass" | ttl send --password-stdin backup.tar.gz

# 从密码管理器管道传递
$ pass show ttl/key | ttl send --password-stdin data.zip

# 从环境变量管道传递
$ printenv MY_SECRET | ttl get --password-stdin https://ttlspaceusercontent.com/aBcDeFgHiJ

# here-string
$ ttl send --password-stdin report.pdf <<<"mySecretPass"

从标准输入读取第一行。适用于脚本、CI/CD 流水线和自动化。当标准输入不是终端且未提供密码来源时,CLI 会报错退出(除非使用 --json,此时会自动生成密码)。

5. 文件:--password-file

$ ttl send --password-file /run/secrets/key report.xlsx
$ ttl get --password-file ~/.ttl-key https://ttlspaceusercontent.com/aBcDeFgHiJ

读取文件的第一行(末尾换行符会被去除)。兼容 Docker secrets(/run/secrets/)、Vault agent 文件及类似模式。

6. 自动检测文件:ttl.password

如果未显式提供密码,CLI 会先查找可执行文件旁的 ttl.password 文件,然后查找 ~/.ttl/password。第一行将用作密码。

同一时间只能使用一个显式密码来源。-p / --password、--password-stdin 和 --password-file 不能同时使用。自动检测的 ttl.password 文件仅在以上选项均未提供时才会被检查。密码最小长度为 8 个字符。

选项参考

发送参数

参数说明默认值
-p, --password P加密密码交互式
--password-stdin从标准输入读取密码
--password-file F从文件读取密码
-t, --ttl 时长存活时间7d
-b, --burn阅后即焚(仅限一次下载)关闭
-u, --uploader-only仅您的账户可以下载:账户页面或其任一 API 密钥(Orbit;别名 --private)关闭
--timeout 时长传输超时无
--server URL服务器 URLhttps://ttl.space
-h3, --http3尝试 HTTP/3 (QUIC),回退到 TCP关闭
--json将 JSON 输出到 stdout(用于脚本和 AI 代理)关闭

下载参数

参数说明默认值
-p, --password P解密密码交互式
--password-stdin从标准输入读取密码
--password-file F从文件读取密码
-o, --output DIR输出目录当前目录
--timeout 时长传输超时无
--server URL仅使用令牌时所用的服务器https://ttl.space
-h3, --http3尝试 HTTP/3 (QUIC),回退到 TCP关闭
--json将 JSON 输出到 stdout(用于脚本和 AI 代理)关闭

TTL 值

免费版:5m 10m 15m 30m 1h 2h 3h 6h 12h 24h 1d 2d 3d 4d 5d 6d 7d

Orbit 额外支持:14d 15d 28d 30d permanent

超时

默认:无。停滞的传输会自动恢复,无法继续时才会放弃。如需设置上限,可使用 --timeout 30m 或 --timeout 2h。

示例

脚本:备份并上传

#!/bin/bash
tar czf /tmp/backup.tar.gz /data
echo "$BACKUP_KEY" | ttl send --password-stdin -t 6h /tmp/backup.tar.gz
rm /tmp/backup.tar.gz

复制链接到剪贴板(macOS)

$ ttl send -p mypass123 file.pdf | pbcopy

复制链接到剪贴板(Linux)

$ ttl send -p mypass123 file.pdf | xclip -sel clip

阅后即焚:一次性机密信息

$ echo "$DB_PASSWORD" | ttl send --password-stdin -b -t 5m credentials.env
# 链接仅可使用一次,5 分钟后过期

JSON 模式(脚本和 AI 代理)

# 发送:JSON 模式下密码自动生成
$ ttl --json send report.pdf
{"ok":true,"link":"https://ttlspaceusercontent.com/xK9mQ2vLpA","token":"xK9mQ2vLpA","filename":"report.pdf","size":2097152,"ttl":"7d","expires_in":604800,"expires_at":1760011200,"burn":false,"uploader_only":false,"is_permanent":false,"manage_key":"k7Qm2vXpL9aR4tB8cD1eF6gH3jK5mN0oP2qS4uV7wYz","sha256":"8fa66ff10c5b1474ea1ade90a21ee9bebf6fae1ea62f8ac9bc1e58759d518f70","daily_bytes_remaining":6440353792,"password":"aB3kL9mXq7Rt","link_with_password":"https://ttlspaceusercontent.com/xK9mQ2vLpA#p=aB3kL9mXq7Rt"}

# 下载
$ ttl --json get -p aB3kL9mXq7Rt xK9mQ2vLpA
{"ok":true,"token":"xK9mQ2vLpA","filename":"report.pdf","size":2097152,"saved_to":"/home/user/report.pdf","sha256":"8fa66ff10c5b1474ea1ade90a21ee9bebf6fae1ea62f8ac9bc1e58759d518f70","same_as_sender":true}

# 使用管理密钥查看状态
$ ttl --json status xK9mQ2vLpA -k k7Qm2vXpL9aR4tB8cD1eF6gH3jK5mN0oP2qS4uV7wYz
{"ok":true,"token":"xK9mQ2vLpA","status":{"state":"active","size_bytes":2097152,"created_at":1759406400,"expires_at":1760011200,"permanent":false,"burn":false,"note":false,"uploader_only":false,"downloads":1,"last_download_at":1759492800,"part_reads":0,"last_part_at":0}}

# 错误返回 ok:false
{"ok":false,"error":"Link not found. The file may have expired, been downloaded already (burn after reading), or be private (uploader-only)"}

在 --json 模式下,所有输出都是结构化 JSON 并输出到 stdout。发送时如果未提供密码,将自动生成并包含在响应中。退出码:成功为 0,错误为 1。

Orbit 计划

Orbit 解锁更大文件(50 GB)、更长保留期(30 天,订阅用户可永久)、账户专属文件(只有您的账户可以下载)和文件管理(列出和删除)。完整对比:功能。

API 密钥自动检测来源:TTL_API_KEY 环境变量、可执行文件旁的 ttl.key 或 ~/.ttl/key。使用 ttl activate 保存密钥,或手动写入上述位置。

# 激活您的密钥:输入时不回显,因此不会留在 shell 历史记录中
$ ttl activate
Enter Orbit API key: ********
Orbit plan activated. Key saved to /usr/local/bin/ttl.key
# 非交互式:ttl activate --key-stdin  |  ttl activate --key-file F

# 查看计划和用量
$ ttl plan
Plan: orbit
Max file size: 50.0 GB
Max TTL: 30 days (or permanent)
Uploads per day: 1000000
Storage quota: 1024.0 GB

Usage:
  Uploads today: 3
  Active storage: 1.2 GB / 1024.0 GB

# 使用延长的 TTL 发送
$ ttl send -t 30d large-backup.tar.gz
# 永久文件(仅限 Orbit):无过期时间,一直保留,直到您删除它或订阅结束
$ ttl send -t permanent archive.tar.gz
# 发送私密文件:仅您的账户可以下载(仅限 Orbit)
$ ttl send -u payroll.xlsx

# 列出最近上传的文件
$ ttl list
  xK9mQ2vLpA    4.2 MB  2026-03-16 10:30 → 2026-04-15 10:30  [active]
  https://ttlspaceusercontent.com/xK9mQ2vLpA
  rT7bNw3KpF  912.0 KB  2026-03-15 14:20 → 2026-03-17 14:20  [active (burn)]
  https://ttlspaceusercontent.com/rT7bNw3KpF

# 提前删除文件(ttl list 会遍历所有页;-n 5 在列出五个文件后停止)
$ ttl delete xK9mQ2vLpA
Deleted: xK9mQ2vLpA
# 或使用该上传的管理密钥(任何计划均可):ttl delete xK9mQ2vLpA -k KEY

# 移除已保存的密钥
$ ttl deactivate
Key file removed: /usr/local/bin/ttl.key

HTTP API

上传和下载需要 CLI 的加密管线(Argon2id + XChaCha20-Poly1305 + 分块 AEAD)。脚本请使用 ttl send / ttl get 或 --json 模式。以下端点用于 Orbit 文件管理。

列出文件(Orbit)

$ curl https://ttl.space/v1/files -H "X-API-Key: ttl_orbit_..."
{"files":[{"token":"xK9mQ2vLpA","link":"https://ttlspaceusercontent.com/xK9mQ2vLpA","size_bytes":1048576,"created_at":1711800600,"expires_at":1714392600,"burn":false,"expired":false,"uploader_only":false,"is_permanent":false,"is_note":false,"perm_grace_until":0}],"has_more":false}

# 下一页:仅当 has_more 为 true 时使用;传入上一次响应中的 next_cursor
$ curl "https://ttl.space/v1/files?cursor=1711800600123456" -H "X-API-Key: ttl_orbit_..."

返回使用该密钥上传的文件,按从新到旧排列,每页 20 个。当 has_more 为 true 时,响应中还会包含 next_cursor;将其作为 ?cursor= 传入即可获取下一页。需要 Orbit 计划。

删除文件(Orbit)

$ curl -X DELETE https://ttl.space/v1/files/xK9mQ2vLpA -H "X-API-Key: ttl_orbit_..."

成功时返回 204 No Content。需要 Orbit 计划。文件必须属于该密钥。

错误响应

状态码含义
401无效或已过期的 API 密钥
403该功能需要 Orbit 计划
404文件未找到或不属于该密钥
429请求频率超限
500服务器内部错误,请稍后重试
502存储暂时不可用,请稍后重试

限制

限制项免费版Orbit
最大文件大小6 GB50 GB
最大 TTL7 天30 天或永久
每日上传次数4无限制
每日上传流量(每 IP)6 GB无限制
并发上传每 IP 2 个每个 API 密钥 4 个
存储配额✗1 TB
文件列表✗✓
提前删除✓✓
仅上传者可下载的文件✗✓
最短密码长度8 个字符
每 IP 请求数每 10 秒 300 次
每 IP 连接数100 个并发

加密

文件在上传前在您的设备上加密。服务器仅存储密文,无法解密您的文件。

组件算法 / 值
密钥派生Argon2id (time=3, memory=64 MiB, parallelism=1)
密码算法XChaCha20-Poly1305 AEAD

对密文的任何修改都会导致解密失败。服务器在释放密文前,会使用从加密密钥派生的单向令牌验证下载者是否知道正确的密码。