# aigc

> Generate content for you with OpenAI

Latest version **1.0.3** (published 2023-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install aigc
pnpm add aigc
yarn add aigc
bun add aigc
```

Provides the command `aigc`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-03-01 |
| First published | 2023-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=14.18.0 |
| Dependencies | 3 |
| Unpacked size | 614.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Mora |
| Maintainers | qiu8310 |

## Links

- npm: https://www.npmjs.com/package/aigc
- npm.io page: https://npm.io/package/aigc

## Dependencies (3)

- [ora](https://npm.io/package/ora.md) ^6.1.2
- [clipboardy](https://npm.io/package/clipboardy.md) ^3.0.0
- [gpt-3-encoder](https://npm.io/package/gpt-3-encoder.md) ^1.1.4

## Recent versions

- 1.0.3 (latest) — 2023-03-01
- 1.0.2 — 2023-03-01
- 1.0.1 — 2023-03-01
- 1.0.0 — 2023-03-01

## README

# aigc

Generate content for you with OpenAI


## Installation

> require `node >= 14`


```bash
npm i -g aigc
```

## Usage

The library needs to be configured with your account's secret key which is available on the [website](https://beta.openai.com/account/api-keys). Set it as the `OPENAI_API_KEY` environment variable before using the library:

```bash
export OPENAI_API_KEY='sk-...'
```

### Command-line interface

This library additionally provides an `aigc` command-line utility which makes it easy to interact with the API from your terminal. Run `aigc -h` for usage.

```bash
# list models
aigc list-models
# create a completion
aigc --prompt "Write unit test for the code below" path/to/your/codeFile
# create image
aigc image "cute cat"
```

#### Example 1: Generate document comment for function

![Generate document comment](https://mdn.alipayobjects.com/huamei_am125r/afts/img/A*_gezSIVeBHoAAAAAAAAAAAAADjp-AQ/original)


#### Example 2: Generate unit test for function

![Generate unit test](https://mdn.alipayobjects.com/huamei_am125r/afts/img/A*ng82S7WiUEsAAAAAAAAAAAAADjp-AQ/original)


<!--
## Roadmap

If you have ideas for releases in the future, it is a good idea to list them in the README.
-->

## Changelog

[Changelog](./CHANGELOG.md)


## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.


## License

[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/aigc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
