Skip to content

Add your own command with an adapter

Goal. aos notify send "build passed" posts to your Slack webhook, and the agent can call it like any built-in.

Where adapters live, what is loaded, and where the skill is installed
aos adapters path; aos adapters list; aos skill path
Terminal window
aos adapters path # where adapters live
aos adapters example --write # a working starter file

Save ~/.config/aos/adapters/notify.json:

{
"group": "notify",
"description": "Tell me things",
"commands": [
{
"name": "send",
"summary": "Post a message to my Slack webhook",
"args": "<text...>",
"run": "curl -sS -X POST -H 'Content-Type: application/json' -d \"{\\\"text\\\":\\\"$*\\\"}\" \"$SLACK_WEBHOOK_URL\""
}
]
}

Check and use it:

Terminal window
aos commands --check
aos adapters list
aos notify send "build passed"
aos serve tools --groups=notify

When the tests pass, notify me with aos notify send.

The agent sees notify send in aos commands and in its MCP tool list, with the summary you wrote.

  • Secrets stay in the environment. $SLACK_WEBHOOK_URL expands when the command runs. Never write the value into the adapter file.
  • A built-in always wins a name collision. Pick a group name that is not already taken.
  • run goes through the shell. Your arguments are appended, quoted. Quote carefully inside run.
  • A malformed file is reported, not skipped. aos commands --check exits non-zero and says what is wrong.

See also extending it.