Skip to content

Command line

mirage works with the Local API of the running app. It needs a key for Scripts and SDK.

The SDKs and the command line are published on npm and PyPI together with the public beta. Until then these commands do not find the packages.

Terminal window
npm install -g @mirage-browser/cli
mirage login # paste the key, then Enter
mirage status

mirage login reads the key from the keyboard or from stdin (mirage login < key.txt), so it does not end up in your shell history. The key is saved in a file only your user can read. mirage logout forgets it.

Profiles

Terminal window
mirage profiles list --search shop
mirage profiles start "Shop 1" --headless # prints the Playwright wsEndpoint
mirage profiles stop "Shop 1"
mirage profiles create "Shop 2"
mirage profiles create "Check" --temporary # deleted when its browser stops
mirage profiles create "Shop 4" --browser chrome
mirage profiles update "Shop 2" --status Ready --proxy <proxy-id>
Terminal window
mirage profiles create "Shop 3" --os windows --folder Shops --tag warm --tag us --proxy <proxy-id>
mirage profiles update "Shop 3" --folder none --clear-tags
mirage profiles list --folder Shops --tag warm
mirage profiles delete "Shop 3" # to the trash; kept 30 days
mirage profiles list --trash
mirage profiles restore <profile-id>
mirage folders list
mirage tags list

A profile is named by its id or its exact name; folders and tags by id or name. profiles delete refuses a running profile: stop it first.

Cookies

Terminal window
mirage cookies import "Shop 3" cookies.json # JSON (EditThisCookie, Dolphin), Netscape or Base64
mirage cookies import "Shop 3" - --replace < cookies.txt
mirage cookies export "Shop 3" --format netscape --domain example.com -o shop3.txt

Imported cookies reach a running browser at once, a stopped one at its next start. Cookies are logins: -o writes a file only your user can read, and both commands need a key with Create and edit profiles. profiles start prints a one-time address for firefox.connect; add --no-automation to only open the profile. A profile made with --temporary is deleted, with its data, when its browser stops.

Proxies

Terminal window
mirage proxies import list.txt --type socks5 --tag de # one proxy per line, "-" reads stdin
mirage proxies list --status dead
mirage proxies check <proxy-id>
mirage proxies delete <proxy-id> --replace-with <other-id>

Playwright

Terminal window
mirage playwright install # playwright-core for Node.js, in the current folder
mirage playwright install --python # playwright for Python, with pip

It installs the Playwright version the app needs. --dry-run prints the command instead.

In scripts

  • --json on any command prints the API answer as JSON; errors also go to stderr as JSON.
  • Exit codes: 0 success, 1 error, 2 wrong arguments.
  • The key comes from --key, then MIRAGE_API_KEY, then the saved one. Avoid --key: other users of the computer can see the command line, and it stays in shell history. The CLI warns when it is used. The address comes from --url, then MIRAGE_LOCAL_API_URL, then the app’s address file.
Terminal window
for id in $(mirage profiles list --all --json | jq -r '.profiles[].id'); do
mirage profiles stop "$id"
done

mirage mcp connects AI agents: see AI agents (MCP).

Cloud access

mirage cloud … works without the app: it connects the computer to the Mirage server as a script with its own keys and manages a workspace’s cloud profiles. See Cloud access for scripts.