https://github.com/jcrqr/gh
Module to use GitHub CLI in Deno.
https://github.com/jcrqr/gh
deno gh-cli gh-extension
Last synced: 6 months ago
JSON representation
Module to use GitHub CLI in Deno.
- Host: GitHub
- URL: https://github.com/jcrqr/gh
- Owner: jcrqr
- License: mit
- Created: 2021-09-11T09:07:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-11T09:07:50.000Z (over 4 years ago)
- Last Synced: 2025-08-17T16:39:50.299Z (6 months ago)
- Topics: deno, gh-cli, gh-extension
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
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/gh@v0.0.1/mod.ts";
```
## Usage
```ts
import { gh } from "https://deno.land/x/gh@v0.0.1/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).