Skip to content
🍩 Official SpeedCurve CLI and Node.js API
Branch: master
Clone or download
Latest commit cff76aa Jul 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Try sudo Jul 3, 2019
.github Adjust screenshot generator Jun 12, 2019
__tests__ Use tabs for better readability Jul 5, 2019
docs Update support URL Jul 10, 2019
src Use tabs for better readability Jul 5, 2019
.eslintrc-src.js Convert codebase to TypeScript May 30, 2019
.eslintrc-test.js Convert codebase to TypeScript May 30, 2019
.gitignore Convert codebase to TypeScript May 30, 2019
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Feb 15, 2019
CONTRIBUTING.md
LICENSE Fix copyright notice Feb 14, 2019
README.md Update README.md Jul 15, 2019
api.md Update support URL Jul 10, 2019
package-lock.json 1.0.6 Jul 3, 2019
package.json Use tabs for better readability Jul 5, 2019
tsconfig.json Convert codebase to TypeScript May 30, 2019

README.md

SpeedCurve CLI

🍩 Official SpeedCurve CLI and Node.js API.

SpeedCurve CLI screenshot

CircleCI David

This package attempts to be a user-friendly wrapper around the SpeedCurve API. It currently supports:

  • Triggering deploys
  • Monitoring the status of deploys
  • Getting the status of performance budgets
  • Fetching synthetic test data
  • Listing sites in an account

Installation

The recommended installation method for the CLI is via npm:

npm install -g speedcurve

To use the Node.js API you should install it as a dependency of your project:

npm install --save speedcurve

Note that Node.js version 8 or higher is required.

Basic usage

The speedcurve CLI interacts with the SpeedCurve API using your SpeedCurve API key. This key can either be set as the SPEEDCURVE_API_KEY environment variable, e.g. SPEEDCURVE_API_KEY=xxx speedcurve deploy or can be specified using the --key flag e.g. speedcurve deploy --key=xxx.

See speedcurve --help for a list of all commands and options.

Available commands

speedcurve deploy

Create a deploy and trigger testing for one or more sites.

# Trigger testing for all sites
speedcurve deploy
Requesting deploys for 3 sites...
βœ” Deploy 481509 triggered 6 tests for Stuff
βœ” Deploy 481513 triggered 6 tests for Radio NZ
βœ” Deploy 481511 triggered 6 tests for NZ Herald

# Optionally add a short description and longer detail about the deploy
speedcurve deploy --note 'v2.11.8' --detail 'Inline critical CSS, bootstrap app on DOMContentLoaded'

# Specify which site(s) to trigger testing for. You can specify a name or an ID
speedcurve deploy --site 1043801 --site 'BBC News'

# Wait until all tests have completed before exiting
speedcurve deploy --wait

# Monitor the status of performance budgets
speedcurve deploy --check-budgets

speedcurve deploy-status

Get the status of a deploy.

# Human-readable output
speedcurve deploy-status 472470
βœ” Deploy complete. 36 tests completed.

# JSON output
speedcurve deploy-status --json 472470

speedcurve list-sites

List all of the sites in a team. Useful for finding the ID of a site to deploy.

# Human-readable output
speedcurve list-sites

# JSON output
speedcurve list-sites --json

speedcurve tests

Fetch synthetic test results as JSON for a site and all of its URLs.

# Get test results for all URLs in a site
speedcurve tests --site 1043801

# Specify which URL(s) to get test resuts for
speedcurve tests --site 1043801 --url 184629 --url 'BBC News'

# Control how many days of data to fetch, and filter to specific regions or browsers
speedcurve tests --site 'BBC News' --days 7 --region ap-southeast-2 --browser chrome

speedcurve budgets

Get the status of all synthetic performance budgets.

# Human-readable output
speedcurve budgets
βœ” Start Render Time in Article Render Times is under budget
Start Render Time (Syn), Radio NZ, Article is currently 1.1s (45% under budget)
Start Render Time (Syn), Stuff, Article is currently 1.5s (25% under budget)
Start Render Time (Syn), NZ Herald, Article is currently 2s (0% under budget)

βœ– Start Render Time in Home Render Times is over budget
Start Render Time (Syn), Radio NZ, Home is currently 4.9s (145% over budget)
Start Render Time (Syn), Stuff, Home is currently 1.7s (15% under budget)
Start Render Time (Syn), NZ Herald, Home is currently 1s (50% under budget)

# JSON output
speedcurve budgets --json

Node.js API documentation

See the API reference.

Contributing

Pull requests are welcome! Please read CONTRIBUTING.md first.

You can’t perform that action at this time.