You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, aider tries to write history files to $CWD. This should provide good context if, say, I'm returning to a repo where I've previously used aider.
On the other hand, let's say I just have an off-hand question and I happen to be outside a Git repo in a random directory on my filesystem (~/Desktop, for example). If I start aider in this directory (or any dir not under version control), my filesystem will soon be littered with .aider.chat.history.md files and I won't notice they're being created (unless I'm in the habit of ls -al after every cd).
The other thing is that a global history file would provide its own context i.e. if I've been thinking a bunch about, say, DataFusion or the semantic web or whatever over a series of queries during the past month, the global history file would have that entire context vs. a bunch of .aider.chat.history.md files scattered around the file system.
One way around this filesystem clutter is to use a single unified history file by setting AIDER_CHAT_HISTORY_FILE. The potential downside of this solution, however, is that it will reduce the efficacy of aider when it comes to specific repos, given that they won't have their own .aider.chat.history.md.
My workaround for this is a simple bash script:
#!/usr/bin/env bash#### SET OPENAI KEY###
OPENAI_KEY_PATH="path/to/key/export"if [ -f$OPENAI_KEY_PATH ];then
gum log --structured --time rfc822 --level info "🔑 OPENAI_API_KEY key set"source$OPENAI_KEY_PATHfiif [ -z"$OPENAI_API_KEY" ];then
gum log --structured --time rfc822 --level info "🔑 OPENAI_API_KEY not set, set in aider.env"exit 1
fi#### USE LOCAL CHAT/INPUT HISTORY FILES IF PRESENT, OTHERWISE CREATE LOCAL | USE GLOBAL###
LOCAL_HISTORY_CHAT="$PWD/.aider.chat.history.md"
LOCAL_HISTORY_INPUT="$PWD/.aider.input.history.md"
GLOBAL_HISTORY_CHAT="$HOME/Documents/denv/dotfiles/ai/aider-chat-history.md"
GLOBAL_HISTORY_INPUT="$HOME/Documents/denv/dotfiles/ai/aider-input-history.md"if [ -f"$LOCAL_HISTORY_CHAT" ];thenexport AIDER_CHAT_HISTORY_FILE="$LOCAL_HISTORY_CHAT"export AIDER_INPUT_HISTORY_FILE="$LOCAL_HISTORY_INPUT"
gum log --structured --time rfc822 --level info "🗃️ use existing local history files: $AIDER_CHAT_HISTORY_FILE$AIDER_INPUT_HISTORY_FILE"else
choices=("use global""create local")
choice=$(printf "%s\n""${choices[@]}"| gum filter)if [ "$choice"=="create local" ];then
touch "$LOCAL_HISTORY_CHAT"
touch "$LOCAL_HISTORY_INPUT"export AIDER_CHAT_HISTORY_FILE="$LOCAL_HISTORY_CHAT"export AIDER_INPUT_HISTORY_FILE="$LOCAL_HISTORY_INPUT"
gum log --structured --time rfc822 --level info "🗃️ create/use local history files: $AIDER_CHAT_HISTORY_FILE$AIDER_INPUT_HISTORY_FILE"elif [ "$choice"=="use global" ];thenexport AIDER_CHAT_HISTORY_FILE="$GLOBAL_HISTORY_CHAT"export AIDER_INPUT_HISTORY_FILE="$GLOBAL_HISTORY_INPUT"
gum log --structured --time rfc822 --level info "🗃️ use global history files: $AIDER_CHAT_HISTORY_FILE$AIDER_INPUT_HISTORY_FILE"fifi#### RUN AIDER###
aider "$@"
but it might be nice to have this workflow built into aider itself.
Version and model info
No response
The text was updated successfully, but these errors were encountered:
Issue
By default,
aider
tries to write history files to$CWD
. This should provide good context if, say, I'm returning to a repo where I've previously usedaider
.On the other hand, let's say I just have an off-hand question and I happen to be outside a Git repo in a random directory on my filesystem (
~/Desktop
, for example). If I startaider
in this directory (or any dir not under version control), my filesystem will soon be littered with.aider.chat.history.md
files and I won't notice they're being created (unless I'm in the habit ofls -al
after everycd
).The other thing is that a global history file would provide its own context i.e. if I've been thinking a bunch about, say, DataFusion or the semantic web or whatever over a series of queries during the past month, the global history file would have that entire context vs. a bunch of
.aider.chat.history.md
files scattered around the file system.One way around this filesystem clutter is to use a single unified history file by setting
AIDER_CHAT_HISTORY_FILE
. The potential downside of this solution, however, is that it will reduce the efficacy ofaider
when it comes to specific repos, given that they won't have their own.aider.chat.history.md
.My workaround for this is a simple bash script:
but it might be nice to have this workflow built into
aider
itself.Version and model info
No response
The text was updated successfully, but these errors were encountered: