aim
aim copied to clipboard
How can I run Aim in the background?
❓Question
I'd like to open the Aim interface from a bash script together alongside commands. What is the recommended way to do that?
There is no "background" option in Aim. I could try to use bash "aim up &", but I'm not sure how to handle that in my script and close Aim later. I tried to catch the PID by "$!" and "kill" but it seems to leave abandoned "python" processes.
hey @Gerenuk! Thanks for the question.
aim up &
is the way to go, but unfortunately we're spawning the uvicorn
server as a separate process, so you'll need to kill that process instead to not leave any hanging processes behind. To find the id of that process you'll need to use
pgrep -P PID
command.
May I ask you to provide a little bit more information about your setup and why do you need to open the Aim UI in the background?
I recommend using a screen
instance:
e.g.:
screen -RS aim
# screen opens
aim up
# press ctrl+a, then press d
# screen is now in background
screen -r aim
# now back to aim window
# press ctrl-c
# aim is terminating
exit
# screen is now closed
hope this helps.