/**
* Issue Commands
* Manage issues from the CLI
*/
import chalk from "chalk";
import { Command } from "commander";
import inquirer from "inquirer";
import ora from "ora";
import { simpleGit } from "simple-git";
import { getWithAuth, patchWithAuth, postWithAuth } from "../../lib/api.js";
import { getConfig } from "../../lib/config.js";
import { getRepoInfoFromGit } from "../../lib/git.js";
const git = simpleGit();
interface Issue {
id: string;
number: number;
title: string;
state: string;
author: { username: string };
createdAt: string;
updatedAt: string;
labels?: { name: string; color: string }[];
assignees?: { username: string }[];
milestone?: { title: string };
}
export const issueCommands = new Command("issue").description("Manage issues");
// Get repo info from git remote
async function getRepoInfo() {
return getRepoInfoFromGit(git);
}
// Issue Create
issueCommands
.command("create")
.description("Create a new issue")
.option("-t, --title
", "Issue title")
.option("-b, --body ", "Issue description")
.option("-a, --assignee ", "Assign to user")
.option(
"-l, --label