22 Commits

Author SHA1 Message Date
Peter Schilling eb8a659f04 feat(document): download attached images in document view
Document view's rendered/raw output now downloads inline images and
Linear-upload links to the same /tmp cache used by issue view, so terminal
renderers and downstream tools see local file paths instead of remote URLs
that require auth.

Image helpers (extractImageInfo, extractLinearLinkInfo, replaceImageUrls,
getUrlHash, getLinearUploadHost, downloadMarkdownImages) move from
src/commands/issue/issue-view.ts to src/utils/markdown-images.ts so both
commands share one implementation. downloadIssueImages becomes
downloadMarkdownImages, which takes an array of markdown sources rather
than an issue-specific (description, comments) tuple.

Adds --no-download to document view (mirroring issue view) and reorders
the command so the download step runs after the --json early return but
before --raw, matching issue view's behavior where piped output also gets
local paths.

Also adds remark-gfm to the parse/stringify pipeline used by
replaceImageUrls so GFM constructs (task lists, tables, strikethrough)
survive the URL rewrite. Without it, remark-stringify would re-escape
`- [ ] todo` as `* \[ ] todo` whenever an image is rewritten, mangling
documents and issue descriptions that lean on GFM syntax.
2026-05-19 12:54:29 -07:00
Peter Schilling 26c418f4b8 feat: split issue list into mine and query commands
Introduce 'issue mine' for personal work queue and 'issue query' for
structured retrieval with optional full-text search via --search.
Keep 'issue list' as a separate backwards-compatible command.
Remove standalone 'issue search' registration in favor of query --search.

query supports multi-team filtering, --all-teams, --json output,
--search-comments, and verifies GraphQL variables in tests.
2026-04-03 18:22:51 +00:00
Peter Schilling 4113c4d4fc test: make issue list output deterministic 2026-04-01 14:59:12 +00:00
Evan Jacobson 6fdd1e0da2 upgrade dependencies (#194) 2026-03-31 20:36:06 -07:00
Peter Schilling ab21736a1c docs: add npm install instructions to README 2026-03-07 17:59:28 +00:00
Ben Drucker 3582fc5700 feat: add api subcommand for raw GraphQL access (#121)
Adds a `linear api` subcommand for making raw GraphQL requests,
mirroring [`gh api`](https://cli.github.com/manual/gh_api) conventions.

## Changes

- Accepts a GraphQL query as a positional arg, from stdin with `-`, or
via auto-detected piped input
- `--variable key=value` for typed variable coercion (booleans, numbers,
null, `@file` for file reads, `@-` for stdin)
- `--variables-json '{"key": "value"}'` for passing all variables as a
JSON object (merged with `--variable`, which takes precedence)
- `--paginate` walks `pageInfo.endCursor` automatically and outputs
concatenated `nodes` array
- `--silent` suppresses response output while exit code still reflects
errors
- Pretty-prints JSON when stdout is a TTY, raw JSON otherwise for piping
to `jq`
- Exits with code 1 on HTTP errors (status >= 400) and GraphQL-level
errors
- Uses raw `fetch` so users see the exact server response including both
`data` and `errors` fields

## Testing

- Snapshot tests using `MockLinearServer` cover query resolution,
variable handling (type coercion, `@file`, `--variables-json`,
precedence), output modes, pagination (multi-page, single-page,
non-connection), auth errors, and `--silent` behavior for both
successful and HTTP error responses
- Manual testing against live Linear API: cycles, workflow states,
notifications (with `--paginate`), non-existent issue lookup, variable
type mismatch errors, stdin piping

## Related

- Closes #123
2026-02-09 09:36:55 -08:00
Peter Schilling 540818c0b1 feat: add multi-workspace authentication support
Add built-in credential storage for managing multiple Linear workspaces:
- ~/.config/linear/credentials.toml stores API keys by workspace slug
- auth login: add credentials (auto-detects workspace from API)
- auth logout: remove credentials
- auth list: show configured workspaces with org/user info  
- auth default: set the default workspace
- global -w/--workspace flag to target specific workspace

API key precedence: CLI flag > env var > config > workspace flag > project workspace > default
2026-01-23 14:28:45 -08:00
Peter Schilling 4d3a4bb2f1 feat: add auto-generated skill documentation from CLI help output 2026-01-22 10:56:33 -08:00
Peter Schilling b47f95e7fb Add image download functionality to issue view
Implement local image caching for issue view command to avoid
exposing authenticated Linear URLs. Images are downloaded to a
temporary directory and cached for reuse.

- Add image download and caching system
- Update deno.json permissions for temporary directories and
  uploads.linear.app domain access
- Add dependencies: remark, unified, mdast, valibot, sanitize-filename
- Add LINEAR_DOWNLOAD_IMAGES env var and download_images config option
  (enabled by default, disable with --no-download flag)

Claude-session-id: 626af003-386f-486b-8357-db352b0b5766
2025-12-03 22:45:28 -08:00
Peter Schilling e76b734ed8 setup pre-commit hooks 2025-08-21 08:56:58 -07:00
Peter Schilling 592000f70a Various improvements (#51)
**Fixed:**
- state column is now dynamically sized with max 20 chars and
auto-truncation

**Changed:**
- linear issue list now sorts by workflow state first
- issue pr create no longer opens browser by default, added --web flag
- removed 'about' prefix from relative timestamps

**Added:**
- automatic paging for issue view command with --no-pager flag and pager
- pager support for issue list command with --no-pager option
2025-08-18 21:52:46 -07:00
Peter Schilling 3af23fd92e CLI-23 Add linear issue update non-interactive command, support same flags as create (#50)
https://linear.app/schpet/issue/CLI-23/add-linear-issue-update-non-interactive-command-support-same-flags-as
2025-08-17 07:18:21 -07:00
Peter Schilling 02247bb9eb bring back issue list --app / --web 2025-08-16 07:42:30 -07:00
Peter Schilling c125a2e805 test issue-create 2025-08-14 19:51:32 -07:00
Peter Schilling 2ea8138cf4 feat: Use graphql codegen to ensure linear api data has types (#34)
CLI-5
2025-08-11 22:48:29 -07:00
Peter Schilling b8828da219 Handle long team ids, Improve error output (#29)
- improves error output to be pretty json
- handles longer team ids
- adds a script to update linear's graphql schema
- adds tests
2025-06-17 22:02:01 -07:00
Peter Schilling 0d943e3b9e feat: Support a linear.toml configuration file and linear issue start (#16)
- [ ] update README
- [ ] see if we can use toml lib to serialize
2025-02-10 09:36:12 -08:00
Peter Schilling ec87f2b2b2 feat: Support .env files (#15)
load a .env file from the cwd, or the git repo root
2025-02-07 13:51:15 -08:00
Peter Schilling 68af469b8a chore: Remove unused dependency 2025-02-07 10:51:11 -08:00
Peter Schilling 307b259eba feat: linear issue list (#14)
two sort options to start: manual and priority. can introduce more later as needed.

fixes #8
2025-02-07 10:20:31 -08:00
Peter Schilling e5a57ad6e2 Improve pr command behaviour, show loading spinners 2024-11-27 08:17:05 -08:00
Peter Schilling 03ba7c9ed7 Basic features 2024-11-23 07:08:53 -08:00