Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Aider as Bash helper #2386

Open
luzik opened this issue Nov 16, 2024 · 3 comments
Open

Feature Request: Aider as Bash helper #2386

luzik opened this issue Nov 16, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@luzik
Copy link

luzik commented Nov 16, 2024

Issue

While Sonnet is good at Computer Use https://docs.anthropic.com/en/docs/build-with-claude/computer-use
It would be awesome to Aider have a mode to run not as programmer helper, but in more general shell helper.

Example use case:

aider --bash --sonnet "help me instaling docker from ubuntu repo, and lets create docker-compose with apache+php container"

I belieave, that aider have all ingredients already in place, just mess with prompt and voila!

Version and model info

No response

@paul-gauthier paul-gauthier added the enhancement New feature or request label Dec 3, 2024
@peanbutt
Copy link

peanbutt commented Dec 6, 2024

can i work on this @paul-gauthier

@paul-gauthier
Copy link
Collaborator

I think if you just run aider now it can do this? For example, see below. Aider will offer to run all those commands.

$ aider --sonnet --message "help me instaling docker from ubuntu repo, and lets create docker-compose with apache+php container"
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Aider v0.66.1.dev+import
Model: claude-3-5-sonnet-20241022 with diff edit format, prompt cache, infinite output
Git repo: none
Repo-map: disabled

I'll help you set up Docker and create a docker-compose configuration for Apache + PHP. Let's do this step by step:

 1 First, let's install Docker on Ubuntu. Run these commands:

```
 sudo apt update
 sudo apt install -y docker.io docker-compose
 sudo systemctl enable --now docker
 sudo usermod -aG docker $USER
```

After running these commands, you'll need to log out and log back in for the group changes to take effect.

 2 Let's create a new project directory and the necessary files:

```
 mkdir apache-php-docker && cd apache-php-docker
```

Now, I'll create the necessary files for your Docker setup:

docker-compose.yml
 <<<<<<< SEARCH
 =======
 version: '3'
 services:
   web:
     image: php:8.2-apache
     ports:
       - "80:80"
     volumes:
       - ./src:/var/www/html
     restart: always
 >>>>>>> REPLACE


src/index.php
 <<<<<<< SEARCH
 =======
 <?php
 phpinfo();
 >>>>>>> REPLACE


After these files are created, you can start the containers with:

```
 docker-compose up -d
```

You can then access your PHP application at http://localhost

Some useful commands:

 • To stop the containers: docker-compose down
 • To view logs: docker-compose logs -f
 • To rebuild and restart: docker-compose up -d --build

Would you like to customize the PHP configuration or add more features to this setup?


Tokens: 2.2k sent, 324 received.
Cost: $0.01 message, $0.01 session. Use --no-stream for accurate caching costs.

docker-compose.yml
Create new file? (Y)es/(N)o [Yes]:

@luzik
Copy link
Author

luzik commented Dec 7, 2024

Yeah it is doing great, but I believe it can do much better.

  1. Bash version will be using less tokens than typical coding session, so we can add more useful information in system prompt or in extra prompt before user kick it. As Aider is sending most important information about env like:
SYSTEM Use the appropriate shell based on the user's system info:
SYSTEM - Platform: Linux-6.8.0-49-generic-x86_64-with-glibc2.39
SYSTEM - Shell: SHELL=/usr/bin/zsh
SYSTEM - Language: en_US
SYSTEM - Current date: 2024-12-07
SYSTEM - The user is operating inside a git repository

but in bash mode it can send information about system version (windows 11, ubuntu 22.04, macOS 15.2) about installed packages (rpm -qa, apt, brew), and information about locally installed ones like list files under $PATH that include our home
for example echo $PATH | tr ':' '\n' | grep "^$HOME" | xargs -I {} find {} -type f -executable 2>/dev/null

  1. Bash version should disable any git integration, should write history only to ~/.aider.bash.input.history and not to create files in local directory

  2. Bash version SYSTEM prompt, should encourage model to ask a user to exec some checks before making changes. For example with this docker example, before apt install, it should check if any version is already installed, what package manager should be used, maybe there are files or directory structure that model should know before operates blind. This point will also work instead of suggestion: use a vector-db like pinecone to overcome the token limits? #1 point here.

  3. Maybe there is a place to create some safety checks ? Maybe other session to a model before asking user to exec something with possible harm ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants