137 Commits

Author SHA1 Message Date
Kirt Lillywhite 1268b667fb feat: support loading config from user home directory
Add support for loading `.linear.toml` from user's home directory as a
fallback when no project-level config exists:
- Unix: `~/.config/linear/linear.toml` or `$XDG_CONFIG_HOME/linear/linear.toml`
- Windows: `%APPDATA%\linear\linear.toml`

Config precedence (highest to lowest):
1. CLI flags
2. Environment variables
3. Project config (`.linear.toml` in cwd or repo root)
4. User home config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 13:28:32 -08:00
Jeffrey Holm 77aa22b9d9 feat: add milestone management commands (#92)
## Summary

Adds comprehensive milestone management functionality to linear-cli,
enabling full CRUD operations for Linear project milestones.

## Motivation

The Linear API supports project milestones, but the CLI didn't expose
this functionality. This PR adds milestone management commands to
complement the existing project and issue commands.

## Changes

### New Commands

- `linear milestone list --project <id>` - List milestones for a project
- `linear milestone create` - Create new project milestones  
- `linear milestone update <id>` - Update existing milestones
- `linear milestone delete <id>` - Delete milestones with confirmation
- Short alias: `linear m` for all milestone commands

### Features

- Full CRUD operations for project milestones
- Table-formatted output for list command
- Interactive confirmation prompts for deletion (with `--force` option
to skip)
- Support for milestone name, description, and target date
- Follows existing CLI patterns and conventions

### Implementation

- Uses GraphQL Code Generator for type-safe queries/mutations
- Built with Cliffy for command structure and prompts
- Leverages existing graphql client utilities
- Includes spinner for loading states
- Updated README with usage examples

## Testing

All commands have been tested with the Linear API:

- ✅ List milestones for a project (empty and populated)
- ✅ Create milestones with name, description, target date
- ✅ Update milestone properties
- ✅ Delete milestones with confirmation prompt
- ✅ Delete with `--force` flag (skip confirmation)

## Documentation

Updated README.md with:
- Milestone commands section
- Usage examples for all operations
- Command aliases

## Example Usage

```bash
# List milestones
linear milestone list --project abc123
linear m list --project abc123  # alias

# Create a milestone
linear milestone create --project abc123 --name "Q1 Goals" --target-date "2026-03-31"
linear m create --project abc123  # interactive mode

# Update a milestone  
linear milestone update xyz789 --name "Q1 Objectives"
linear m update xyz789 --target-date "2026-04-15"

# Delete a milestone
linear milestone delete xyz789
linear m delete xyz789 --force  # skip confirmation
```
2026-01-09 12:41:19 -08:00
Peter Schilling 87a442a0a7 Prefix issue title with identifier in issue view
Add the issue identifier (e.g., TEST-123) before the title in the
issue view command output. The title now displays as "TEST-123: Fix
authentication bug" instead of just "Fix authentication bug".

- Add identifier field to fetchIssueDetails return type
- Include identifier in both GraphQL queries
- Update issue-view.ts to prefix title with identifier
- Update all test mocks to include identifier field

Claude-session-id: a1d9f23b-b88b-4571-b44a-37003734e4a1
2026-01-05 16:07:29 -08:00
Paymahn Moghadasian f3e9b9f348 feat: add parent and sub-issues to issue view output (#86)
## Summary

- Add parent issue display to `linear issue view` output (when the issue
has a parent)
- Add sub-issues list to `linear issue view` output (when the issue has
children)
- Enables agents and users to easily navigate up and down the issue
hierarchy

Closes #84

## Example Output

```
# Implement user authentication

Add user authentication to the application.

Parent:
  TEST-100: Epic: Security Improvements [In Progress]

Sub-issues:
  TEST-457: Add login form [Done]
  TEST-458: Add password reset flow [Todo]
  TEST-459: Add OAuth support [In Progress]
```

## Test plan

- [x] Added new test case "With Parent And Sub-issues" to verify
hierarchy display
- [x] Updated existing tests to include parent/children fields in mock
data
- [x] All snapshot tests updated and passing
- [x] `deno check` passes
- [x] `deno lint` passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 11:25:03 -08:00
peter schilling 51ff1b2db6 Add 'issue commits' command (jj-vcs only) (#79)
use case: 

- you are addressing feedback on an issue ABC-123
- run `linear issue start 123` to re-start that issue
- fire up claude code
- run `! linear issue view` to drop the issue, and comments into context
- run `! linear issue commits` to dump the diff of previous work into
context
- ask claude to address the feedback (it will have a much better shot of
knowing what you are talking about)
2025-12-14 08:33:34 -08:00
Peter Schilling cf0d28a720 Add OSC-8 hyperlink support for images in comments
Extend hyperlink support to work consistently for both issue descriptions
and comments by using charmd markdown rendering with OSC-8 extensions.

- Use renderMarkdown with extensions for comment body rendering
- Remove formatWrappedText function, replaced by markdown rendering
- Pass extensions array through captureCommentsForTerminal function
- Apply proper indentation to rendered reply comments

Claude-session-id: 49101792-03cc-423f-8162-4e8fd125d1b4
2025-12-03 22:51:49 -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 8a42357827 Make issue-view test deterministic
Fix flaky test that was failing due to non-deterministic port numbers
in error messages and Docker listening on the hardcoded test port.

- Change test endpoint from port 3000 to 59123 to avoid Docker
  conflicts that caused timeouts
- Normalize ephemeral port numbers in error messages to a stable
  placeholder (127.0.0.1:PORT)

Claude-session-id: a1a55e89-c333-41b3-8034-b9cbe6514ad3
2025-12-02 22:56:00 -08:00
Peter Schilling b180452c5c update snapshots 2025-12-01 21:20:46 -08:00
Peter Schilling 77dd899d47 change format of issue describe output (jj-vcs)
this also adds --references flag for non-closing linear magic words (jj-vcs)

Claude-session-id: 7d48da37-dc2f-4c72-9570-f4500f227643
2025-12-01 09:24:02 -08:00
Talles Borges 70f7b1c3f6 fix: add type annotation to fetchIssuesForState result
- Add GetIssuesForStateQuery type import
- Add explicit type annotation for result variable in pagination loop
- Update snapshot tests to reflect new --limit option in help text
- Fixes TypeScript type checking error (TS7022)
2025-11-24 10:49:06 -03:00
Peter Schilling ba64feb590 update test snapshots 2025-11-23 22:27:02 -08:00
Talles Borges 1a9d4e444d feat: include issue state in --json output
- Add state field to fetchIssueDetails GraphQL queries
- Include state (name and color) in JSON output
- Update tests and snapshots to include state field
2025-11-23 13:20:16 -03:00
Talles Borges b84cca942c chore: remove orphaned reply command snapshot file 2025-11-19 15:56:33 -03:00
Talles Borges d51e6dc88d feat: add issue comment list command
- Add 'issue comment list' command to display threaded comments
- Support --json flag for JSON output
- Display comment IDs in brackets for easy reference in update/delete operations
- Threads replies under parent comments with consistent indentation
- Sort root comments newest-first, replies chronological within thread
- Add comprehensive snapshot tests covering basic list, JSON output, and empty cases
- All tests passing
2025-11-19 15:48:11 -03:00
Talles Borges b2eb740511 Update snapshots for comment add tests 2025-11-19 15:09:07 -03:00
Talles Borges f33793bef1 Add test for reply functionality with --parent flag 2025-11-19 15:08:42 -03:00
Talles Borges f06e198b1e Merge reply command into add command with --parent flag
- Remove separate commentReplyCommand and issue-comment-reply.ts
- Add --parent flag to comment add command for replying to comments
- Both issueId and parentId are now included in mutation input
- Fetch existing comment body for update command prompt default
- Update issue-comment.ts to remove reply command registration
- Delete orphaned issue-comment-reply.test.ts
2025-11-19 15:07:16 -03:00
Talles Borges 1cfafca0f4 refactor: remove --json option from comment commands 2025-11-18 21:59:51 -03:00
Talles Borges 382be7f3db feat: add issue comment management commands
- Add 'linear issue comment' subcommand group
- Implement add, reply, and update subcommands for managing issue comments
- Includes tests and snapshot files for all three subcommands
- Support for both interactive and flag-based input
- JSON output option for programmatic use
2025-11-18 17:26:16 -03:00
Peter Schilling ee2fb3f6b6 Add JSON output support to issue view command
Implement a --json flag for the linear issue view command to output
issue data in JSON format, enabling better integration with scripts
and other tools.

- Add -j/--json flag to output raw issue data as formatted JSON
- Modify spinner logic to avoid interfering with JSON output
- Include comprehensive test coverage for JSON output scenarios
- Update snapshots to validate JSON output format

Fixes #25

Claude-session-id: 3f32bad3-84d3-42d5-84ce-77b7628ca1ce
2025-10-22 08:41:04 -07:00
Peter Schilling 7515c537d5 chore: lint 2025-10-21 11:59:38 -07:00
Peter Schilling e8f73717b7 Add 'issue describe' command
Implement a new describe command that outputs the issue title and
Linear-issue trailer in a simple format, without markdown parsing or
description content. This complements the existing commit-message
command with a lightweight alternative.

- Create issue-describe.ts with new describe command
- Add describe to issue command routing
- Include comprehensive snapshot tests for help, successful output,
  and error handling

Claude-session-id: 8f5b0675-298f-4694-8cd4-109cc46d8066
2025-10-20 21:22:35 -07:00
Peter Schilling 4bb3bef0c7 change formatting rules: no prose wrap, no semi colons 2025-09-02 22:13:34 -07:00
Peter Schilling 094dbb90c5 chore: Release linear-cli version 1.1.1 2025-09-02 21:50:40 -07:00
Peter Schilling 2befc8f0af CLI-57 Setting a label on an issue should be case-insensitive (#53)
https://linear.app/schpet/issue/CLI-57/setting-a-label-on-an-issue-should-be-case-insensitive
2025-08-22 21:34:52 -07:00
Peter Schilling f5e1043de7 update tests 2025-08-21 13:14:35 -07:00
Peter Schilling cf51a9ea89 include id in teams list 2025-08-20 11:54:08 -07:00
Peter Schilling 7936bcfd70 Avoid colors in snapshot tests 2025-08-19 22:27:43 -07:00
Peter Schilling 5564b76cdb Fix test 2025-08-19 22:23:41 -07:00
Peter Schilling 6c329201ca add linear team create comand 2025-08-19 21:53:25 -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 e078475eec add team list command 2025-08-15 10:34:03 -07:00
Peter Schilling 11234ec2e1 add project list / view commands 2025-08-15 10:16:26 -07:00
Peter Schilling f73bb4cbeb CLI-27 Print comments when viewing an issue (#48)
https://linear.app/schpet/issue/CLI-27/add-a-comments-flag-to-linear-issue-view-to-include-comments

show comments by default in linear issue view, use --no-comments to
disable
2025-08-14 22:01:23 -07:00
Peter Schilling c125a2e805 test issue-create 2025-08-14 19:51:32 -07:00