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
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
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