macOS AI Assistant - Commands Reference
=============================================

CHAT COMMANDS
-----------------------
exit                   Exit the assistant

/toggle                Toggle automatic web search ON/OFF
/search <query>        Force a web search for the given query

/logs [N]              Show the last N command execution logs (default: 5)
/clearcommandlogs      Delete all command log files from command_logs/
/review                Have the AI analyse recent logs for mistakes or improvements

/auto                  Toggle auto-execution mode ON/OFF
                       When ON, zsh/bash commands and code blocks from the AI are
                       executed automatically without confirmation prompts.
/build <description>   Enter auto-build mode.
                       Activates auto-execution and gives the AI a build prompt.
                       The AI will work autonomously: plan, execute, diagnose,
                       and fix until the build is complete.
                       Exit by typing "exit" or when the AI outputs [BUILD COMPLETE].
/fullyauto <description>
                        Enter fully autonomous mode. The AI takes full control:
                        it decides what to do, when to search the web, and what
                        code/commands to execute — all without asking permission.
                        Example: /fullyauto create a new React app with TypeScript
                        If you just type /fullyauto with no description, the AI
                        will ask what you want to accomplish.
                        Use `[SEARCH: query]` in AI output to trigger web searches.
                        AI outputs [DONE] when finished. Type "exit" to cancel.

/browser [--visible] [url]
                        Enter browser automation mode.
                        Starts a Chromium browser controlled by the AI.
                        By default runs headless (hidden). Add --visible to
                        show the browser window so you can watch what it does.
                        The AI navigates, clicks, types, extracts data, takes
                        screenshots, and searches DuckDuckGo — all via
                        `[BROWSE: <action> <args>]` tokens in its output.
                        If a URL is provided, the browser navigates there first.
                        Available actions: navigate, go, search, click, type,
                        extract, html, scroll, screenshot, url, title, press,
                        script, wait, select, close, popups, captcha, solve-captcha.
                        AI outputs [BROWSER DONE] when finished.

                        While in browser mode you can interact:
                          /fullyauto <goal>   Tell the AI what to do on the page
                          !browse <action>    Run a browser action manually
                          !browse screenshot  Capture current page to a file
                          /help               Show in-mode commands
                          exit                Exit browser mode
                        In headless mode, a screenshot is auto-saved after
                        each AI action so you can preview the page.

/autotask [program]
                        Enter autotask mode — control mouse, keyboard, and windows.
                        Opens a program if specified, then lets the AI automate it.
                        The AI controls the desktop via `[AUTOTASK: <action> <args>]`
                        tokens in its output.
                        Available actions: open, launch, find, window, windows,
                        window-list, move, click, doubleclick, rightclick, drag,
                        type, press, key, hotkey, scroll, screenshot, locate,
                        locateall, pos, position, resolution, res, wait, sleep,
                        close, exit.
                        AI outputs [AUTOTASK DONE] when finished.

                        While in autotask mode you can interact:
                          /fullyauto <goal>   Tell the AI what task to automate
                          !autotask <action>  Run an autotask action manually
                          /help               Show in-mode commands
                          exit                Exit autotask mode

/sandbox [goal]
                        Enter sandbox test mode. Creates an isolated temporary
                        directory where the AI can write, execute, and verify
                        scripts without affecting your system.
                        AI outputs [SANDBOX DONE] when tests pass.
                        AI outputs [SANDBOX FAILED] if it can't fix issues.

/plan <goal>
                        Enter structured plan mode. The AI breaks your goal
                        into numbered steps and works through them one at a time.
                        Use `/status` to see progress at any time.
                        AI outputs [PLAN: complete] when done.

/status
                        Show current plan progress (active steps, completed, pending).

DIRECT EXECUTION COMMANDS
-------------------------
!bash <command>        Execute a zsh/bash command directly (bypasses AI)
!read <path>           Read and display the contents of a file
!write <path>          Write content to a file (paste content, end with 'EOF' on its own line)
!cd <dir>              Change the working directory for commands
!run <language>        Execute code in a specific language interactively
                       (paste code, end with 'EOF' on its own line)
!npm <args>            Run npm commands (install, build, test, etc.)
!pip <args>            Run pip commands (install, uninstall, list, etc.)
!browse <action> <args>
                        Direct browser command (starts browser, runs action, closes).
                        Examples:
                          !browse go https://example.com
                          !browse search python tutorial
                          !browse extract article
                          !browse screenshot
!autotask <action> <args>
                        Direct autotask command (mouse/keyboard/window control).
                        Examples:
                          !autotask open finder
                          !autotask windows
                          !autotask move 500 300
                          !autotask click
                          !autotask type Hello world
                          !autotask press enter
                          !autotask locate button.png

Note: All commands are logged to the command_logs/ folder for later review.

SUPPORTED LANGUAGES FOR CODE EXECUTION (!run)
----------------------------------------------
python / py            Python 3
javascript / js        Node.js
typescript / ts        TypeScript (via npx tsx)
html, css, json        Saved to file (non-executable)
xml, yaml, yml         Saved to file (non-executable)
markdown / md          Saved to file (non-executable)
sql                    Saved to file (non-executable)
rust                   Compiled and run via rustc
go                     Run via go run
ruby                   Run via ruby
php                    Run via php
bash                   Run via zsh
