UNPKG

gaunt-sloth-assistant

Version:

[![Tests and Lint](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/Galvanized-Pukeko/gaunt-sloth-assistant/actions/workflows/unit-tests.yml) [![Integration Tests](https://github.co

33 lines 1.21 kB
import { displayWarning } from '#src/consoleUtils.js'; import { execAsync, ProgressIndicator } from '#src/utils.js'; /** * Gets GitHub issue using GitHub CLI * @param _ config (unused in this provider) * @param issueId GitHub issue number * @returns GitHub issue content or null if not found */ export async function get(_, issueId) { if (!issueId) { displayWarning('No GitHub issue number provided'); return null; } try { // Use the GitHub CLI to fetch issue details const progress = new ProgressIndicator(`Fetching GitHub issue #${issueId}`); const issueContent = await execAsync(`gh issue view ${issueId}`); progress.stop(); if (!issueContent) { displayWarning(`No content found for GitHub issue #${issueId}`); return null; } return `GitHub Issue: #${issueId}\n\n${issueContent}`; } catch (error) { displayWarning(` Failed to get GitHub issue #${issueId}: ${error instanceof Error ? error.message : String(error)} Consider checking if gh cli (https://cli.github.com/) is installed and authenticated. `); return null; } } //# sourceMappingURL=ghIssueProvider.js.map