adanotch agent
Show your own script or a long-running job on the island like an agent: report steps and ask for approval from the island.
adanotch agent lets a script you wrote, or any long-running job, show up on Adanotch's island like an AI agent. You don't need to run Claude Code, Codex or Antigravity: the script itself tells the island "I'm doing this now", asks for your approval on the island before a risky step such as deleting files, and shows up when it finishes or fails.
What is it for?
When you start a long job (a nightly backup, a deploy, some data processing) and leave the terminal in another window, you can:
- Follow progress from afar. See which step the job is on by glancing at the island, without going back to the terminal.
- Put a risky step behind approval. Before an irreversible command like
rm -rf, the script shows an "Allow / Deny" card on the island. The command doesn't run until you approve. - Not miss the result. You get a "finished" banner when it ends and an error banner when it fails.
Two different things
Claude Code, Codex, Antigravity and OpenCode are watched automatically: Adanotch connects to them from Settings › Modules › AI agents and you don't type any command. adanotch agent isn't for those agents, it's for your own scripts.
Before you start
Install the command line tool. In Settings › Developer › Command line tool, press Install. It links /usr/local/bin/adanotch and asks for an administrator password once.
Turn on the AI agents module. AI agents must be on in Settings › Modules. While it's off the commands can't reach the island.
Keep Adanotch running. The commands talk to the running app; with it closed nothing shows.
Four commands (and wrap)
| Command | What it does |
|---|---|
adanotch agent start [--name "<name>"] | Starts a session and prints its id. |
adanotch agent step "<what it does now>" | Shows what is being done right now on the island. |
adanotch agent ask "<command or question>" | Asks for approval on the island and waits for the answer. |
adanotch agent done [--error "<message>"] | Ends the session; with an error message it shows as an error. |
If you put the id start prints in an environment variable, you don't need --id on the other commands:
export ADA_AGENT_ID=$(adanotch agent start --name "Nightly backup")What does ask return?
ask waits until you decide on the island (up to 10 minutes) and answers with its exit code:
| Exit code | Meaning |
|---|---|
0 | You allowed it. |
1 | You denied it. |
2 | No answer (it timed out, or Adanotch couldn't be reached). |
That makes chaining ask with && a safe pattern: the next command only runs on 0, never when denied or unanswered.
wrap
Instead of typing the four commands one by one, wrap the command you want to run with wrap:
adanotch agent wrap --name "Deploy" -- ./deploy.sh productionwrap does this for you:
- Starts a session (the command itself is the name when you give no
--name). - Runs the command in this terminal.
ADA_AGENT_IDis set inside it, so the script can calladanotch agent stepandaskitself. - Closes the session when the command ends: as finished when the exit code is
0, otherwise with anexited with code Nerror. - Exits with the command's own exit code, so you can use it in chains and scripts as is.
adanotch agent wrap -- npm run build && echo "Build done"
adanotch agent wrap --name "Night job" -- sh -c 'rsync -a ~/Documents backup:/ && ./clean.sh'adanotch run also shows a running command on the island; what wrap adds is that the command itself can talk to the island with step and ask.
Examples
1. Nightly backup: progress and a delete approval
#!/bin/sh
export ADA_AGENT_ID=$(adanotch agent start --name "Nightly backup")
adanotch agent step "Backing up the database"
pg_dump mydb > ~/backups/mydb-$(date +%F).sql
adanotch agent step "Cleaning up old backups"
adanotch agent ask "rm -rf ~/backups/old" && rm -rf ~/backups/old
adanotch agent doneA "Nightly backup" session shows on the island, steps through both stages and waits for your approval before deleting. If you deny, rm never runs and the script still ends with done.
2. Warn the island on failure
With trap, show an error banner when the script falls over on any command:
#!/bin/sh
set -e
export ADA_AGENT_ID=$(adanotch agent start --name "Deploy")
trap 'adanotch agent done --error "Deploy stopped at line ${LINENO}"' EXIT
adanotch agent step "Running tests"
npm test
adanotch agent step "Building"
npm run build
adanotch agent step "Uploading to the server"
rsync -a dist/ server:/var/www/
trap - EXIT
adanotch agent doneWhen everything goes well it ends with done on the last line; when a command fails, trap kicks in and the island shows the error message.
3. Approval before going to production
For a yes/no question, use ask's exit code with if:
if adanotch agent ask "Deploy to production?"; then
./deploy.sh production
else
echo "Deploy cancelled."
fiIf you don't answer (10 minutes) the exit code is 2 and the else branch runs; silence counts as a no.
4. From another language
The command is an ordinary program you can run from any language. In Python:
import subprocess
def agent(*args):
return subprocess.run(["adanotch", "agent", *args], capture_output=True, text=True)
session = agent("start", "--name", "Data processing").stdout.strip()
agent("step", "Reading files", "--id", session)
# ... the work ...
agent("done", "--id", session)Troubleshooting
could not reach the Adanotch app: Adanotch isn't running or the AI agents module is off.startstill prints an id in this case but nothing shows on the island;stepanddonequietly do nothing.no session:ADA_AGENT_IDisn't set. Runexport ADA_AGENT_ID=$(adanotch agent start)first, or pass--idto each command.command not found: adanotch: the command line tool isn't installed; install it from Settings › Developer.