## ssh.computerplease.dev It’s a toy. It might vanish. ### First connection - `ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""` - `ssh ssh.computerplease.dev` ### Prompt the agent - `ac() { while read -p x; do agent -c "$x"; done; }` - command `ac` to start / continue a conversation - `ENTER` to send a prompt, `CTRL`+`c` to exit ### Append in .profile ```sh set -o ignoreeof ac() { while read -p "U> " x; do echo "A>";agent -c "$x";echo; done; echo; }` ``` ### Example ```console roberto@x280[5]:~/robang74/uchaosys$ ssh ssh.computerplease.dev Welcome to your Alpine VM. Your SSH key opens this same persistent disk. Try: agent "create hello.py that prints the date and run it" (agent -c continues) The agent runs on Workers AI outside this VM. No API key needed. ~ ⇒ ac() { read x && agent -c "$x"; } ~ ⇒ ac ciao come stai, parli italiano? Ciao, sì parlo italiano. Sto bene, pronto a lavorare. Sono il tuo agente su questa piccola VM Alpine (aarch64): posso eseguire comandi, leggere e scrivere file, cercare nel codice. Dimmi cosa vuoi fare e parto. [deepseek-ai/deepseek-v4.1-flash-1017 · 1.6s · agent -c to follow up] ~ ⇒ ac() { while read x; do agent -c "$x"; done; } ~ ⇒ ac ho scritto questa funzione per dialogare con te: ac() { while read x; do agent -c "$x"; done; } ma vorrei usare qualcosa di più completo che mi permettesse di mettere anche le andate a capo. Tipo chat. Cosa suggerisci? Come configurarla? ● $ which agent rlwrap fzf vi vim nano less python3 2>/dev/null; echo ---; bash --version | head -1; echo ---; agent --help 2>&1 | head -40 │ /run/kw/bin/agent │ /usr/bin/vi │ /usr/bin/less │ --- │ GNU bash, version 5.3.9(1)-release (aarch64-alpine-linux-musl) │ --- │ usage: agent "what to do" start a new task │ agent -c "follow-up" continue the last conversation │ agent --reset forget the conversation │ A coding agent (Pi Durable) that lives in this machine's Durable Object and │ works on this VM with bash/read/write/edit. Model: Workers AI. ● $ ls -la /home/user; echo ---; cat /home/user/.bashrc 2>/dev/null | head -40 │ total 24 │ drwx------ 1 user user 4096 Dec 2 20:22 . │ drwxr-xr-x 1 root root 4096 Nov 5 09:19 .. │ -rw------- 1 user user 186 Dec 2 20:22 .bash_history │ drwx------ 2 user user 4096 Dec 2 20:22 .codex │ drwx------ 2 user user 4096 Dec 2 20:17 .ssh │ -rw-r--r-- 1 user user 3137 Nov 5 09:19 README │ --- ● $ ls -a /home/user; echo ---; ls /etc/profile.d 2>/dev/null; echo ---; grep -n "bashrc\|profile" /etc/profile 2>/dev/null | head; echo ---; echo "SHELL=$SHELL"; echo ---; id │ . │ .. │ .bash_history │ .codex │ .ssh │ README │ --- │ 00-bashrc.sh │ 20locale.sh │ README │ color_prompt.sh.disabled │ kw-apk.sh │ … ● $ mkdir -p /tmp/stub && cat > /tmp/stub/agent <<'EOF' #!/bin/bash echo "[stub] argc=$#"; for a in "$@"; do echo "[stub] arg:<<$a>>"; done EOF chmod +x /tmp/stub/agent && echo ok │ ok ● $ cat /etc/profile.d/00-bashrc.sh; echo ---; cat /etc/profile.d/kw-prompt.sh 2>/dev/null | head -30 │ if [ -n "$BASH_VERSION" ] && [ "$BASH" != "/bin/sh" ]; then │ # if we're bash (and not /bin/sh bash), also source the bashrc │ # by default, bash sources the bashrc for non-login, │ # and only /etc/profile on login (-l). so, make it do both on login. │ # this ensures that login-shell bash (e.g. -bash or bash -l) still sources the │ # system bashrc, which e.g. loads bash-completion │ . /etc/bash/bashrc │ fi │ --- │ PS1='\[\033[36m\]\w \[\033[35m\]⇒\[\033[0m\] ' │ export PS1 ENV=/usr/lib/kw/shrc ● $ grep -n "bashrc" /etc/bash/bashrc | head -20; echo ---; tail -20 /etc/bash/bashrc │ --- │ if [[ $- != *i* ]] ; then │ # Shell is non-interactive. Be done now! │ return │ fi │ │ # set fallback PS1; only if currently set to upstream bash default │ if [ "$PS1" = '\s-\v\$ ' ]; then │ PS1='\h:\w\$ ' │ fi │ │ for f in /etc/bash/*.sh; do │ … ● $ cat -n /etc/bash/bashrc; echo ---; ls /etc/bash/ │ 1 if [[ $- != *i* ]] ; then │ 2 # Shell is non-interactive. Be done now! │ 3 return │ 4 fi │ 5 │ 6 # set fallback PS1; only if currently set to upstream bash default │ 7 if [ "$PS1" = '\s-\v\$ ' ]; then │ 8 PS1='\h:\w\$ ' │ 9 fi │ 10 │ 11 for f in /etc/bash/*.sh; do │ 12 [ -r "$f" ] && . "$f" │ … ● write /home/user/bin/ac (2297 bytes) ● $ chmod +x /home/user/bin/ac; bash -n /home/user/bin/ac && echo "sintassi ok" │ sintassi ok ● $ cd /home/user && printf 'riga uno\nriga due\n\n/q\n' | AC_AGENT=/tmp/stub/agent ./bin/ac; echo "=== exit=$?" │ [invio: 2 righe, 17 caratteri] │ [stub] argc=2 │ [stub] arg:<<-c>> │ [stub] arg:<> │ │ === exit=0 ● $ cd /home/user && printf 'ciao\n/foo\n\n/reset\n/e\n/q\n' | AC_AGENT=/tmp/stub/agent EDITOR=/bin/true ./bin/ac; echo "=== exit=$?"; echo; printf 'senza nuova riga finale' | AC_AGENT=/tmp/stub/agent ./b… │ [invio: 2 righe, 9 caratteri] │ [stub] argc=2 │ [stub] arg:<<-c>> │ [stub] arg:<> │ │ [stub] argc=1 │ [stub] arg:<<--reset>> │ Chat con agent: │ riga vuota invia il messaggio accumulato (anche piu' righe) │ /e scrivi/incolla il messaggio in $EDITOR e invialo │ /reset dimentica la conversazione │ … ● edit /home/user/bin/ac ● $ cd /home/user && bash -n bin/ac && prinssh ssh.computerplease.devtf 'ultima riga senza a capo' | AC_AGENT=/tmp/stub/agent AC_HISTFILE=/tmp/h1 ./bin/ac; echo "=== exit=$?" │ [invio: 1 righe, 24 caratteri] │ [stub] argc=2 │ [stub] arg:<<-c>> │ [stub] arg:<> │ │ │ === exit=0 ● $ cat > /tmp/ed <<'EOF' #!/bin/bash printf 'scrivo dal editor\nseconda riga\n' > "$1" EOF chmod +x /tmp/ed; cd /home/user && printf '/e\n/q\n' | AC_AGENT=/tmp/stub/agent AC_HISTFILE=/tmp/h2 EDITOR=/tmp/… │ Chat con agent: │ riga vuota invia il messaggio accumulato (anche piu' righe) │ /e scrivi/incolla il messaggio in $EDITOR e invialo │ /reset dimentica la conversazione │ /h questo aiuto │ /q esci (o Ctrl-D) │ === exit=0 ● $ cd /home/user && sed -i 's|/h | /help | /?)|/h \| /help \| "/?")|' bin/ac; grep -n 'help |' bin/ac │ sed: bad option in substitution expression │ 79: /h | /help | /?) help; continue ;; ● edit /home/user/bin/ac ● edit /home/user/bin/ac ● $ cd /home/user && bash -n bin/ac && printf '/e\n/q\n' | AC_AGENT=/tmp/stub/agent AC_HISTFILE=/tmp/h3 EDITOR=/tmp/ed ./bin/ac; echo "=== exit=$?" │ ./bin/ac: line 83: /dev/tty: No such device or address │ === exit=0 ● $ cd /home/user && printf '/h\n/foo\nriga a\nriga b\n\n/q\n' | AC_AGENT=/tmp/stub/agent AC_HISTFILE=/tmp/h4 ./bin/ac; echo "=== exit=$?" │ Chat con agent: │ riga vuota invia il messaggio accumulato (anche piu' righe) │ /e scrivi/incolla il messaggio in $EDITOR e invialo │ /reset dimentica la conversazione │ /h questo aiuto │ /q esci (o Ctrl-D) │ ac: comando sconosciuto: /foo │ [invio: 2 righe, 13 caratteri] │ [stub] argc=2 │ [stub] arg:<<-c>> │ [stub] arg:<> │ … ● edit /home/user/bin/ac ● $ cd /home/user && printf '/e\n/q\n' | AC_AGENT=/tmp/stub/agent AC_HISTFILE=/tmp/h5 EDITOR=/tmp/ed ./bin/ac; echo "=== exit=$?" │ [invio: 2 righe, 30 caratteri] │ [stub] argc=2 │ [stub] arg:<<-c>> │ [stub] arg:<> │ │ === exit=0 ● $ cd /home/user && echo 'export PATH="$HOME/bin:$PATH"' > .bashrc && bash -i -c 'echo "PATH=$PATH"' 2>&1 | tail -2; echo ---; sh -lc 'echo login: $PATH' │ bash: no job control in this shell │ PATH=/home/user/bin:/run/kw/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/kw/bin │ --- │ login: /run/kw/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/kw/bin agent: no answer (turn_limit) ~ ⇒ cat /home/user/bin/ac ``` ```sh #!/bin/bash # ac - chat multi-riga con `agent` # # ac apre la chat (continua l'ultima conversazione) # ac "testo" manda subito un messaggio, poi resta in chat # # Dentro la chat: # riga vuota invia il messaggio accumulato (anche su piu' righe) # /e scrivi il messaggio in $EDITOR (vi) e invialo # /reset dimentica la conversazione (agent --reset) # /h aiuto # /q esci (anche Ctrl-D) # # Editing: frecce su/giu', Ctrl-A/E, Ctrl-R, incolla multi-riga # (readline, via `read -e`). Cronologia: ~/.ac_history set -u HISTFILE="${AC_HISTFILE:-$HOME/.ac_history}" HISTSIZE=1000 HISTFILESIZE=1000 EDITOR="${EDITOR:-vi}" AGENT="${AC_AGENT:-agent}" set -o history 2>/dev/null history -r "$HISTFILE" 2>/dev/null help() { cat <<-'EOF' Chat con agent: riga vuota invia il messaggio accumulato (anche piu' righe) /e scrivi/incolla il messaggio in $EDITOR e invialo /reset dimentica la conversazione /h questo aiuto /q esci (o Ctrl-D) EOF } send() { local msg=$1 rc [[ -z "${msg//[[:space:]]/}" ]] && return 0 printf '\033[2m[invio: %s righe, %s caratteri]\033[0m\n' \ "$(printf '%s' "$msg" | grep -c '')" "${#msg}" "$AGENT" -c "$msg" &2 printf '\n' return 0 } buf="" [[ $# -gt 0 ]] && send "$*" while :; do if [[ -z $buf ]]; then prompt='> '; else prompt=' ... '; fi IFS= read -e -r -p "$prompt" line rc=$? if (( rc > 128 )); then # Ctrl-C: butta il messaggio in corso buf="" printf '\n' continue elif (( rc != 0 )); then # Ctrl-D / EOF if [[ -n $line ]]; then # riga senza newline finale [[ -z $buf ]] && buf=$line || buf+=$'\n'$line fi [[ -n $buf ]] && send "$buf" printf '\n' break fi history -s "$line" 2>/dev/null if [[ -z $buf && $line == /* ]]; then case $line in /q | /quit | /exit) break ;; /reset) "$AGENT" --reset; continue ;; /h | /help | "/?") help; continue ;; /e | /edit) tmp=$(mktemp) || continue if { : < /dev/tty; } 2>/dev/null; then "$EDITOR" "$tmp" < /dev/tty else "$EDITOR" "$tmp" fi msg=$(cat "$tmp") rm -f "$tmp" send "$msg" continue ;; *) printf 'ac: comando sconosciuto: %s\n' "$line" ;; esac continue fi if [[ -z $line ]]; then send "$buf" buf="" elif [[ -z $buf ]]; then buf=$line else buf+=$'\n'$line fi done ``` ```console ~ ⇒ /home/user/bin/ac > sto provando lo script che hai creato tu, così vediamo se funziona ... [invio: 1 righe, 66 caratteri] ● $ cd /home/user && grep -n 'HOME\|profile' /etc/profile; echo ---; cat /usr/lib/kw/shrc 2>/dev/null | head │ 19:for script in /etc/profile.d/*.sh ; do │ --- │ if [ -z "${_kw_sh-}" ] && ! { [ -n "${BASH_VERSION-}" ] && shopt -q login_shell; }; then │ for _kw in /etc/profile.d/kw-*.sh; do │ [ -r "$_kw" ] && . "$_kw" │ done │ unset _kw │ fi ● $ cd /home/user && printf '%s\n' '# login shells' 'export PATH="$HOME/bin:$PATH"' > .profile && bash -lc 'command -v ac' 2>/dev/null; echo "---"; ls -l bin/ac; bash -n bin/ac && echo sintassi-ok │ /home/user/bin/ac │ --- │ -rwxr-xr-x 1 user user 2485 Dec 2 20:26 bin/ac │ sintassi-ok Perfetto, dimmi pure cosa succede (o se si blocca). Nel frattempo ho sistemato l'installazione: lo script è in ~/bin/ac, eseguibile, sintassi ok, e PATH è impostato sia in ~/.bashrc sia in ~/.profile (verificato con bash -lc: `command -v ac` lo trova). Come provarlo: source ~/.bashrc (oppure apri una nuova shell bash) ac Cose da sapere mentre lo provi: - riga vuota = invia il messaggio accumulato (anche multi-riga) - /e apre vi per scrivere/incollare messaggi lunghi, /reset, /h, /q o Ctrl-D - frecce su/giù e Ctrl-R funzionano (readline via `read -e`), cronologia in ~/.ac_history - con /bin/sh (ash) non viene caricato ~/.profile: in quel caso usa ~/bin/ac Non ho lanciato `agent` vero per non toccare la conversazione corrente: ho testato tutta la logica con un finto `agent` (multi-riga, EOF senza a capo finale, /e, /reset, comandi sconosciuti). Se qualcosa non va, incollami l'errore. [deepseek-ai/deepseek-v4.1-flash-1017 · 11.0s · agent -c to follow up] ^C ~ ⇒ exit ``` ### Conclusion A system AI agent looks impressive and terrifying, both. - Impressive for the capabilities and the lack of awareness. - Terrifying for the vastness and overwhelming speed of changes. - A human being takes their time and ends up with a 1-line function. - One line seems a little, but it is enough and quick to understand. I started my career as an IT consultant as the one who wrote a long patch for a script straight in the CVS editor just half hour before the system test without running even a local test or a sanity check on the script. Therefore, I know very well about what I am seeing here.