Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Control a headless browser console right from your terminal

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 CAKEFILE

PhantomJS Console

Control a headless browser console right from your terminal

Phantom Console Screencast


PhantomJS, the headless browser

got brew? lucky you:

$ brew update && brew install phantomjs

other systems: it's simple, too

1, 2 ... done

$ cake -l console

Put your commands in the following file:
$EDITOR .command.js

Exit with ^ + C

 > console.log(location)


# open command file
$ $EDITOR .command.js 

# start console
$ phantomjs

You can also use cake to open the command file and to start the console. This will let you run coffeescript commands.

$ cake -l console

Every time you hit save in your editor, the command will be executed within the scope of the passed location (a url or a local path)

How does it work?

PhantomJS executes, wich is continuously watching for changes of the .command.js file. When ever a change appears, it loads and deletes its contents and executes it as command within the scope of the passed location.

That's it. Feedback most welcome

Something went wrong with that request. Please try again.