af is the deterministic CLI executor for the Autofish Service.
npm i -g @memohjs/afcd cli
cargo build --releaseaf config list
af config set remote.url "http://<IP>:<PORT>"
af config set remote.token "<token>"
af config set memory.db "$HOME/.config/af/af.db"
af config set output.default "text"
af config set artifacts.dir "$HOME/.config/af/artifacts"
af config list
af health
af observe screenshot
af observe screen --full
af observe page --field screen --field refs --max-rows 80
af act tap --by ref --value @n1
af verify text-contains --text "Settings"
af memory search --app com.android.settings
af memory experience --app com.android.settings --activity com.android.settings/.Settingshealthact:tap(preferred:--by ref --value @nK; coordinates:--xy; semantic:--by --value [--exact-match])swipe,back,home,text,launch,stop,key
observe:page(--field screen|refs; base context is always returned),screen,refs,overlay,screenshot,top
verify:text-contains,top-activity,node-exists
memory:save,search,delete,experience,context,log,stats
recover:back,home,relaunch
config:list,get,set,unset
See docs/CLI_MEMORY.md for memory design details.
Default output is stable multi-line key=value text. Use --output json when a script needs the old structured envelope.
status="ok": success, exit code0status="failed": error, exit code1status="interrupted": interrupted (SIGINT), exit code130
Config path resolution:
af --config ~/.config/af.toml config list # default path
AF_CONFIG=~/.config/af.toml af config get artifacts.dirSupported env/config keys include:
AF_URL,AF_TOKEN,AF_DBAF_OUTPUTAF_ARTIFACT_DIRAF_SCREEN_FILEAF_SCREENSHOT_FILEAF_PAGE_DIR
Example:
af config set remote.url "http://<IP>:<PORT>"
af config set remote.token "demo-token"
af config set memory.db "$HOME/.config/af/af.db"
af config set artifacts.dir "$HOME/.config/af/artifacts"
af config set output.default "text"Large observe payloads no longer inline image/base64 or full raw payloads in command output.
observe screenshotsaves an image artifact and returns summary fields plus saved path.observe screen --fullsaves the full JSON payload as an artifact.observe page --field screensaves the large screen slice as an artifact and keeps light metadata inline.