Skip to content

Add first-class issue attachment download support#48

Merged
dorkitude merged 3 commits into
masterfrom
fix/issue-47-attachment-download
May 23, 2026
Merged

Add first-class issue attachment download support#48
dorkitude merged 3 commits into
masterfrom
fix/issue-47-attachment-download

Conversation

@dorkitude
Copy link
Copy Markdown
Owner

@dorkitude dorkitude commented Apr 20, 2026

Summary

Adds first-class issue attachment discovery and download support for #47.

Implemented user-facing flows:

  • linctl issue attachment list <issue-id> lists canonical Linear attachments plus uploads.linear.app links found in issue descriptions and recent comments.
  • linctl issue attachment download <issue-id> downloads a single attachment automatically when there is only one entry.
  • linctl issue attachment download <issue-id> --all --output-dir <dir> downloads all downloadable entries.
  • linctl issue attachment download <issue-id> --id <attachment-id> selects a canonical attachment by ID.
  • linctl issue attachment download <issue-id> --name <filename> --output <path> selects by title or URL filename and writes to a specific path.
  • linctl issue get <issue-id> --download-attachments --output-dir <dir> fetches issue details and downloads attachments in one command.

Behavior notes:

  • Download output works in table, plaintext, and JSON modes.
  • Partial download failures are reported per file and cause a non-zero exit.
  • Non-downloadable GitHub issue/PR links are skipped during --all instead of failing the whole operation.
  • Filenames are resolved from Content-Disposition, attachment title, or URL path and sanitized before writing.
  • Existing files are not overwritten for directory downloads; names get a numeric suffix.
  • The Linear auth header is only sent to uploads.linear.app downloads, not arbitrary external attachment URLs.

Docs and tests:

  • Updates README, SKILL.md, and master_api_ref.md for the new commands and behavior.
  • Adds focused command tests in cmd/issue_cmd_test.go for upload URL extraction, entry collection, selector behavior, skipped non-downloadable links, failure detection, flag registration, and auth-header handling for external downloads.

Closes #47

Testing

  • go test ./...
  • go run . issue attachment --help
  • go run . issue get --help

Not Tested

  • Live download against a real authenticated uploads.linear.app attachment. The code path is covered with unit tests, but this environment does not have a live Linear attachment fixture.

@dorkitude dorkitude merged commit 4ad9a06 into master May 23, 2026
@dorkitude dorkitude deleted the fix/issue-47-attachment-download branch May 23, 2026 17:38
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.

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

1 participant