captureme — CLI utility that helps you capture screenshots via browsers in the cloud

2 min read Original article ↗

Requirements

  • Node.js >= 0.10
  • npm

Installation

capturme is available on npm and should be installed globally:

  $ npm install captureme -g

Setup

captureme uses SauceLabs under the hood, so you'd need to sign up if you don't have an account yet. After that, configure the authentication credentials you'd like to use:

  $ export SAUCE_USERNAME="user"
  $ export SAUCE_ACCESS_KEY="key"

Capture sreenshots

Using captureme is easy. All you need to do is specify a URL to capture and a list of browsers:

  $ captureme --url http://vesln.com --browsers ie8,ipad6,iphone7,ff26,chrome30

You can also specify the size of the browsers:

  $ captureme --url http://vesln.com --browsers ff26 --size 800x600

captureme also works with localhost. It uses the awesome localtunnel project that exposes your localhost to the world temporally, so the browsers can open it:

  $ captureme --url http://localhost:8080/articles/chaijs --browsers ff26

--url is the url of the page that will be captured

--size browser size, example: 600x480

--browsers is a comma separated list with aliases for browsers to be used. See "Available aliases"

Debug

If you'd like to see a verbose output of what captureme is doing, you can do so by setting the DEBUG environment varialbe to "captureme:*":

  $ DEBUG=captureme:* captureme --url http://localhost:8080/ --browsers ff26

That will print information that could be useful when debugging problems or if you are curious what is currently going on.

Available aliases

  • ie6
  • ie7
  • ie8
  • ie9
  • ie10
  • ie11
  • ff20
  • ff21
  • ff22
  • ff23
  • ff24
  • ff25
  • ff26
  • ff27
  • chrome26
  • chrome27
  • chrome28
  • chrome29
  • chrome30
  • chrome31
  • chrome32
  • safari5
  • safari6
  • safari7
  • opera11
  • opera12
  • iphone5
  • iphone5.1
  • iphone6
  • iphone6.1
  • iphone7
  • ipad5
  • ipad5.1
  • ipad6
  • ipad6.1
  • ipad7

Custom aliases

You can override the default aliases or introduce your own by creating a JSON file in $HOME/.captureme.json. The file should be formatted like so:

  {
    "SOL": {
      "name": "internet explorer",
      "platform": "Windows XP",
      "version": "6"
    }
  }

See all available platforms on SauceLabs

License

MIT License