@ampproject/toolbox-cli v2.10.1
AMP-Toolbox CLI
The AMP Toolbox command line interface consists of a Node.js program called amp that can be run from a Windows, macOS, of UNIX-compatible command line environment. This way, AMP Toolbox can easily be integrated into a command line build process.
Supported commands:
- curls: generate AMP cache URL(s)
- download: download the AMP runtime
- help: lists all commands
- lint: checks document for errors
- optimize: runs AMP Optimizer for a given URL or file
- runtime-version: shows the current AMP runtime version production
- update-cache removes documents from the AMP Caches
- version: shows the current AMP Toolbox version
Installation
Install via:
$ npm install @ampproject/toolbox-cli -gCommands
curls
Translate a URL to AMP Cache URLs:
$ amp curls https://amp.devdownload
Download a complete AMP runtime:
$ amp downloadSupports options for specifying a custom host, version, and destination directory. See amp help download for the complete list.
help
Displays the help menu, listing all available commands:
$ amp helpPass a command to get more information about this specific command
$ amp help [command]Example:
$ amp help update-cachelint
Runs the AMP Linter for the given URL:
$ amp lint https://amp.devoptimize
Runs AMP Optimizer for the given file or URL:
$ amp optimize https://amp.devor
$ amp optimize file.htmlruntime-version
Prints the current AMP version:
$ amp runtime-version
=> 011905291911450Supports options for specifying a custom host or getting the canary version. See amp help runtime-version for the complete list.
update-cache
Uses the AMP update-cache API to update documents stored in AMP Caches.
It requires the public and private keys to be generated, as described on the documentation. Only the private key is required to generate the cache invalidation URLs, but the public key must be made available to the AMP Caches, as described in the guidelines.
By default, the application will look for the private key on a file called privateKey.pem, on the current working directory.
$ amp update-cache https://www.example.com/Optionally, use the --privateKey parameter to specify the path for the private key.
$ amp update-cache https://www.example.com/ --privateKey /path/to/private-key.pemversion
Prints the current AMP Toolbox version:
$ amp version
=> v2.7.61 year ago
1 year ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago