Skip to content

feat: default sort to priority and auto-detect team in issue list#187

Draft
jholm117 wants to merge 1 commit intoschpet:mainfrom
jholm117:feat/issue-list-defaults
Draft

feat: default sort to priority and auto-detect team in issue list#187
jholm117 wants to merge 1 commit intoschpet:mainfrom
jholm117:feat/issue-list-defaults

Conversation

@jholm117
Copy link
Contributor

Summary

  • --sort default: When no sort is specified via flag, config file (issue_sort), or env var (LINEAR_ISSUE_SORT), defaults to "priority" instead of throwing a ValidationError.
  • --team auto-detection: When no team is configured via --team flag or team_id config, fetches the authenticated user's teams via the viewer { teams } GraphQL query:
    • Single team: uses it automatically
    • Multiple teams + interactive TTY: prompts user to select
    • Multiple teams + non-TTY: errors with a list of available teams
    • No teams: errors with guidance to join a team

Both the command-level validation in issue-list.ts and the fetchIssuesForState helper in linear.ts were updated to use the "priority" fallback consistently.

Test plan

  • deno check src/main.ts passes
  • deno lint passes
  • deno task test passes (one pre-existing project-create port-conflict failure, unrelated)
  • Manual: run linear issue list with no --sort flag and no config -- should default to priority sort
  • Manual: run linear issue list with no --team and no config -- should auto-detect or prompt
  • Manual: run linear issue list --sort manual -- should still work as before
  • Manual: run linear issue list --team XYZ -- should still work as before

🤖 Generated with Claude Code

Instead of hard-erroring when --sort or --team are omitted from
`issue list`, provide sensible defaults:

- --sort: falls back to "priority" when not set via flag, config, or
  env var
- --team: when not configured, fetches the viewer's teams. If the user
  belongs to one team, uses it automatically. If multiple teams exist,
  prompts interactively (or errors with a helpful list in non-TTY mode).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant