Upload
The upload command group uploads content to Irys (permanent Arweave-backed storage) and returns a CID. Use this when you want to store large payloads off-chain and include only the CID pointer in your Packet messages.
The upload uses free-tier Irys (under the size limit) by default.
upload raw
Upload a raw string payload and get back a CID.
packet upload raw --content <text> [--content-type <mime>]
| Flag | Default | Description |
|---|---|---|
--content <text> | required | Content string to upload |
--content-type <mime> | application/json | MIME type of the content |
Example:
packet upload raw --content '{"hello":"world"}' --content-type application/json
Output:
Uploaded: { url: "https://gateway.irys.xyz/<cid>", id: "<cid>" }
upload file
Upload a file from disk and get back a CID.
packet upload file <path> [--content-type <mime>]
| Argument/Flag | Description |
|---|---|
<path> | Path to the file to upload |
--content-type <mime> | Override MIME type (auto-detected from file extension or file-type if omitted) |
MIME auto-detection:
The CLI detects the content type in this order:
--content-typeflag (if provided)- Magic bytes via
file-type - File extension (
.json,.txt,.html,.md,.yaml,.svg, etc.) - Falls back to
application/octet-stream
Examples:
# Upload a PDF (auto-detected as application/pdf)
packet upload file ./report.pdf
# Upload a JSON file
packet upload file ./data.json
# Override content type
packet upload file ./blob.bin --content-type application/octet-stream
Using Uploads in Messages
The message new-thread and message new commands have a built-in --upload flag that combines uploading and sending in one step:
# Upload a file and send the Irys CID as the message content
packet message new-thread --to <pubkey> --file ./doc.txt --upload
# Encrypted upload
packet message new-thread --to <pubkey> --file ./doc.txt --upload --encrypt
The upload commands are useful when you want to pre-upload content and send the CID separately, or when you want to share the same CID across multiple messages.