Sometimes a script needs a real browser but you do not need to watch it work. Vela for Mac can start with no window on screen and take its orders through the Automation API. There are two ways to do it, hidden mode and headless mode, and both are started from Terminal with a launch flag. This guide shows the commands, what each mode keeps and drops, and a short script you can run from start to finish.
Hidden mode and headless mode, side by side
Both modes run without anything to look at, and both start the API server for you. The difference is how much of the browser is behind it.
| Hidden | Headless | |
|---|---|---|
| What runs | The full browser, with every window made invisible. | A stripped-down host that never builds the browser's interface. |
| Website data | Kept as usual, in the default store and in each profile. | Tabs opened without a profile use a temporary store that is thrown away. |
| Best for | Scripts that sign in, or must behave like normal browsing. | Short, stateless jobs where low overhead matters most. |
Vela's own Settings describe hidden mode as the recommended one: it behaves like the normal browser, only invisible. Headless is lighter but less compatible. If you are not sure, use hidden.
Start Vela in hidden mode
Open Terminal and run:
open -n -g -a Vela --args --hidden --port 1307
Each part has a job:
-nstarts a new copy of Vela, so the one you are browsing in is left alone.-gkeeps that copy in the background instead of bringing it to the front.--hiddenis the mode. Its windows are transparent and ignore the mouse, and the copy takes itself out of the Dock once it is running.--port 1307is where its API listens. Add--bindfollowed by an address to change where it listens. Unless you changed it in Settings, that is127.0.0.1, your own Mac only.
You do not have to type this from memory. Settings → Automation has a section called Hidden & Headless Mode (macOS) that shows both commands with a copy button, and a Copy All Info button for the lot.
Start Vela in headless mode
The command is the same with a different flag:
open -n -a Vela --args --headless --port 1307
Headless mode does not build the browser's windows. It runs a small invisible host for the API and creates pages on request. Because nothing is meant to last, a tab opened without a profile gets a temporary data store: cookies and site storage are gone when the copy quits, and the tab session is not saved. A window you open on a named profile still uses that profile's own store.
Find the address and the key
A hidden or headless copy uses the same API key as the rest of Vela, the one shown under Authentication in Settings → Automation. If you have never had a key, it creates one and saves it.
To see the details in the terminal, start the app's program directly instead of going through open. It prints the mode, the API address and the key as it starts:
/Applications/Vela.app/Contents/MacOS/Vela --hidden --port 1307
Vela Hidden Mode
API: http://127.0.0.1:1307
Key: your-api-key
Started this way, the copy runs in that terminal until you quit it, for example with ⌃C.
A short script from start to finish
This opens a page in a hidden copy, waits for it to load, saves its text and a screenshot, and shuts the copy down again:
#!/bin/sh
KEY="paste-your-key-here"
BASE="http://127.0.0.1:1307"
open -n -g -a Vela --args --hidden --port 1307
sleep 5 # give the copy a moment to start
# Is it up?
curl -s -H "X-API-Key: $KEY" "$BASE/api/status"
# Open a tab and keep its id
TAB=$(curl -s -X POST "$BASE/api/tabs" \
-H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"url":"https://example.com"}' \
| plutil -extract id raw -o - -)
# Wait for the page, then read it
curl -s -X POST "$BASE/api/tabs/$TAB/wait-for-load-state" \
-H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d '{"state":"load"}'
curl -s -H "X-API-Key: $KEY" "$BASE/api/tabs/$TAB/text" > page.json
# Save a screenshot
curl -s -H "X-API-Key: $KEY" "$BASE/api/tabs/$TAB/screenshot" \
| plutil -extract data raw -o - - | base64 --decode > page.png
# Done
pkill -f "Vela.*--hidden"
The requests are the same ones the normal window answers. Only the port is different. To work inside a profile, ask GET /api/profiles for the list, then send POST /api/windows with a profileId; the answer gives you a windowId and the tabId of its first tab. The API docs have the full reference.
What is different when nobody is watching
A copy started in either mode is set up for scripts, not for people. A few things change so that it never waits for a click that will not come:
- Pages are told they are visible. Sites that pause when a tab is in the background keep running, and pages are laid out at a normal desktop size.
- No questions on quit. The copy stops as soon as you ask, with no prompt about restoring the session.
- No housekeeping. It skips the welcome intro, the update check and the offer to send a crash report.
- No password prompts in hidden mode. Saved-password autofill is switched off, so your script decides what gets typed.
- No right-click menus. A context menu would open a real menu on screen and wait there, so it is suppressed.
The copy shares your profiles and settings with the Vela you browse in. In hidden mode, what a script does inside a profile, such as signing in to a site, is saved in that profile.
When to use the normal window instead
Hidden and headless mode are for scripts that already work. While you are still writing one, switch on the API in your normal window, as the quick start shows, and watch what each request does. Wrong selectors and pages that load slower than expected are much easier to spot when you can see them.
The same goes for anything that needs a person: a sign-in with a one-time code, a captcha, a consent screen. Do that part by hand in a visible window, and leave the hidden copy for the steps that repeat. For more on where this approach fits, read automating a real browser with a local API.