Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jcrqr/gh

Module to use GitHub CLI in Deno.
https://github.com/jcrqr/gh

deno gh-cli gh-extension

Last synced: about 1 month ago
JSON representation

Module to use GitHub CLI in Deno.

Awesome Lists containing this project

README

        

# :octocat: gh

> Module to use GitHub CLI (aka `gh`) in Deno. Useful to create [extensions](https://cli.github.com/manual/gh_extension) using Deno.

## Installation

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

## Usage

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

async function gh(cmd: string, options: Options): Promise
```

## Options

```ts
interface Options {
debug?: boolean;
flags?: Record>;
json?: boolean;
}
```

## Example

```ts
import { gh } from "./mod.ts";

const repos = await gh("api users/octocat/repos", {
json: true,
flags: { paginate: true },
}) as Array;

console.log(`@octocat has ${repos.length} repos`);
```

## Permissions

This module requires the `--allow-run` permission.

## Contributing

Please, see [CONTRIBUTING.md](CONTRIBUTING.md) to learn how you can contribute to this repository.

## License

This project is released under the [MIT License](LICENSE).