diff --git a/README.md b/README.md index 9580a6e95..1501f8af2 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ Each change is automatically committed to git with a sensible commit message. Here are some example transcripts that show how you can chat with `aider` to generate and edit code with GPT-4. -* [Hello World Flask App](examples/hello-world-flask.md): This example demonstrates how to create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence. +* [Hello World Flask App](examples/hello-world-flask.md): Creating a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence. -* [2048 Game Modification](examples/2048-game.md): This example demonstrates how to explore and modify an open-source javascript 2048 game codebase, including adding randomness to the scoring system. +* [Pong Game with Pygame](examples/pong.md): Creating a simple Pong game using the Pygame library, with customizations for paddle size and color, and ball speed adjustments. -* [Pong Game with Pygame](examples/pong.md): This example demonstrates how to create a simple Pong game using the Pygame library, with customizations for paddle size and color, and ball speed adjustments. +* [2048 Game Modification](examples/2048-game.md): Exploring and modifying an open-source javascript repo for the 2048 game, including adding randomness to the scoring system. -* [Complex Multi-file Change with Debugging](examples/complex-change.md): This example demonstrates a complex code change involving multiple source files and debugging with the help of `aider`. +* [Complex Multi-file Change with Debugging](examples/complex-change.md): A complex code change involving multiple source files and debugging. You can find more chat transcripts on the [examples page](examples/README.md). diff --git a/examples/2048-game.md b/examples/2048-game.md index d49ace635..03adfd1eb 100644 --- a/examples/2048-game.md +++ b/examples/2048-game.md @@ -7,7 +7,7 @@ Notice that GPT-4 asks to see a particular source file, and aider automatically ## Chat transcript -> 2048$ aider +> $ aider #### > what is this repo? Based on the file names you provided, it seems like this repository is for a web-based game, possibly a 2048 game clone. The files include JavaScript files for game logic, HTML and CSS files for the user interface, and various meta files for icons and touch startup images. diff --git a/examples/README.md b/examples/README.md index b4d8e3ea4..778f56616 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,33 +1,27 @@ -# Example chats using `aider` to code with GPT-4 +# What's it like to code with GPT-4? -Below are some example chat transcripts that show how you can chat with -the `aider` command line tool -to generate and edit code with GPT-4. +Below are some chat transcripts showing what it's like to code with the help of GPT-4. They were recorded using the [aider command line tool](https://github.com/paul-gauthier/aider). +In the chats, you'll see a varity of coding tasks like generating new code, editing existing code, debugging, exploring unfamiliar code, etc. It's worth noting that: -There are a few things worth taking note of: + - Each time GPT-4 suggests a code change, `aider` automatically applies it to the source files. + - After applying the edits, `aider` commits them to git with a senisble commit message. + - `aider` notes each time a source file is added to the chat session. Once added, these files are available for review and editing by GPT-4. The user adds files either via the command line or the in-chat `/add` command. If GPT-4 asks to see specific files, `aider` asks the user for permission to add them to the chat. - - `aider` will note when source files are added to the chat session. Once added, these files are available for review and editing by GPT-4. Files can be added from the command line, or in-chat with the `/add` command. Sometimes GPT-4 requests to see specific files, and `aider` adds them after the user approves. - - Code edits that GPT-4 suggests are automatically applied to the source files by `aider`. - - After applying the edits, `aider` will commit them to git with a senisble commit message. +## Chat transcripts of coding sessions with GPT-4 -## Example chat transcripts +* [Hello World Flask App](hello-world-flask.md): Creating a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence. -There are a varity of example coding chat sessions included, -accomplishing both greenfield generation of new code as well as simple and more complex edits to larger codebases: +* [Pong Game with Pygame](pong.md): Creating a simple Pong game using the Pygame library, with customizations for paddle size and color, and ball speed adjustments. -* [Hello World Flask App](hello-world-flask.md): This example demonstrates how to create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence. +* [2048 Game Modification](2048-game.md): Exploring and modifying an open-source javascript repo for the 2048 game, including adding randomness to the scoring system. -* [2048 Game Modification](2048-game.md): This example demonstrates how to explore and modify an open-source javascript 2048 game codebase, including adding randomness to the scoring system. +* [Complex Multi-file Change with Debugging](complex-change.md): A complex code change involving multiple source files and debugging. -* [Pong Game with Pygame](pong.md): This example demonstrates how to create a simple Pong game using the Pygame library, with customizations for paddle size and color, and ball speed adjustments. +* [Semantic Search & Replace](semantic-search-replace.md): Updating a collection of function calls, which requires dealing with various formatting and semantic differences in the various function call sites. -* [Complex Multi-file Change with Debugging](complex-change.md): This example demonstrates a complex code change involving multiple source files and debugging with the help of `aider`. +* [CSS Exercise: Animation Dropdown Menu](css-exercises.md): A small CSS exercise involving adding animation to a dropdown menu. -* [Semantic Search & Replace](semantic-search-replace.md): This example showcases `aider` performing semantic search and replace operations in code, dealing with various formatting and semantic differences in the function calls that it updates. - -* [CSS Exercise: Animation Dropdown Menu](css-exercises.md): This example demonstrates how to complete a CSS exercise involving adding animation to a dropdown menu, creating a bounce illusion when the dropdown expands close to its final end state. - -* [Automatically Update Docs](update-docs.md): This example demonstrates how to use `aider` to automatically update documentation based on the latest version of the main() function in the code. +* [Automatically Update Docs](update-docs.md): Automatically updating documentation based on the latest version of the main() function. ## Transcript formatting @@ -36,13 +30,13 @@ accomplishing both greenfield generation of new code as well as simple and more #### > The user's chat messages are bold and shown on a prompt line like this. They contain they user's change requests, clarifications, etc. Responses from GPT-4 are in a plain font like this, and often include colorized "edit blocks" that specify edits to the code. -Here's a sample edit block that switches from printing a blank line to printing "hello world" in the file `hello.py`: +Here's a sample edit block that switches from printing "hello" to "goodbye": ```python hello.py <<<<<<< ORIGINAL -print() +print("hello") ======= -print("Hello world!") +print("goodbye") >>>>>>> UPDATED ``` diff --git a/examples/complex-change.md b/examples/complex-change.md index f7878b1ac..a04f888d4 100644 --- a/examples/complex-change.md +++ b/examples/complex-change.md @@ -4,13 +4,13 @@ This is a chat transcript of a fairly complex code change. The user is trying to update tests to use an input mock provided by prompt_toolkit. This requires changes to multiple source files. Some things to notice: - - The initial changes from `aider` don't work, so the user provides error messages and doc snippets to collaboratively debug and solve the problem. + - The initial changes don't work, so the user provides error messages and doc snippets to collaboratively debug and solve the problem. - The user edits a file outside the chat using their editor. `aider` notices these out-of-band changes and offers to commit them. - At one point the user hits `^C` to interrupt the GPT-4 response, since it's not a useful response. The user gives clarifications and gets a better result on the next reply. ## Chat transcript -> aider-repo$ aider tests/test_main.py aider/getinput.py +> $ aider tests/test_main.py aider/getinput.py > Added tests/test_main.py to the chat > Added aider/getinput.py to the chat diff --git a/examples/css-exercises.md b/examples/css-exercises.md index 225e30d6a..94efc6438 100644 --- a/examples/css-exercises.md +++ b/examples/css-exercises.md @@ -1,11 +1,11 @@ # Complete a css exercise with aider and GPT-4 -In this chat transcript, the user asks aider about the CSS Exercises repo https://github.com/TheOdinProject/css-exercises/tree/main and completes an animation exercise. +In this chat transcript, the user asks about the CSS Exercises repo https://github.com/TheOdinProject/css-exercises/tree/main and completes an animation exercise. ## Chat transcript -> css-exercises$ aider +> $ aider #### > what is this repo? Based on the file list provided, it seems like this repository contains a collection of CSS and HTML exercises, solutions, and examples. The exercises cover various topics such as Flexbox, Grid, Animation, Foundations, and Margin & Padding. The repository also includes images and other assets used in the exercises. diff --git a/examples/hello-world-flask.md b/examples/hello-world-flask.md index 9508572bc..dd96cc2e2 100644 --- a/examples/hello-world-flask.md +++ b/examples/hello-world-flask.md @@ -1,11 +1,11 @@ # Create a simple flask app with aider and gpt-4 -In this chat transcript, the user asks aider to make a simple flask app with various endpoints. +In this chat transcript, the user asks to make a simple flask app with various endpoints. ## Chat transcript -> hello-world-flask$ aider app.py +> $ aider app.py > Creating empty file app.py > Added app.py to the chat diff --git a/examples/pong.md b/examples/pong.md index 4c0f24358..257dd1d1b 100644 --- a/examples/pong.md +++ b/examples/pong.md @@ -1,12 +1,12 @@ # Build pong with aider, gpt-4 and pygame. -In this chat transcript, the user asks aider to make a pong game using pygame. +In this chat transcript, the user asks to make a pong game using pygame. After setting up a basic game, the user asks for some customization of the colors and game mechanics. ## Chat transcript -> pong$ aider +> $ aider #### > can you make a simple game of pong with pygame? diff --git a/examples/semantic-search-replace.md b/examples/semantic-search-replace.md index 0b03c3ae6..647d6e333 100644 --- a/examples/semantic-search-replace.md +++ b/examples/semantic-search-replace.md @@ -1,15 +1,15 @@ # Semantic search & replace code with aider and gpt-4 -In this chat transcript, the user asks aider to modify a series of function calls. +In this chat transcript, the user asks to modify a series of function calls. Notice that it isn't replacing exact strings. -Aider deals with various formatting and semantic differences in the calls that it is updating. +Making the change requires dealing with various formatting and semantic differences in the calls that it is updating. Some edits were elided from this transcript for brevity. ## Chat transcript -> aider-repo$ aider aider/coder.py +> $ aider aider/coder.py > Added aider/coder.py to the chat #### > replace all the self.console.print() calls that contain [red] with calls to self.io.tool_error() with [red] removed from the string diff --git a/examples/update-docs.md b/examples/update-docs.md index 0ac963da2..896944bfa 100644 --- a/examples/update-docs.md +++ b/examples/update-docs.md @@ -1,10 +1,10 @@ # Automatically update docs with aider and gpt-4 -> In this chat transcript, the user asks aider to automatically update the Usage docs based on the latest version of the main() function in the code. +> In this chat transcript, the user asks to automatically update the Usage docs based on the latest version of the main() function in the code. ## Chat transcript -> aider-repo$ aider ./README.md aider/main.py +> $ aider ./README.md aider/main.py > Added README.md to the chat > Added aider/main.py to the chat