Skip to content

feat: add upload subcommand for Slack external file uploads#5

Merged
theahura merged 1 commit into
mainfrom
add-cli-file-upload
Jun 20, 2026
Merged

feat: add upload subcommand for Slack external file uploads#5
theahura merged 1 commit into
mainfrom
add-cli-file-upload

Conversation

@nori-sessions

@nori-sessions nori-sessions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

🤖 Generated with Nori

  • Adds a nori-slack upload subcommand that drives Slack's modern three-step external file upload flow: files.getUploadURLExternal mints an upload URL, the raw bytes are POSTed directly to Slack's upload host, and files.completeUploadExternal shares the file into a channel. The byte POST cannot ride the dynamic <method> dispatch path (it's a binary POST to a different host with no token), which is why uploads need their own subcommand. The mint and completing calls ride the transport, so in proxy mode the broker still enforces the session's channel scoping at completion.
  • Calls program.enablePositionalOptions() so the default command's --dry-run flag no longer shadows the upload subcommand's identically-named flag (Commander was attributing it to the program scope).
  • Maps a proxy-mode ok:false mint response (returned at HTTP 200, so the transport doesn't throw) to the Slack slack_webapi_platform_error shape, so formatError surfaces an actionable suggestion instead of a generic unknown_error — matching direct-mode behavior.
  • Bumps version 0.2.0 → 0.3.0 (in-repo only; no publish). Docs (README + noridocs) updated.

Test Plan

  • npm run build (tsc typecheck) passes
  • Full suite green (77 tests), including 8 new black-box upload tests covering: happy path (mint → byte POST → complete), title defaulting, channel-denied 403 after bytes uploaded, missing/nonexistent --file (exit 2, no network), mint failure mapped to a Slack code, byte-POST HTTP failure (exit 1), and --dry-run
  • Manual smoke: nori-slack upload --file ./report.pdf --channel C123 --dry-run previews the plan; a real upload in a Nori session shares the file into the channel

Share Nori with your team: https://www.npmjs.com/package/nori-skillsets

Adds a `nori-slack upload` subcommand that drives Slack's three-step
external upload flow (files.getUploadURLExternal -> raw byte POST ->
files.completeUploadExternal). The byte POST goes directly to Slack's
upload host, so it cannot ride the dynamic <method> dispatch path; the
mint and completing calls ride the transport, so proxy-mode channel
scoping is enforced by the broker at completion.

Calls program.enablePositionalOptions() so the default command's
--dry-run flag no longer shadows the upload subcommand's flag. Maps a
proxy-mode ok:false mint response (HTTP 200) to the Slack platform-error
shape so formatError surfaces a suggestion instead of a generic error.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
@theahura theahura merged commit 68c9277 into main Jun 20, 2026
1 check passed
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