From afc8fe3b11d4cb4d958c5a37b0ba2e35eb2aa534 Mon Sep 17 00:00:00 2001 From: Peter Schilling Date: Tue, 27 Jan 2026 13:07:42 -0800 Subject: [PATCH] fix: issue list --web/--app respects --team flag and works without workspace - Pass team option through to openTeamAssigneeView when using --web or --app - Accept team parameter in openTeamAssigneeView function - Fetch workspace from viewer's organization when not configured --- CHANGELOG.md | 1 + src/commands/issue/issue-list.ts | 2 +- src/utils/actions.ts | 26 +++++++++++++++++++------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e88ac98..b31774e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Fix `--assignee self` to correctly resolve to current user ([#104](https://github.com/schpet/linear-cli/pull/104); thanks @JustTrott) +- issue list --web/--app now respects --team flag and works without workspace configured ### Added diff --git a/src/commands/issue/issue-list.ts b/src/commands/issue/issue-list.ts index fc6c311..256ec08 100644 --- a/src/commands/issue/issue-list.ts +++ b/src/commands/issue/issue-list.ts @@ -102,7 +102,7 @@ export const listCommand = new Command() ) => { const usePager = pager !== false if (web || app) { - await openTeamAssigneeView({ app: app }) + await openTeamAssigneeView({ app: app, team }) return } diff --git a/src/utils/actions.ts b/src/utils/actions.ts index 95684c5..c214b34 100644 --- a/src/utils/actions.ts +++ b/src/utils/actions.ts @@ -9,6 +9,8 @@ import { import { getOption } from "../config.ts" import { encodeBase64 } from "@std/encoding/base64" import { getNoIssueFoundMessage, startVcsWork } from "./vcs.ts" +import { gql } from "../__codegen__/gql.ts" +import { getGraphQLClient } from "./graphql.ts" export async function openIssuePage( providedId?: string, @@ -52,8 +54,10 @@ export async function openProjectPage( await open(url, options.app ? { app: { name: "Linear" } } : undefined) } -export async function openTeamAssigneeView(options: { app?: boolean } = {}) { - const teamId = getTeamKey() +export async function openTeamAssigneeView( + options: { app?: boolean; team?: string } = {}, +) { + const teamId = options.team ?? getTeamKey() if (!teamId) { console.error( "Could not determine team id from configuration or directory name.", @@ -61,12 +65,20 @@ export async function openTeamAssigneeView(options: { app?: boolean } = {}) { Deno.exit(1) } - const workspace = getOption("workspace") + let workspace = getOption("workspace") if (!workspace) { - console.error( - "workspace is not set via command line, configuration file, or environment.", - ) - Deno.exit(1) + const client = getGraphQLClient() + const viewerQuery = gql(` + query GetViewerWorkspace { + viewer { + organization { + urlKey + } + } + } + `) + const result = await client.request(viewerQuery) + workspace = result.viewer.organization.urlKey } const filterObj = {