Skip to content

feat: add attach and download commands, register attachable entity#3

Open
drassi wants to merge 1 commit intovoska:mainfrom
drassi:feat/attachments
Open

feat: add attach and download commands, register attachable entity#3
drassi wants to merge 1 commit intovoska:mainfrom
drassi:feat/attachments

Conversation

@drassi
Copy link
Copy Markdown

@drassi drassi commented Mar 9, 2026

Summary

We use QBO attachments a lot, especially for Bills to store copies of invoices sent by vendors. I built out the attachable functionality a bit and have been running it for the past week on prod data. Additions:

  • Add qbo attach command to upload file attachments to QBO entities (or standalone)
  • Add qbo download command to retrieve attachments by ID (saves file or prints pre-signed URL)
  • Register attachable as a first-class entity (queryable, creatable, updatable, deletable)
  • Update CLI schema, skill docs, and command reference

Details

qbo attach [entity-type entity-id] <file> [--note] [--include-on-send]
Uploads a file via QBO's multipart upload endpoint. Can optionally link it to an entity (e.g., qbo attach invoice 123 receipt.pdf). Supports --dry-run, enforces a 100 MB size limit, and auto-detects content type from the file extension.

qbo download <id> [-o path] [--url]
Downloads an attachment by its Attachable ID. Without -o, uses the original filename from QBO metadata. --url prints the temporary pre-signed download URL instead of saving the file.

Examples

# Upload a receipt and link it to an invoice
qbo attach invoice 123 receipt.pdf --json

# Standalone upload (no entity link)
qbo attach logo.png --json

# Add a note to the attachment
qbo attach bill 456 scan.pdf --note "March utilities"

# Preview without making API calls
qbo attach invoice 123 receipt.pdf --dry-run

# List attachments on an entity
qbo list attachable --where "AttachableRef.EntityRef.value = '123'" --json --results-only

# Download with original filename
qbo download 789

# Save to a custom path
qbo download 789 -o ~/Downloads/receipt.pdf

# Get the pre-signed URL instead of the file
qbo download 789 --url

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant