nanomuse-browser
In-app browser for a nanoMuse agent command
TLDR
Open a URL
$ nanomuse-browser navigate [https://example.com]
Read the page as text, with numbered controls$ nanomuse-browser extract
Click element 3, then type and submit$ nanomuse-browser click [3]
$ nanomuse-browser type [3] "[query]" --submit
Scroll, go back, or wait for a page that is still drawing$ nanomuse-browser scroll down
$ nanomuse-browser back
$ nanomuse-browser wait [1.5]
Save a screenshot, or GET a URL with the browser's cookies$ nanomuse-browser screenshot
$ nanomuse-browser fetch [https://example.com/account]
POST a body, or switch the profile, then close$ nanomuse-browser fetch [https://example.com/api] --post "[payload]"
$ nanomuse-browser profile mobile --width [390] --height [844]
$ nanomuse-browser close
SYNOPSIS
nanomuse-browser [--json] action [arguments]
DESCRIPTION
nanomuse-browser is a console script from the nanomuse package. The entry point is:
$ nanomuse.bridge.cli:browser_main
While nanomuse serve runs an agent command, this program posts one JSON request to `/api/bridge/browser` and prints the answer. The action name and its arguments are the JSON body. It uses only the Python standard library.The bridge URL and token are supplied by the server for that command. The two variable names, which must both be set:$ NANOMUSE_BRIDGE
NANOMUSE_BRIDGE_TOKEN
A text success prints the `output` field. Image paths are printed as `[image]` lines. Errors go to stderr.
NANOMUSE_BRIDGE_TOKEN
PARAMETERS
--json
Print the raw result object instead of the text output.navigate url
Open url in the app's browser. The user sees the same page and can take over.extract
Page text, with interactive elements numbered for click and type.click index
Click element index from the last extract.type index text [--submit]
Type text into element index. --submit presses Enter afterwards.press key
Press a key, for example Enter.scroll up|down
Scroll the page.back
Go back one page.wait [seconds]
Pause so a page that is still drawing can finish. seconds is optional.screenshot
Save a picture of the page and print the path.fetch url [--post body]
GET url with the browser's cookies (so a signed-in session is used) and print the raw body. --post sends body as a POST instead.profile [mobile|desktop] [--user-agent ua] [--width n] [--height n]
How the browser presents itself. The profile name may be omitted when only the size or user agent changes.close
Close the browser.
CAVEATS
Outside an agent command from nanomuse serve, the bridge variables are unset and the program exits 2. A bridge error exits 1. --json prints the object either way and exits 1 when `ok` is false.The request timeout is 600 seconds. This drives the in-app browser the user can see; it is not a separate Playwright process.
SEE ALSO
nanomuse(1), nanomuse-device(1), nanomuse-open(1), python(1)
