Skip to content

feat(files): add files download command#122

Merged
piekstra merged 1 commit intomainfrom
piekstra/121-files-download-command
Mar 2, 2026
Merged

feat(files): add files download command#122
piekstra merged 1 commit intomainfrom
piekstra/121-files-download-command

Conversation

@piekstra
Copy link
Copy Markdown
Collaborator

@piekstra piekstra commented Mar 2, 2026

Summary

  • Add slck files download <file-id-or-url> command to download Slack file attachments
  • Accepts bare file ID (F0AHF3NUSQK) or any Slack file URL (url_private, url_private_download, permalink)
  • --output / -O flag to specify destination path; defaults to original filename in cwd
  • New files subcommand group (extensible for future file commands)
  • New client methods: GetFileInfo (files.info API) and DownloadFile (authenticated download)

Why

After #119 added file metadata to message JSON output, consumers could see that files existed but had no CLI way to retrieve them — downloading required manually curling with auth headers. This closes the loop so you can go from messages thread --output json to files download <id> in a single workflow.

Test plan

  • Unit tests for file ID resolution (bare ID, url_private, url_private_download, permalink, invalid input)
  • Unit tests for download (success, URL input, default filename, invalid ID, JSON output, url_private fallback)
  • All existing tests pass
  • Linter clean
  • Live tested against real Slack file (F0AHF3NUSQK) with both file ID and URL input

Closes #121

Add `slck files download <file-id-or-url>` to download Slack file
attachments. Accepts a bare file ID (F0AHF3NUSQK) or any Slack file URL
(url_private, url_private_download, permalink). Defaults to saving with
the original filename in the current directory; `--output` overrides.

New client methods: GetFileInfo (files.info API) and DownloadFile
(authenticated GET to url_private_download).

Closes #121
@piekstra piekstra merged commit fe929b1 into main Mar 2, 2026
2 checks passed
@piekstra piekstra deleted the piekstra/121-files-download-command branch March 2, 2026 14:35
rianjs added a commit that referenced this pull request Mar 23, 2026
Add missing documentation for emoji list, files download, whoami,
--channel and --file flags on messages send. Add emoji:read and
files:read OAuth scopes to manifest. Update CHANGELOG with entries
for recent features (#120, #122, #123, #125, #126, #130). Add
integration test sections for emoji, files, identity, and --channel.
rianjs added a commit that referenced this pull request Mar 23, 2026
## Summary

- Add missing README sections for `emoji list`, `files download`, and
`whoami` commands
- Document `--channel` and `--file` flags on `messages send`
- Add `emoji:read` and `files:read` OAuth scopes to app manifest and
scopes table
- Add `emoji` → `e` alias to aliases table
- Update CHANGELOG with entries for #120, #122, #123, #125, #126, #130
- Add integration test sections: Part 8 (Emoji & Files), Part 9
(Identity)
- Add `--channel` flag test case to messaging section
- Add `emoji:read` and `files:read` to integration test setup scopes
table

## Test plan

- [x] No code changes — docs only
- [ ] Review README for accuracy against actual CLI behavior
- [ ] Verify CHANGELOG entries reference correct PR numbers
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.

files download: add command to download file attachments

1 participant