CLI 1.2.0: Download Artifacts, GraphQL and More!

Michael Dijkstra

Michael Dijkstra

February 21, 2019

To date the Calibre CLI has been used for testing performance following deployments, creating custom reports and dashboards and improving performance workflows. With our latest release you can get even more access to Calibre's features directly from the command line or in your node application.

What's new

Call the Calibre GraphQL API

You can now make direct requests to the GraphQL API which opens up numerous possibilities to integrate Calibre into your delivery pipelines, reporting tools and workflow.

For example, you can read individual metrics with the following query:

1calibre request --query='query GetSite($site: String!) {
2 organisation: {
3 site(slug: $site) {
4 metricsHistory(measurement: $measurement, page: $page) {
5 current
6 oneMonth
7 threeMonth
8 sixMonth
9 }
10 }
11 }
12}' --site='<slug>' --measurement='<metric>' --page='<uuid>'

Or you could update a metric budget to include a new page with the following mutation:

1calibre request --query='mutation UpdateMetricBudget($site: String!, $uuid: String!, $pages: [String!]) {
2 updateMetricBudget(
3 site: $site
4 uuid: $uuid
5 attributes: { pages: $pages }
6 ) {
7 uuid
8 }
9}' --site='<slug>' --uuid='<budget uuid>' --pages='["<page uuid>"]'

You can see the full GraphQL schema in our new API Documentation.

Effortlessly download Lighthouse.json, Screenshots, Render videos and GIFs!

It's now possible to download the artifacts that Calibre generates for each snapshot or one off test.

1calibre site download-snapshot-artifacts --site=<slug> <id>

Downloads the artifacts of a snapshot to ./snapshot-artifacts/<uuid>.

This also generates manifest.json, which makes it possible to programmatically read and use the assets from each test.

One off tests
1calibre test download-artifact <uuid>

Downloads the artifacts of a test to ./test-artifacts/<uuid>

What else has changed

  • calibre site delete-snapshot now uses id rather than iid.
  • calibre site get-pulse-metrics will return data for all pages (Previously the --page flag was required).
  • Reimplemented support for node 8 with a 1.2.1 release

Execute GraphQL queries from Node.js

With the addition of the ability to make GraphQL requests directly to the Calibre API we implemented a new GraphQL module in the node API.

1const { GraphQL } = '/calibre'
3const query = `
4 query Site($slug: String!){
5 organisation {
6 site(slug: $slug) {
7 name
8 slug
9 }
10 }
11 }
12 `
14const result = GraphQL.request({ query, slug: 'calibre' })

Check out our Node.js examples to see it in action.

Try it out today!

Update existing applications to the latest release with one of the following options:

  • Run npm install calibre
  • Run yarn add calibre
  • Download and install a standalone binary for Mac, Windows or Linux .

If you haven't tried the CLI yet, here's a short guide to get you started automating your performance system in no time.

Michael Dijkstra

Michael Dijkstra

Michael is a product-minded developer with more than 10 years experience across the entire product stack. Find him on LinkedIn.


Get notified about new articles and speed monitoring features

We will send you our latest web performance advice and notifications about new Calibre features.