### [percy-cli on GitHub](🔗)
Percy makes it very simple to integrate visual regression testing for static websites, no matter what tools were used to generate it.
This can be especially useful for static sites generated by [Jekyll](🔗) (ie. for GitHub Pages), [Grow](🔗), [Middleman](🔗), or other static site generators.
Make sure you have completed [Setup](🔗) of your CI service first. You can also test Percy in your [local development](🔗) environment.
First, install the Percy command-line client:
If you already have the client installed, you can update your old version by running:
# Local testing
Percy CLI relies on the `
PERCY_TOKEN` environment variable for authenticating and authorizing access to each repository.
You can temporarily set it in your local shell session by exporting the variable:
Or you can set it just for the current command:
IMPORTANT: Keep your Percy token secret. Anyone with access to your token can consume your account quota, though they cannot read data.
See the Setup guides for how to securely set environment variables in your CI service.
If your static site exists in a directory called `
_site`, it's as simple as this:
Percy now starts rendering pages and generating visual diffs for your site. Under the hood, Percy only uploads files that have changed---so after the first time this command is run, future runs will be very fast.
## In a CI service
You can do the above steps locally for testing, but to get continuous visual integration for your static site you'll need to run the `
gem install percy-cli` and `
percy snapshot _site/` commands as CI build steps for your project.
For example, in Travis CI, we can add these steps to `
The steps will be similar when configuring other CI services or other static site generators.
## Responsive testing
You can use Percy [responsive visual diffs](🔗) to test pages at different CSS breakpoints. Just pass the `
--widths` flag with a comma-separated list of widths.
## Base URL path
If your static files are hosted in a sub-directory instead of the webserver root, you will need to provide the `
For Jekyll users, this should be set to the same as your `
baseurl` config setting.
[percy-cli releases on GitHub](🔗)
Fork it (<https://github.com/percy/percy-cli/fork>)
Create your feature branch (`
git checkout -b my-new-feature`)
Commit your changes (`
git commit -am 'Add some feature'`)
Push to the branch (`
git push origin my-new-feature`)
Create a new Pull Request
[Throw a ★ on it!](🔗)