utils for terminal interface

This commit is contained in:
Ollie Agent 2026-08-03 07:43:50 +02:00
parent 261f987c5e
commit 56527598d6
3 changed files with 36 additions and 0 deletions

7
data/scripts/ollieread Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
session=${session:-$1}; shift
agent=${agent:-$1}; shift
file=${file:-$1}; shift
ollie-9p read session/$session/agent/$agent/$file

23
data/scripts/prompt Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
session=${session:-$1}
agent=${agent:-$2}
if [[ -z "$session" || -z "$agent" ]]; then
echo "Usage: $0 <session> <agent>" >&2
exit 1
fi
prompt_path="session/$session/agent/$agent/prompt"
echo "Prompting $session/$agent..."
echo "Press CTRL+D to exit."
while true; do
printf "> "
if ! IFS= read -r line; then
printf "\n"
break
fi
printf '%s\n' "$line" | ollie-9p write "$prompt_path"
done

6
data/scripts/sendctl Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
session=${session:-$1}; shift
agent=${agent:-$1}; shift
echo "$@" | ollie-9p write session/$session/agent/$agent/ctl