Skip to content

Commit

Permalink
clean up README
Browse files Browse the repository at this point in the history
  • Loading branch information
skelouse committed Nov 28, 2024
1 parent 450e1e5 commit 3f78576
Showing 1 changed file with 39 additions and 32 deletions.
71 changes: 39 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,78 @@
# code-to-gpt

`code-to-gpt` is a Go program that reads the contents of the current working directory and its subdirectories up to a maximum recursion depth of 20. The program writes the relative path of each file as a comment, followed by the file's content, to multiple files named "send1-3.gpt", "send2-3.gpt", and "send3-3.gpt" (representing 1 out of 3, 2 out of 3, and 3 out of 3, respectively). This tool is useful for analyzing and discussing code projects with AI language models like OpenAI's ChatGPT.
`code-to-gpt -c` parses current working directory and outputs each file to clipboard. Each file will have a comment of the file location.

## Simple `code-to-gpt -c` example
> For example given a directory:
[code-to-gpt-ex.webm](https://github.com/skelouse/code-to-gpt/assets/42463301/842eca5d-f6d4-4dd3-b89f-c8b6503cb7bb)
```
├── lib
│ └── hello.go
```

## Installation
> Running the following commands
```shell
go install github.com/skelouse/code-to-gpt@latest
cd lib
code-to-gpt -c
```

## Usage
> Will write this to your clipboard
1. Run `code-to-gpt`
2. Paste into chat.
3. ???
4. Write great code.
```
-------------------------------------------------------------------------------
// hello.go
package lib
### Example Session
import (
"fmt"
)
```shell
# Command with new flags
code-to-gpt --split-files
fmt.Println("Hello, world!")
```

# Or if you want to copy the output to the clipboard
code-to-gpt --c
## Installation

```shell
go install github.com/skelouse/code-to-gpt@latest
```


## Super Diff

The super-diff.sh script is a utility to output all un-staged changes to a git repository. It works by performing a git diff on un-staged files, displaying the output in the terminal. You can easily redirect the output to a file or copy it to your clipboard.

### Why?
> Note: If you have a problem run `git reset`
When working with ChatGPT and running super-diff.sh, you can generate a clean representation of your changes and incorporate it into a prompt. This way, you can maintain the context of your work and get more accurate responses. I have personally used this when developing an API, simply prompt chatGPT for the initial API calls, then use super-diff.sh to show what was done. Then I can paste it back in as `Awesome thanks! This is what I did {super-diff.sh output} now I would like to implement calls X, Y and Z`.
The super-diff.sh script is a utility to output all un-staged changes of a local git repository. It uses a diff on un-staged files, displaying the output in the terminal. You can easily redirect the output to a file or copy it to your clipboard.

Note: If you have a problem `git reset`

### Examples

```shell
# Redirect output to a file
> Redirect output to a file
```sh
$ ./super-diff.sh > diff.txt
```

> Copy output to clipboard (Linux)
```shell
# Copy output to clipboard (Linux)
$ ./super-diff.sh | xclip -selection clipboard
```

> Copy output to clipboard (MacOS)
# Copy output to clipboard (MacOS)
```shell
$ ./super-diff.sh | pbcopy
```

You can also write it as a function in your bashrc or zshrc file:
> Or write it as a function in your .bashrc or .zshrc
> (linux)
```shell
# (linux)
function super-diff() {
./super-diff.sh | xclip -selection clipboard
}
```

# (MacOS)
> (MacOS)
```shell
function super-diff() {
./super-diff.sh | pbcopy
}
Expand Down

0 comments on commit 3f78576

Please # to comment.