New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details → →
Socket
Book a DemoSign in
Socket

gptdd

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gptdd

_A single-file, test-driven-development feedback loop with GPT 🌀_

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

gptdd đź§Ş

A single-file, test-driven-development feedback loop with GPT 🌀

How it Works

Given command which runs a test and a file to edit , gptdd feeds the test results to GPT4, requests a fix, and offers the user the option to apply the fix.

đź’­ It would be amazing to build this in at the test runner/IDE-level, but in the interest of it being language and test-runner agnostic, it's a standalone script. If you're interested in building an IDE plugin, please reach out!

gptdd demo fast

Usage

npx gptdd \
  --fileToFix lib/myFunc.ts \
  --testToRun "pnpm vitest run lib/myFunc.test.ts" \
  --apiKey "sk-..."

CLI Options

OptionDescription
--fileToFix, -fThe file to edit.
--testToRun, -tThe command to run once to get the initial test results.
--apiKey, -aYour OpenAI API key.

Specific Examples

The following examples specific to your language/test-runner. If you don't see what you're looking for, please contribute!

Javascript - Vitest

npx gptdd \
  --f lib/myFunc.ts \
  --t "pnpm vitest run lib/myFunc.test.ts" \
  --a "sk-..."

Javascript - Jest

npx gptdd \
  --f lib/myFunc.ts \
  --t "pnpm jest examples/myFunc.test.ts" \
  --a "sk-..."

Development

We recommend using pnpm. Clone the repository, run pnpm install. Then run pnpm link --global to make the gptdd command available globally. From there, you can make tweaks and test them out by running gptdd in a directory with a test and file to fix.

Contributing

We strongly welcome contributions of any kind- simply open a PR explaining what you've changed and why and we'll go from there.

FAQs

Package last updated on 29 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts