# fixgpt

> Tool that helps you do mass changes across your codebase

Latest version **0.5.2** (published 2023-05-04) · ISC license · 0 weekly downloads

## Install

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

Provides the command `fixgpt`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2023-05-04 |
| First published | 2023-05-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 20.8 KB |
| Known vulnerabilities | 0 (+8 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | kelin2025 |
| Keywords | cli, npmtool |

## Links

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

## Dependencies (10)

- [got](https://npm.io/package/got.md) ^12.6.0
- [glob](https://npm.io/package/glob.md) ^10.2.2
- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [openai](https://npm.io/package/openai.md) ^3.2.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1
- [nanoclone](https://npm.io/package/nanoclone.md) ^1.0.1
- [safe-eval](https://npm.io/package/safe-eval.md) ^0.4.1
- [markdown-it](https://npm.io/package/markdown-it.md) ^13.0.1
- [lodash.snakecase](https://npm.io/package/lodash.snakecase.md) ^4.1.1
- [@inquirer/prompts](https://npm.io/package/@inquirer/prompts.md) ^1.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.5.2 (latest) — 2023-05-04
- 0.5.1 — 2023-05-04
- 0.4.1 — 2023-05-04
- 0.4.0 — 2023-05-04
- 0.3.0 — 2023-05-04
- 0.2.0 — 2023-05-04
- 0.1.6 — 2023-05-03
- 0.1.5 — 2023-05-03
- 0.1.4 — 2023-05-03
- 0.1.3 — 2023-05-03
- 0.1.2 — 2023-05-03
- 0.1.1 — 2023-05-03
- 0.1.0 — 2023-05-03

## README

# fixgpt

Tool that helps you do mass changes across your codebase

- Create new files
- Mass refactoring
- Remove files upon certain conditions
- Code execution

## Watch a demo

- Code generation - [**link**](https://www.loom.com/share/78f5874842c9438bb18042cfd8f75e4f)
- Mass Update - [**link**](https://www.loom.com/share/c8a44ba7d0c34d0c87fd8991556814c2)
- Parameters - [**link**](https://www.loom.com/share/582d4e86967c4637abe27157064ba99d)

## Installation

Install from NPM:

```bash
npm i fixgpt -g
```

Or just use NPX:

```bash
npx fixgpt <command> <arg1> <arg2>
```

## Before use

`fixgpt` will go over your files and will edit them according your request.

It is recommeneded to use GIT (or other VCS) and check the diff of changes yourself, once `fixgpt` is done.

It is necessary as LLM models are not 100% safe at producing reliable code.

## How to use?

### 1. Initialize using your OpenAI access token

```bash
fixgpt init <openai_token>
```

`init` command creates a local `.fixgpt` folder with config.

> **CAUTION:** Make sure to add it to `.gitignore` file of your project in order to not leak your API keys

### 2. Create a template

```bash
fixgpt create-template ./template.md
```

This will create a Markdown file with a template which then can be used in `run-template` command

### 3. Run it

```bash
fixgpt run-template ./template.md
```

Then grab some coffee and see it working :)

> **NOTE:** OpenAI doesn't allow running multiple requests in parallel, so if you have like 100 files, it will be slow. It can be cheated by using multiple accounts but currently it's not supported

## PRO Stuff

### Tokens

You can put specific tokens into a template in order to ask for some data or use previous responses.

- `[[args.input.ArgumentName]]` - asks for `ArgumentName` **before** execution
- `[[ask.input.ArgumentName]]` - asks for `ArgumentName` **during** execution (unlike the previous one, this one will be asked separately for each file in "Mass Update")
- `[[responses.0.code]]` - code from task response (where `0` is an index of the task)
- `[[responses.0.file]]` - filename from task (where `0` is an index of the task)

## TODO

- [x] Create/remove files API
- [x] Take variables from CLI
- [ ] Run without template
- [ ] Run another template
- [ ] Support other models (only GPT 3.5 for now)
- [ ] Parallel threads support

## Support

[![Buy Me a Coffee](https://storage.ko-fi.com/cdn/kofi2.png?v=3)](https://ko-fi.com/M4M3KZ70G)

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