I just used python pexpect [0] for a fun project. I believe pexpect was inspired by the original Unix expect command. I used it to let aider suggest and run shell commands [1]. This is handy, so aider can offer to run the code it just wrote for you, run migrations, install dependencies, etc. Using pexepect makes it easy for aider to run interactive shell commands and capture their output. This allows aider to fix bug…
wait so if i understand you correctly, 1. aider makes some change 2. aider then tells itself to use pexpect to check what changes it made 3. pexpect runs, opens browser somehow captures error messages if any and feeds that back? i am pretty sure i misunderstood something
But ya, aider can: code something for you, run it, capture the terminal output with pexpect and iterate further based on that.