Skip to content
/ gh Public

Module to use GitHub CLI in Deno.

License

Notifications You must be signed in to change notification settings

jcrqr/gh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

:octocat: gh

Module to use GitHub CLI (aka gh) in Deno. Useful to create extensions using Deno.

Installation

import { gh } from "https://deno.land/x/[email protected]/mod.ts";

Usage

import { gh } from "https://deno.land/x/[email protected]/mod.ts";

async function gh(cmd: string, options: Options): Promise<unknown>

Options

interface Options {
  debug?: boolean;
  flags?: Record<string, string | number | boolean | Array<string | number | boolean>>;
  json?: boolean;
}

Example

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`);

Permissions

This module requires the --allow-run permission.

Contributing

Please, see CONTRIBUTING.md to learn how you can contribute to this repository.

License

This project is released under the MIT License.

About

Module to use GitHub CLI in Deno.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project