UNPKG

3.74 kBMarkdownView Raw
1@percy/agent
2============
3
4A low-level Node process for interacting with Percy.
5
6[![Version](https://img.shields.io/npm/v/@percy/agent.svg)](https://npmjs.org/package/@percy/agent)
7[![CircleCI](https://circleci.com/gh/percy/percy-agent/tree/master.svg?style=shield)](https://circleci.com/gh/percy/percy-agent/tree/master)
8[![Downloads/week](https://img.shields.io/npm/dw/@percy/agent.svg)](https://npmjs.org/package/@percy/agent)
9[![License](https://img.shields.io/npm/l/@percy/agent.svg)](https://github.com/percy/percy-agent/blob/master/package.json)
10
11<!-- toc -->
12* [Usage](#usage)
13* [Commands](#commands)
14<!-- tocstop -->
15# Usage
16<!-- usage -->
17```sh-session
18$ npm install -g @percy/agent
19$ percy COMMAND
20running command...
21$ percy (-v|--version|version)
22@percy/agent/0.4.9 linux-x64 node-v10.15.3
23$ percy --help [COMMAND]
24USAGE
25 $ percy COMMAND
26...
27```
28<!-- usagestop -->
29# Commands
30<!-- commands -->
31* [`percy exec`](#percy-exec)
32* [`percy finalize`](#percy-finalize)
33* [`percy help [COMMAND]`](#percy-help-command)
34* [`percy snapshot SNAPSHOTDIRECTORY`](#percy-snapshot-snapshotdirectory)
35
36## `percy exec`
37
38Start and stop Percy around a supplied command.
39
40```
41USAGE
42 $ percy exec
43
44OPTIONS
45 -p, --port=port [default: 5338] port
46 -t, --network-idle-timeout=network-idle-timeout [default: 50] asset discovery network idle timeout (in milliseconds)
47
48EXAMPLES
49 $ percy exec -- echo "percy is running around this echo command"
50 $ percy exec -- bash -c "echo foo && echo bar"
51```
52
53_See code: [dist/commands/exec.ts](https://github.com/percy/percy-agent/blob/v0.4.9/dist/commands/exec.ts)_
54
55## `percy finalize`
56
57Finalize a build. Commonly used for parallelized builds, especially when the number of parallelized processes is unknown.
58
59```
60USAGE
61 $ percy finalize
62
63OPTIONS
64 -a, --all (required)
65
66EXAMPLE
67 $ percy finalize --all
68 [percy] Finalized parallel build.
69```
70
71_See code: [dist/commands/finalize.ts](https://github.com/percy/percy-agent/blob/v0.4.9/dist/commands/finalize.ts)_
72
73## `percy help [COMMAND]`
74
75display help for percy
76
77```
78USAGE
79 $ percy help [COMMAND]
80
81ARGUMENTS
82 COMMAND command to show help for
83
84OPTIONS
85 --all see all commands in CLI
86```
87
88_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.1.6/src/commands/help.ts)_
89
90## `percy snapshot SNAPSHOTDIRECTORY`
91
92Snapshot a directory containing a pre-built static website.
93
94```
95USAGE
96 $ percy snapshot SNAPSHOTDIRECTORY
97
98ARGUMENTS
99 SNAPSHOTDIRECTORY A path to the directory you would like to snapshot
100
101OPTIONS
102 -b, --base-url=base-url [default: /] If your static files will be hosted in a subdirectory,
103 instead
104 of the webserver's root path, set that subdirectory with this flag.
105
106 -i, --ignore-files=ignore-files Glob or comma-seperated string of globs for matching the files and
107 directories to ignore.
108
109 -p, --port=port [default: 5338] Port
110
111 -s, --snapshot-files=snapshot-files [default: **/*.html,**/*.htm] Glob or comma-seperated string of globs
112 for matching the files and directories to snapshot.
113
114 -t, --network-idle-timeout=network-idle-timeout [default: 50] Asset discovery network idle timeout (in milliseconds)
115
116EXAMPLES
117 $ percy snapshot _site/
118 $ percy snapshot _site/ --base-url "/blog"
119 $ percy snapshot _site/ --ignore-files "/blog/drafts/**"
120```
121
122_See code: [dist/commands/snapshot.ts](https://github.com/percy/percy-agent/blob/v0.4.9/dist/commands/snapshot.ts)_
123<!-- commandsstop -->