NEW AI Coding Assistant 🤖 Use Prompts To Build New Or EXISTING Apps! (Aider, The Holy Grail)

Aider Github – https://github.com/paul-gauthier/aider
Universal CTags – https://github.com/universal-ctags/ctags
OpenAI API Keys – https://platform.openai.com/docs/api-reference/introduction
Install Bash on Windows by installing a GIT Client – https://git-scm.com/downloads
Install Conda in Ubuntu WSL2 – [Setting up Jupyter using Conda in WSL2]

Homebrew – https://brew.sh/

Install Homebrew on Ubuntu WSL2:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Homebrew in the Anaconda terminal.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Reopen the terminal to have Homebrew in your path.

If Homebrew is not in your path, add Homebrew to your path:

(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/$USER/.bashrc

In the Windows Anaconda (miniconda) terminal, open bash. (The bash version that opens needs to be the Linux bash version from WSL2)
bash

Fix Conda on the Ubuntu WSL2.
source ~/anaconda3/etc/profile.d/conda.sh

Use Ubuntu WSL2 or open the Anaconda terminal: (careful with the –name dashes, copy/paste can paste the wrong ascii dash so just type it)
conda create –name aider python=3.11.3
conda activate aider
export OPENAI_API_KEY=12345
brew install universal-ctags

Check if ctags is installed:
ctags --version

Install Aider:
pip install aider-chat

Use Aider to create a Snake game.
mkdir snake
cd snake
aider
create the game snake using python

To get Aider to actually write the changes to snake.py I needed another prompt.
save the changes to snake.py

In another terminal Window open VS Code to run the generated Python.
cd snake
code .

AI was able to slow down the speed of the snake.
can you slow down the movement speed by half

AI was able to add early quiting the game.
I want to be able to quit while in game by pressing q

AI had trouble increasing the tile size and stopped being able to pick up food.
Can you make the snake game use larger tiles?

I would recommend commit/push the files every time the AI makes a change and it works. That way you can revert the change if the AI breaks something.

Ollama is the single easiest way to run AI models on your laptop

[ollama.ai]

[Github Ollama Project]

[Python Ollama Project]

pip install ollama

Add your local Python scripts folder to your path:

%localappdata%\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts

%localappdata%\Programs\Python\Python38\Scripts

Models are downloaded to %userprofile%.ollama\models.

ollama search

Found 6 available models:
orca_mini_3b
orca_mini_7b
orca_mini_13b
replit_code_3b
nous_hermes_13b
wizard_vicuna_13b_uncensored

ollama run wizard_vicuna_13b_uncensored

You can change Ollama to not print the prompt.

%localappdata%\Programs\Python\Python38\Lib\site-packages\ollama\cmd\cli.py

def generate(*args, **kwargs):
    if prompt := kwargs.get("prompt"):
        #print(">>>", prompt, flush=True)
        generate_oneshot(*args, **kwargs)
        return

    if sys.stdin.isatty():
        return generate_interactive(*args, **kwargs)

    return generate_batch(*args, **kwargs)