AT Commands
Overview
Ameba-Claw exposes its full feature set through a compact AT command interface over the serial port.
Every operation — chatting with the agent, configuring the LLM backend, managing memory, running Lua
skills, and browsing the virtual filesystem — is reachable with a single AT+CLAW=... command.
All commands follow the same prefix: AT+CLAW=<action>[,<arguments>]
If the board is not yet configured, start with the Wi-Fi and LLM configuration commands before
sending any ask commands.
Connecting to Serial
Connect to the board’s primary UART port with any serial terminal (PuTTY, minicom, screen, or the Arduino IDE serial monitor).
Default settings:
Parameter |
Value |
|---|---|
Baud rate |
115200 |
Data bits |
8 |
Parity |
None |
Stop bits |
1 |
Flow control |
None |
After the board boots you will see a shell prompt. Type AT commands directly into the terminal and press Enter to send each one.
Tip
If you see garbled output on boot, check that your terminal baud rate matches 115200.
Command Reference
Chat
Command |
Description |
|---|---|
|
Send a message to the agent and receive a reply. required unless the message itself contains a comma. |
Example
AT+CLAW=ask,What is the current temperature on the board?
LLM Configuration
Use AT+CLAW=cfg to inspect or update the LLM backend settings. Changes are persisted to flash
and take effect immediately.
Command |
Description |
|---|---|
|
Print the current LLM configuration (model, URL, backend type). The API key is shown masked for security. |
|
Set the API key used to authenticate requests to the LLM provider. |
|
Set the model identifier (e.g.
|
|
Set the API endpoint URL. Use this to point the agent at a custom or OpenAI-compatible endpoint. |
|
Set the authentication scheme.
|
Examples
AT+CLAW=cfg
AT+CLAW=cfg,key,sk-xxxxxxxxxxxxxxxxxxxxxxxx
AT+CLAW=cfg,model,gpt-4o
AT+CLAW=cfg,url,https://api.openai.com/v1/chat/completions
AT+CLAW=cfg,backend,0
Note
For Anthropic (Claude) models, set backend to 2 and use your Anthropic API key.
For OpenAI, Qwen, DeepSeek, or any OpenAI-compatible provider, use backend 0.
Wi-Fi
Command |
Description |
|---|---|
|
Connect to a Wi-Fi network (low-level command). Takes effect immediately and saves credentials persistently. |
|
Connect to a Wi-Fi network (application-level command). Same behavior as
|
|
Erase saved Wi-Fi credentials and reboot the board into SoftAP mode. Use this to reconfigure the network from scratch. |
Examples
AT+WLCONN=ssid,MyNetwork,pw,MyPassword
AT+CLAW=cfg,wifi,MyNetwork,MyPassword
AT+CLAW=wifi,clear
Memory Management
Long-term memory is stored in vfs:/MEMORY.md. The agent reads this file at the start of each
session to recall facts about the user and previous interactions.
Command |
Description |
|---|---|
|
Display the current contents of long-term memory. |
|
Erase all long-term memory. |
Examples
AT+CLAW=memory,list
AT+CLAW=memory,clear
Session History
Each conversation session is stored as a .jsonl file under vfs:/session/. Sessions let the
agent maintain context within a conversation; they do not persist across reboots unless explicitly
saved.
Command |
Description |
|---|---|
|
List all saved session files. |
|
Clear the current active session. |
|
Delete all saved session files. |
Examples
AT+CLAW=session,list
AT+CLAW=session,clear
AT+CLAW=session,clear,all
Skills
Lua skills are self-contained scripts that extend what the agent can do without recompiling firmware. The agent can invoke skills automatically, or you can trigger them directly from the serial terminal.
Command |
Description |
|---|---|
|
Run a script-type Skill directly. Knowledge-type Skills (no script) are not executable this way — activate them through conversation instead. |
|
Run a script-type Skill and pass a JSON object as the |
|
List all registered C-layer Capabilities (not the Skill list). |
|
List all installed Skills (calls the |
Examples
AT+CLAW=cap
AT+CLAW=cap,skill_list
AT+CLAW=skill,usb_file
AT+CLAW=skill,blink_led,{"pin":"PA_22","times":10}
Note
AT+CLAW=cap lists registered Capabilities (C-layer tools such as lua_run,
file_read, skill_list). To see installed Skills, use AT+CLAW=cap,skill_list.
Filesystem
Ameba-Claw uses a virtual filesystem (VFS) to store configuration files, skills, session history,
and user data. The fs command lets you inspect and manage these files from the serial terminal.
Command |
Description |
|---|---|
|
List the contents of |
|
Delete the file at |
Examples
AT+CLAW=fs,list,/
AT+CLAW=fs,list,/skills
AT+CLAW=fs,delete,/tmp/test.lua
Warning
Deleting system files such as /AGENTS.md or /SOUL.md will remove the agent’s
persona and role definition. The agent will revert to default behavior until these files
are restored.
Key VFS paths
Path |
Purpose |
|---|---|
|
System prompt and agent role definition |
|
Agent personality |
|
Agent identity |
|
User information — name, preferences, preferred language |
|
Long-term memory |
|
Per-session conversation history |
|
Installed Lua skill packages |
|
Scheduled job definitions |
|
MCP server configurations |
Lua REPL Mode
The Lua REPL (Read-Eval-Print Loop) lets you run Lua code interactively over serial. It is useful for testing hardware access, exploring the available Lua modules, and prototyping skill scripts before saving them to the filesystem.
Entering the REPL
AT+CLAW=lua
After sending this command the terminal switches into Lua mode. You will see a > prompt.
Type any Lua expression or statement and press Enter to execute it.
> print("Hello from Ameba-Claw!")
Hello from Ameba-Claw!
> 1 + 2
3
> sys.millis()
42317
> sys.uptime()
42.317
To exit the REPL and return to AT command mode, type exit or press Ctrl+C.
Available Lua Modules
The following modules are available inside skill scripts as well as in the REPL:
Software modules
Module |
Description |
|---|---|
|
Call registered capabilities (skills). Returns two values:
|
|
Read, write, and manage files on the VFS. |
|
System utilities: since boot (float), |
|
JSON encode and decode. |
|
One-shot and repeating timers. |
|
UDP socket communication. |
|
Inter-task event signaling. |
Hardware modules
Module |
Description |
|---|---|
|
Digital I/O; |
|
Event-driven button detection (press/release callbacks), wrapper over |
|
I2C master communication. |
|
SPI master byte-level read/write. |
|
Real-time clock read and set. |
|
Unified display output API for SPI and LCDC screens. |
|
Audio capture and playback. |
|
USB Mass Storage (FAT32 drive) access. |
|
USB Video Class (camera) access. |
REPL-only modules (not available inside Skill scripts)
Module |
Description |
|---|---|
|
Wi-Fi station and SoftAP control. |
|
UART configuration and communication. |
|
PWM output control. |
|
Infrared transmit and receive. |
|
LCD controller. |
|
Analog-to-digital conversion. |
|
On-chip temperature sensor. |
|
Capacitive touch input. |
|
Hardware basic timer for precision timing. |
|
WS2812 programmable LED strip control. |
Warning
REPL-only modules (wifi, uart, pwm, ir, lcdc, adc, thermal,
touch, basictimer, led_strip) are not available inside Skill scripts. Use
them only for interactive REPL sessions. spi, display, button, gpio,
i2c, rtc, and audio are available in both environments.
Writing Skill Scripts
Every Lua skill script must define a run function as its entry point:
function run(args)
-- args is already a decoded Lua table — do NOT call cjson.decode(args)
local pin = args.pin or "PA_22"
return '{"status":"ok"}'
end
Scripts are stored at the following paths depending on their purpose:
Path |
Purpose |
|---|---|
|
Throwaway scripts — erased on reboot |
|
Persistent user applications |
|
LLM-invokable skills — the agent can call these by name |
Calling another capability from a skill
cap.call returns two values. Always capture both:
function run(args)
local ok, result_json = cap.call("board_hardware_info", "")
if not ok then
return "Error: " .. result_json
end
local info = cjson.decode(result_json)
return cjson.encode(info)
end
Lua version notes
The runtime is Lua 5.4. Use the native bitwise operators &, |, ~, >>, <<
instead of the bit module (which is not loaded). The os module is not available; use
sys instead:
local t = sys.time() -- Unix timestamp (integer)
sys.sleep_ms(500) -- Sleep 500 ms
Tip
Activate the builtin_lua_modules built-in skill (AT+CLAW=skill,builtin_lua_modules)
to load a full index of all Lua module APIs. This gives the agent the reference it needs to
write correct skill scripts on your behalf.
Activate board_hardware_info before asking the agent to write any hardware-related
script, so it knows which pins and peripherals are available on your specific board.