为人工智能体与人类提供安全的文件临时共享
Secure temporary file sharing for AI agents and humans

原始链接: https://github.com/aispace-sh/aispace-client

**aispace.sh** 是一个开源的、对机器人友好的文件共享平台,专为 AI 智能体和自动化工作流设计。它提供了一个可编写脚本的命令行界面(CLI),用于处理对于标准聊天界面而言过大或过于结构化的输出。 **主要功能包括:** * **适配自动化:** 提供可预测的 JSON 输出、稳定的退出代码、标准输入(stdin)支持,且无交互式提示。 * **安全与隐私:** 支持本地 **age X25519 加密**,确保解密密钥从不接触服务器。同时支持经过身份验证的账户移交和精细的访问控制。 * **灵活的有效期:** 文件和链接默认生命周期较短,支持撤销、自定义过期时间以及可选的下载次数限制。 * **无缝集成:** 包含可复用的 Codex 兼容技能、CI/CD 集成示例,并支持通过二进制文件、Homebrew 或 npm 进行跨平台安装。 该服务旨在做到“对机器人友好”,通过将共享 URL 单独打印在独立行中,便于 shell 脚本捕获。托管服务与开源客户端相互分离,确保用户数据和部署配置始终由用户掌控。无论是共享简单的文本还是加密的产物,aispace.sh 都为智能体到人类的文件传输提供了一个稳健的程序化桥梁。

```Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 面向 AI 智能体与人类的安全临时文件共享服务 (github.com/aispace-sh) 7 点,由 tengio 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 1 条评论 帮助 snake_doc 10 分钟前 | 下一条 [–] 嗯……为什么不直接用那个免费且采用 MIT 协议的版本:https://github.com/magic-wormhole/magic-wormhole 你也可以自行托管中继和邮箱服务器。 回复 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请加入 YC | 联系 搜索:```
相关文章

原文

aispace logo

Secure temporary file sharing for AI agents and humans.
A scriptable CLI with expiring links, predictable JSON, and optional local age encryption.

Website · Documentation

Release Go CI Go 1.26+ MIT license

Example terminal session uploading a report and receiving an expiring aispace link

aispace.sh is a bot-friendly file drop for outputs that are too large, structured, or temporary for chat. The open-source client is deliberately easy to automate: one binary, stable exit codes, streaming uploads, and share URLs printed on a predictable final line.

  • Built for agents: exact JSON output, documented errors, stdin support, and no interactive prompts in automated flows.
  • Short-lived by design: file expiration, separately expiring links, revocation, and optional per-link download caps.
  • Private when needed: authenticated account handoffs and local age X25519 encryption; the decryption identity never reaches aispace.

The hosted service is operated separately. This repository contains the client, agent skill, and integration examples—not the server, billing system, deployment configuration, or customer data.

Install the latest release:

curl -fsSL https://aispace.sh/install.sh | sh

Authenticate with a key created in the aispace dashboard, then store a file:

aispace login --key ask_...
aispace upload report.pdf --json

On a Pro account, add a separately expiring public handoff:

aispace upload report.pdf --link --link-expires 1h --max-downloads 1

The URL is printed last on its own line, making it easy for an agent or shell script to capture. Add --json for a stable machine-readable response. An abridged response looks like:

{"file":{"id":"...","name":"report.pdf"},"link":{"url":"https://aispace.sh/d/...","expires_at":1757003600}}

Other installation channels:

npm install -g @aispace-sh/cli
brew install aispace-sh/tap/aispace
go install github.com/aispace-sh/aispace-client@latest

Pin the shell installer with AISPACE_VERSION=v1.2.3. Release binaries support macOS, Linux, and Windows on amd64 and arm64. The shell installer supports macOS and Linux; use npm on Windows.


The repository includes a reusable Codex-compatible skill. Clone the repository and link the skill into your personal Codex skills directory:

git clone https://github.com/aispace-sh/aispace-client.git
mkdir -p ~/.codex/skills
ln -s "$PWD/aispace-client/skills/aispace" ~/.codex/skills/aispace

Restart Codex, then ask it to use aispace when it needs to hand you a report, archive, image, or other generated artifact. The skill defaults to account-private storage unless you request a public link, prefers short expirations, and treats encryption identities as credentials.

For custom agent runtimes, docs/LLM_USAGE.md includes a system-prompt snippet, OpenAI/Anthropic-compatible tool schemas, and a reference Python handler. See examples for runnable shell, CI, and encrypted-handoff recipes.

# Upload text from stdin and return an expiring public link (Pro).
echo "hello" | aispace upload - --name note.txt --link --link-expires 1h

# Keep a file available only to this key.
aispace upload secret.txt --private

# Share ciphertext; keep the generated age identity locally.
aispace upload secret.pdf --encrypt --identity-out secret.agekey --link

# Authenticated handoff to another key on the same account—no public URL.
aispace upload notes.md --shared --json

# Receive, manage, and revoke.
aispace ls --json
aispace download <file_id> --output ./file
aispace download <file_id> --output ./file --verify   # check the recorded SHA-256
aispace link <file_id> --expires 30m --max-downloads 1
aispace revoke <link_id>
aispace rm <file_id>

The complete command reference is in docs/CLI.md; the HTTP contract is in docs/API.md.

upload accepts --name, --expires, --content-type, --sha256, --link, --link-expires, --max-downloads, --private, --shared, --encrypt, --recipient, and --identity-out. Uploads stream from disk. Encrypted uploads use age X25519 locally and store ciphertext as <name>.age; the secret identity is never sent to the API.

With --json, errors also remain structured and are written to stderr. upload --link --json returns {"file": File, "link": ShareLink}; encrypted uploads add an "encryption" object.

Precedence: flag > environment > config file > default.

Setting Flag Env File key Default
API key --key AISPACE_KEY key
Server --url AISPACE_URL url https://aispace.sh

AISPACE_AGE_IDENTITY supplies a decryption identity when decrypt --identity-file is omitted. It is deliberately not accepted as a command-line value.

Config file: $XDG_CONFIG_HOME/aispace/config.json (default ~/.config/aispace/config.json), written with mode 0600. A warning is printed if the file is readable by others. AISPACE_CONFIG overrides the path.

Durations (--expires, --link-expires) accept Go syntax plus a d suffix: 30m, 24h, 7d, 1d12h, or a bare number of seconds. Omitting them uses the server defaults (7 days for files, 1 hour for links).

File permissions and links

File visibility controls authenticated key access. A public link is a separate capability: creating one requires a Pro account and makes that one file available to anyone holding the URL.

File mode Who can access it? File lifetime Public-link lifetime Download cap Exposure if access leaks
private Uploading key only 7 days by default; maximum 7 days on Free or 30 days on Pro None Account monthly limit Private files belonging to that key, until deletion or expiry
account Every active key on the account 7 days by default; maximum 7 days on Free or 30 days on Pro None Account monthly limit Account-shared files, until deletion or expiry
private + public link Uploading key and anyone with the URL Maximum 30 days because links require Pro 1 hour by default; maximum 30 days and never beyond file expiry Optional per-link cap Only the linked file, until link expiry, revocation, exhaustion, file deletion, or file expiry
account + public link Account keys and anyone with the URL Maximum 30 days because links require Pro 1 hour by default; maximum 30 days and never beyond file expiry Optional per-link cap URL access ends with the link; account keys retain access until file deletion or expiry
Client-encrypted file Visibility controls ciphertext access; only age identity holders can decrypt it Same limits as the selected file mode Same Pro-only limits when a link is created Optional per-link cap Plaintext exposure requires both the ciphertext and the age identity

Available duration syntax includes 30s, 15m, 1h, 36h, and 7d.

A file becomes unavailable when its file lifetime ends. A link can end sooner because it expired, was revoked, or reached its download cap. Deleting the file immediately ends authenticated key access and every associated public link.

Code Meaning
0 success
1 generic error (network, 4xx/5xx not listed below)
2 usage error
3 authentication (401, or no key configured)
4 quota / size (402, 413)
5 rate limited (429) — idempotent GETs sleep Retry-After (max 30s) and retry once

Errors go to stderr as error: <message> (<code>); with --json they are a JSON object {"error":{"code","message","status","details","exit_code"}} on stderr instead.

go test -race ./... && go vet ./... && test -z "$(gofmt -l .)"
go build -ldflags "-X main.version=0.0.0-dev" -o aispace .
(cd npm && npm test && npm pack --dry-run)

The test suite uses local HTTP fixtures and does not require an aispace key. Contributions are welcome—start with CONTRIBUTING.md, check the ROADMAP.md, and review the CHANGELOG.md. Focused bug reports and feature proposals can use the repository's structured issue forms.

Releases are cut through the manual GitHub Actions workflow. GoReleaser builds checksummed macOS, Linux, and Windows binaries, updates the Homebrew tap, and publishes @aispace-sh/cli to npm. See RELEASE.md for publisher configuration and the release checklist.

Please report vulnerabilities privately through GitHub Security Advisories. Do not open a public issue containing a credential, private link, or customer data. See docs/SECURITY.md.

联系我们 contact @ memedata.com