feat(cli): add issues files upload/download commands
Closes #135 (closed)
Summary
- Add
pgai issues files upload <path>— uploads a file to Storage API, returns URL and ready-to-paste markdown link - Add
pgai issues files download <url> [-o <output>]— downloads a file from storage - New
cli/lib/storage.ts— Storage API client (uploadFile,downloadFile,buildMarkdownLink) - Add
--storage-base-urlglobal option andPGAI_STORAGE_BASE_URLenv var (default:https://postgres.ai/storage)
Usage
# Upload a screenshot and get markdown to paste into issue
pgai issues files upload ./screenshot.png
# → URL: https://postgres.ai/storage/files/123/xxx.png
# → Markdown: 
# Download a file
pgai issues files download /files/123/xxx.png -o ./downloaded.png
Test plan
-
25 unit tests for
lib/storage.ts(buildMarkdownLink, uploadFile, downloadFile) - 8 CLI integration tests with fake storage server (upload/download end-to-end, auth checks, help text)
- All 540 existing tests still pass
- No new type errors in source files
Edited by Bogdan Tsechoev