Skip to content

Add first-class attachment download support (issue attachments + uploads links) #47

@dorkitude

Description

@dorkitude

Problem

linctl can fetch issue metadata and expose attachment/file URLs, but there is no first-class way to download attached files directly via CLI.

In practice, this causes friction because:

  • attachment URLs on uploads.linear.app are auth-gated
  • users have to manually extract URLs from issue.description or attachments.nodes
  • users must then manually apply auth headers/tokens to download files

This came up while retrieving a Linear issue attachment for END-6721 (double-encoded JSON ticket): the CLI returned issue details fine, but downloading the linked markdown required manual token/header handling.

Requested feature

Add built-in attachment download support to linctl.

Proposed UX

  1. linctl issue get <ISSUE-ID> --download-attachments [--output-dir <dir>]
  2. linctl issue attachment list <ISSUE-ID>
  3. linctl issue attachment download <ISSUE-ID> [--all | --id <attachment-id> | --name <filename>] [--output <path>|--output-dir <dir>]

Behavior details

  • Reuse existing authenticated session/token automatically.
  • Support both:
    • canonical attachments entries
    • markdown file links in issue description/comments pointing to uploads.linear.app.
  • Preserve server filename when possible.
  • Exit non-zero on partial failures; print per-file status.
  • --json output should include saved file paths and statuses.

Why this matters

  • Removes manual token handling and reduces auth errors.
  • Makes linctl more complete for agent workflows and terminal-only usage.
  • Keeps sensitive download auth handling centralized and consistent.

Acceptance criteria

  • From an authenticated linctl session, downloading an attachment from a known issue succeeds with one command.
  • Works for both attachments.nodes and upload URLs embedded in markdown.
  • Works in plaintext and JSON modes with clear status output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions