Module to use GitHub CLI (aka
gh
) in Deno. Useful to create extensions using Deno.
import { gh } from "https://deno.land/x/[email protected]/mod.ts";
import { gh } from "https://deno.land/x/[email protected]/mod.ts";
async function gh(cmd: string, options: Options): Promise<unknown>
interface Options {
debug?: boolean;
flags?: Record<string, string | number | boolean | Array<string | number | boolean>>;
json?: boolean;
}
import { gh } from "./mod.ts";
const repos = await gh("api users/octocat/repos", {
json: true,
flags: { paginate: true },
}) as Array<unknown>;
console.log(`@octocat has ${repos.length} repos`);
This module requires the --allow-run
permission.
Please, see CONTRIBUTING.md to learn how you can contribute to this repository.
This project is released under the MIT License.