Skip to content

Files

Upload files and inspect media records from the CLI.

Upload, list, view, and delete file attachments. Alias: pf m

pf media listList media attachments. Filter by exactly one parent type. If no id filter is set, defaults to listing post attachments.

alias: pf m ls

Options

  • --poststring

    Filter by post ID

  • --commentstring

    Filter by comment ID

  • --taskstring

    Filter by task ID

  • --task-commentstring

    Filter by task-comment ID

  • --targetstring

    Override target kind: post | comment | task | taskComment

  • --typestring

    Filter by file type: image, video, audio, model, animation, sprite, document, lottie, or file

  • --projectstring

    Post media only: files on posts in this project

  • --uploaderstring

    Post media only: files uploaded by this user ID, or me

  • --created-afterstring

    Post media only: uploaded after this time, as an ISO 8601 time with a timezone or Unix milliseconds. Also --created-before

  • --querystring

    Post media only: words in the file name

  • --sort / --orderstring

    Post media only: sort by createdAt or fileSize, and order asc or desc

  • --limitnumber

    Max number of results

  • --cursorstring

    Cursor for pagination

Example

Shell
pf media list --task task123
pf media list --comment com123 --type image
pf media list --target task --limit 20
pf media list --uploader me --sort fileSize --order desc
pf media statsCount the files you can see on posts, by kind

Options

  • --projectstring

    Only files in this project (ID or slug)

Example

Shell
pf media stats --project website
pf media posts <id>List the posts a post file appears on

Example

Shell
pf media posts att_abc123
pf media reorder <post> <ids...>Set the order of a post's files. List every file ID on the post, first to last. Only the post's author can reorder.

Example

Shell
pf media reorder 3 att_def456 att_abc123
pf media pair <post> <before> <after>Show two images or GIFs on a post as one before/after with a divider to drag. Either file leaves any pair it was in. Only the post's author can pair files.

Options

  • --before-labelstring

    Label for the before side, up to 40 characters (default Before)

  • --after-labelstring

    Label for the after side, up to 40 characters (default After)

Example

Shell
pf media pair 3 att_abc123 att_def456 --before-label Day --after-label Night
pf media unpair <post> <id>Split a before/after pair back into two files. Pass either file in the pair. Only the post's author can unpair files.

Example

Shell
pf media unpair 3 att_abc123
pf media retry-conversion <id>Queue a failed 3D model conversion again

Options

  • --targetstring

    Target kind: post | comment | task | taskComment (default post)

Example

Shell
pf media retry-conversion att_abc123
pf media cancel-uploadCancel an unattached upload and release its storage reservation. Provider deletion runs in the background. Safe to retry with an expired token. Already attached uploads return a conflict; retry a finalization conflict after it finishes.

Options

  • --upload-tokenstringrequired

    Token returned when the upload was prepared.

Example

Shell
pf media cancel-upload --upload-token "$UPLOAD_TOKEN"
pf media upload <file>Upload images, videos, or other files to posts, tasks, comments, Chat, Canvas, or inline Docs. Image settings include avatars, logos, project images, and custom reactions. Exactly one destination flag is required. Uses the same format and size limits as the app, up to 1 GiB. A GIF or WebP animation too large to process is stored as the original file, without resized versions.

alias: pf m upload

Options

  • --chat-messagestring

    Chat or portal discussion message ID; requires chat:write

  • --canvasstring

    Canvas ID; requires canvas:write

  • --xstring

    Canvas x coordinate; default 0

  • --ystring

    Canvas y coordinate; default 0

  • --widthstring

    Canvas item width; default 400

  • --heightstring

    Canvas item height; default 300

  • --framestring

    Parent canvas frame ID

  • --avatarstring

    Your user ID; requires profile:write

  • --workspace-logostring

    Workspace ID; requires owner or admin

  • --project-headerstring

    Project ID; requires projects:write and project settings access

  • --project-iconstring

    Project ID; requires projects:write and project settings access

  • --portal-logostring

    Portal ID; requires owner or admin

  • --portal-bannerstring

    Public portal ID; requires owner or admin

  • --custom-reactionstring

    Workspace ID; requires reactions:write and owner or admin

  • --namestring

    Custom reaction name; 2-32 letters, numbers, or underscores

  • --docstring

    Doc ID for a native inline file embed; requires docs:write and media:write

  • --after-blockstring

    Insert after a top-level Doc block ID; defaults to the end of the Doc

  • --resume-statestring

    Save progress to this file. Rerun the same command to resume before the upload expires. The file contains signed URLs; keep it private.

  • --media-typestring

    For JSON files: lottie for animation or file for ordinary data

  • --poststring

    Post ID to attach media to

  • --commentstring

    Comment ID to attach media to

  • --taskstring

    Task ID to attach media to

  • --task-commentstring

    Task-comment ID to attach media to

  • --targetstring

    Explicit target kind; must match the id flag when both are set

Example

Shell
pf media upload review.mp4 --post post123 --resume-state ./review-upload.json
pf media upload model.glb --task task456
pf media upload review.mp4 --chat-message message123
pf media upload reference.png --canvas canvas123 --x 200 --y 100
pf media upload diagram.png --doc page123 --after-block block456
pf media upload animation.json --comment com789 --media-type lottie
pf media view <id>View media details. Pass --target for non-post attachments (defaults to post).

alias: pf m show

Options

  • --targetstring

    Target kind: post | comment | task | taskComment (default: post)

Example

Shell
pf media view media123
pf media view media123 --target task
pf media delete <id>Delete a media attachment. Pass --target for non-post attachments (defaults to post).

alias: pf m rm

Options

  • --targetstring

    Target kind: post | comment | task | taskComment (default: post)

  • --confirmboolean

    Skip confirmation prompt

  • --dry-runboolean

    Preview without deleting

Example

Shell
pf media delete media123 --confirm
pf media delete media456 --target comment --confirm

Fix file problems

Media attaches to the wrong kind of record
Use exactly one of --post, --comment, --task, or --task-comment. When using --target, make it match the parent ID flag and repeat the same target when viewing or deleting.
An upload fails partway through
Check the file and parent record still exist, keep the same target, and retry once. List the parent's media before retrying to avoid a duplicate attachment after an ambiguous response.

Next steps

Image preview
100%