gw-ghostwriter

1.0.36 • Public • Published

logo

Ghostwriter is a tool designed to streamline the process of creating pull requests (PRs) by automatically generating them based on the changes made in your working branch compared to the main branch.

By analyzing a customizable PR template provided by you, Ghostwriter leverages the capabilities of artificial intelligence to craft clear and concise PRs, saving you time and effort in the code review process.

Experimental Phase

  • The tool is a side project and currently in an experimental phase. Installation, as outlined below, may not fully result in the intended functionality.
  • Uninstalling is not working at the moment . You are not going to able to remove all ghostwriter files from your project by just running uninstall.

Getting Started

Disclaimer: Ghostwriter employs GPT-4-turbo for crafting your Pull Request. To utilize this tool, you'll need an account with sufficient funds on OpenAI, which can be obtained at https://platform.openai.com/. Ghostwriter will evaluate the differences between the working branch and the main branch using the git diff command. Consequently, the greater the extent of your changes, the more funds Ghostwriter will consume. For more insights into how GPT consumes your funds, please refer to the tokenizer.

  1. Begin by inserting your organization ID and API keys into the .env file:
 OPENAI_ORGANIZATION_ID="your_org_id"
 OPENAI_API_KEY="your_open_ai_key"
  1. Install the npm package:
  npm install gw-ghostwriter
  1. Configure the template to suit your preferences:
  • After installing Ghostwriter, a default template will be created under the file ghostwriter-template.md. You can configure according to your liking by just adding what you would like ghostwriter to follow.

  • Now, you can continue working as usual. When you attempt to push your branch, Ghostwriter will seamlessly take action, composing the PR for you.

Ghostwriter in action

gw-gif

Generated PR from the example above

  • In the example above, we created a new branch feature and have systematically excluded the initial elements from a basic Next.js application and introduced a straightforward <h1> tag containing the greeting text. The corresponding pull request (PR) reflecting these changes is provided below:
### Description
- The code changes in this pull request involve several div elements and modifying the content inside the main element. Specifically, the following changes have been made: 
  - The `<p>` element with the text "Get started by editing src/app/page.tsx has been removed.
  - The `<div>` element containing the Vercel logo and link has been removed.
  - The `<div>` element with the Next.js logo has been removed.
  - The grid layout with four `<a>` elements has been removed.
  - a New `<h1>` element with the text "Hello" has been added inside the main element.

### Changes
- Removed unecessary div elements.
- Added a new h1 element with the text "Hello".

### Testing
- Tested the changes locally to ensure that the page renders withou any errors.
- Verfified that the "Hello" text is displayed correctly on the page.
- Checked the layout and styling of the page to ensure that it still looks visually appealing

Important

Limitation of Liability: The use of Ghostwriter is at your own risk. We do not provide any warranty or guarantee regarding its functionality. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability.

OpenAI Terms of Service: By using Ghostwriter, you agree to comply with OpenAI's Terms of Service.

Usage Costs: Using Ghostwriter will consume funds from your OpenAI account. Costs are calculated based on the extent of your changes. Please review your OpenAI account settings for more information on pricing.

Privacy Policy: Ghostwriter does not collect any personal data from users. However, it interacts with OpenAI's API, and users are subject to OpenAI's privacy policy. Please review OpenAI's Privacy Policy for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i gw-ghostwriter

Weekly Downloads

3

Version

1.0.36

License

ISC

Unpacked Size

8.45 kB

Total Files

5

Last publish

Collaborators

  • mateussenne