aispace

2026-09-08 · page · source ↗ · source summary

aispace is a Go CLI for "bot-friendly file drops" — temporary file storage built to be driven by AI agents rather than humans. It uploads files (or stdin) with a raw streaming POST, optionally mints separately-expiring public share links, and can encrypt payloads client-side with age X25519 so the storage operator never sees plaintext. It matters as a reference implementation of agent-native CLI design: stable exit codes, exact JSON, and a URL printed last on its own line make it trivially scriptable, and it fills the auth gap most agent-CLI frameworks leave open by treating bot keys and decryption identities as credentials.


Architecture

A single binary, layered thin: cmd/ (cobra subcommands) → internal/api/ (the HTTP client, ~600 lines) → internal/config and internal/duration. The server is not in this repo — only the client, the agent skill, and examples. ~8.6K lines of Go including tests, with just two direct dependencies: filippo.io/age and spf13/cobra.

Each command returns a process exit code via classify() in cmd/root.go:314, which walks the error chain — usageError (exit 2), codedError (local errors like unauthenticated), then api.Error — and maps it onto codes 0–5. internal/api/errors.go maps stable server error codes (invalid_key, quota_exceeded, monthly_upload_cap) to exit codes, falling back to HTTP status for servers that don't return structured errors.

Uploads are raw bodies, not multipart: POST /v1/files with X-File-Name, X-SHA256, X-File-Visibility, and X-Aispace-Encryption headers (internal/api/client.go:107). The client's Result[T] pairs a decoded value with the raw JSON body so the CLI can print exactly what the API returned, with no re-serialization drift.

Key techniques

Design decisions

Comparison notes

#tool #project #agents #security #cli


Sources: raw/aispace-client, aispace Last updated: 2026-09-08