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
This applies only when using the Percy SDK.
percy upload
Percy CLI command to upload a directory of static images to Percy for diffing.
```
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
```
Copy icon
Copy
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
```
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
```
Copy icon
Copy
percy config:validate
Validate a Percy config file
```
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
```
Copy icon
Copy
percy config:migrate
Migrate a Percy config file to the latest version
Validate a Percy config file
```
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
```
Copy icon
Copy
percy build
Commands for interacting with Percy builds:
percy build:finalize
percy build:wait
percy build:finalize
Finalize parallel Percy builds
```
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
```
Copy icon
Copy
percy build:wait
Wait for a build to be finished
```
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
```
Copy icon
Copy
Is this page helping you?
Thank you for your valuable feedback!