Skip to main content
Transform your testing process with: Company-wide Licences, Test Observability & App Percy
No Result Found

Percy commands

This page provides Percy commands overview.

Use this reference guide to understand and implement the essential Percy commands that enhance your visual testing workflow.

Commands

  • percy upload - upload a static directory of images.

  • percy config - manage configuration files.
  • percy build - interact with Percy builds.

This applies only when using the Percy SDK.


percy upload

Percy CLI command to upload a directory of static images to Percy for diffing.

Text
Copy icon Copy
```
Usage:
  $ percy upload [options] <dirname>
Arguments:
  dirname                 Directory of images to upload
Options:
  -f, --files [pattern]   One or more globs matching image file paths to upload (default:
                          "**/*.{png,jpg,jpeg}")
  -i, --ignore <pattern>  One or more globs matching image file paths to ignore
  -e, --strip-extensions  Strips file extensions from snapshot names
Percy options:
  -c, --config <file>     Config file path
  -d, --dry-run           Print snapshot names only
Global options:
  -v, --verbose           Log everything
  -q, --quiet             Log errors only
  -s, --silent            Log nothing
  -h, --help              Display command help
Examples:
  $ percy upload ./images

percy config

Percy CLI commands for creating, validating, and updating Percy configuration files:

  • percy config:create
  • percy config:validate
  • percy config:migrate

percy config:create

Create a Percy config file

Text
Copy icon Copy
```
Usage:
  $ percy config:create [options] [filepath]
Arguments:
  filepath       Optional config filepath
Options:
  --rc           Create a .percyrc file
  --yaml         Create a .percy.yaml file
  --yml          Create a .percy.yml file
  --json         Create a .percy.json file
  --js           Create a .percy.js file
Global options:
  -v, --verbose  Log everything
  -q, --quiet    Log errors only
  -s, --silent   Log nothing
  -h, --help     Display command help
Examples:
  $ percy config:create
  $ percy config:create --yaml
  $ percy config:create --json
  $ percy config:create --js
  $ percy config:create --rc
  $ percy config:create ./config/percy.yml

percy config:validate

Validate a Percy config file

Text
Copy icon Copy
```
Usage:
  $ percy config:validate [options] [filepath]
Arguments:
  filepath       Config filepath, detected by default
Global options:
  -v, --verbose  Log everything
  -q, --quiet    Log errors only
  -s, --silent   Log nothing
  -h, --help     Display command help
Examples:
  $ percy config:validate
  $ percy config:validate ./config/percy.yml

percy config:migrate

Migrate a Percy config file to the latest version Validate a Percy config file

Text
Copy icon Copy
```
Usage:
  $ percy config:migrate [options] [filepath] [output]
Arguments:
  filepath       Current config filepath, detected by default
  output         New config filepath to write to, defaults to 'filepath'
Options:
  -d, --dry-run  Print the new config without writing it
Global options:
  -v, --verbose  Log everything
  -q, --quiet    Log errors only
  -s, --silent   Log nothing
  -h, --help     Display command help
Examples:
  $ percy config:migrate
  $ percy config:migrate --dry-run
  $ percy config:migrate ./config/percy.yml
  $ percy config:migrate .percy.yml .percy.js

percy build

Commands for interacting with Percy builds:

  • percy build:finalize
  • percy build:wait

percy build:finalize

Finalize parallel Percy builds

Text
Copy icon Copy
```
Usage:
  $ percy build:finalize [options]
Global options:
  -v, --verbose  Log everything
  -q, --quiet    Log errors only
  -s, --silent   Log nothing
  -h, --help     Display command help

percy build:wait

Wait for a build to be finished

Text
Copy icon Copy
```
Usage:
  $ percy build:wait [options]
Options:
  -b, --build <id>       Build ID
  -p, --project <slug>   Build project slug, requires '--commit'
  -c, --commit <sha>     Build commit sha, requires '--project'
  -t, --timeout <ms>     Timeout before exiting without updates, defaults to 10 minutes
  -i, --interval <ms>    Interval at which to poll for updates, defaults to 10 second
  -f, --fail-on-changes  Exit with an error when diffs are found
  --pass-if-approved     Doesn't Exit with an error if the build is approved, requires '--fail-on-changes'
Global options:
  -v, --verbose          Log everything
  -q, --quiet            Log errors only
  -s, --silent           Log nothing
  -h, --help             Display command help
Examples:
  $ percy build:wait --build 2222222
  $ percy build:wait --project org/project --commit HEAD

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle