slackcli files inspects metadata, prints textual content, and downloads
Slack-hosted files. Every command accepts a file ID or Slack file URL.
files info and files read take --fields with
--json to print only the fields you name (files info F1234567890 --json --fields id,name,size).
Reading files requires the files:read scope when you use standard
authentication. Browser-session authentication uses the existing browser cookie
and token.
files info
Section titled “files info”slackcli files info F1234567890slackcli files info https://myteam.slack.com/files/U123/F1234567890/report.txtslackcli files info F1234567890 --jsonHuman-readable output includes the file ID, name, type, size, owner, creation time, and permalink when Slack provides them. It does not print private download URLs.
--json returns the complete file object from Slack. This can include
url_private and url_private_download, so treat the output as private.
files read
Section titled “files read”# Print textual contentslackcli files read F1234567890
# Read Slack's plain-text extraction from an email fileslackcli files read F1234567890
# Read the original textual file instead of Slack's extractionslackcli files read F1234567890 --raw
# Return the content and its source as JSONslackcli files read F1234567890 --jsonSlack email files can include a plain_text field in their metadata. The
command uses that field by default. Otherwise, it downloads the original when
the MIME type identifies a textual file.
--raw always reads the original textual file. Text reads are capped at 10 MB.
The command refuses to print binary files; use files download for those.
JSON output has this shape:
{ "id": "F1234567890", "name": "message.eml", "title": "Message", "mimetype": "message/rfc822", "source": "plain_text", "content": "From: sender@example.com\n..."}source is plain_text or original.
files download
Section titled “files download”slackcli files download F1234567890 --output ./report.pdfslackcli files download "$FILE_URL" --output ./message.eml
# An output path outside the current directory needs confirmationslackcli files download F1234567890 --output ~/Downloads/report.pdf --yesThe command streams the original bytes to the output path. It does not convert binary data to text or hold the complete download in memory.
The output path is required. The command refuses to overwrite an existing file. Choose another path or remove the existing file before you retry.
Output paths outside the current directory
Section titled “Output paths outside the current directory”--output writes wherever you point it, and SlackCLI is built to be driven by
AI agents, so the value can come from content an agent read out of Slack. A
path that stays inside the current working directory downloads exactly as
before, with no prompt. A path that escapes it — ../…, an absolute path
outside it, or a directory symlinked out of the working tree — is confirmed
first:
--yesproceeds.- An interactive terminal prompts
y/N. - A non-interactive shell without
--yesrefuses and exits non-zero.
The message names the resolved absolute path, not the string you typed, and names the symlink target as well when the two differ. Confirmation happens before any Slack API call, so a declined download requests nothing.
This is a containment check, not a sandbox: --yes still writes anywhere you
have permission to write. See Scripting for unattended use.
File URLs and workspaces
Section titled “File URLs and workspaces”Supported URLs include normal Slack file permalinks, Canvas document URLs, and
private Slack file URLs. When a permalink names a different workspace from the
selected browser-authenticated workspace, SlackCLI warns before making the API
request. Use --workspace <id|name> to select the matching workspace.
Private files.slack.com URLs do not identify their workspace, so SlackCLI
cannot provide a workspace-mismatch warning for those URLs.