@checkly/cli

Checkly CLI

Usage no npm install needed!

<script type="module">
  import checklyCli from 'https://cdn.skypack.dev/@checkly/cli';
</script>

README

🚨 This project is still in very early stages and is not stable, use at your own risk! 🚨

checkly-cli

oclif Version Downloads/week

Table of Contents

Getting Started

This CLI enables a monitoring as code workflow where your checks live side-by-side with your code in your source control system.

To get started, install the CLI globally. You can also run it in an ad-hoc manner via npx every time.

  1. npm install -g @checkly/cli

Next, cd to a project you'd like to monitor with Checkly.

  1. cd /opt/checkly/checklyhq.com

You can now authenticate via the CLI and initialise the .checkly subdirectory.

  1. checkly login

  2. checkly init

The init command will walk you through a short wizard to get your project setup with an example check.

Now you should have a .checkly subdirectory in your project, which you should commit to source control, and a check yaml file like .checkly/checks/exammple-browser.yml.

After inspecting the check definition, making any changes, etc. you can deploy the local checks to our backend via deploy.

  1. checkly deploy

Your checks are now synced and running on checkly!

Checkout app.checklyhq.com to see your checks in the web application.

Usage

$ npm install -g @checkly/cli
$ checkly COMMAND
running command...
$ checkly (-v|--version|version)
@checkly/cli/0.2.29 linux-x64 node-v14.18.3
$ checkly --help [COMMAND]
USAGE
  $ checkly COMMAND
...

Commands

checkly accounts ACTION

Manage accounts

USAGE
  $ checkly accounts ACTION

ARGUMENTS
  ACTION  (list|info) [default: list] Specify the type of action to run

OPTIONS
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/accounts.js

checkly add RESOURCE

Add a new checkly resource

USAGE
  $ checkly add RESOURCE

ARGUMENTS
  RESOURCE  (check|group|alert-channel) [default: check] What do you want to create?

See code: src/commands/add.js

checkly checks ACTION [ID]

Manage Checks

USAGE
  $ checkly checks ACTION [ID]

ARGUMENTS
  ACTION  (list|info) [default: list] Specify the type of action to run
  ID      Specify the resource ID

OPTIONS
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/checks.js

checkly deploy

Deploy and sync your ./checkly directory

USAGE
  $ checkly deploy

OPTIONS
  -f, --force    force mode
  -p, --preview  Show state preview
  -x, --dryRun   Do not actually write any changes

See code: src/commands/deploy.js

checkly groups ACTION [ID]

Manage Groups

USAGE
  $ checkly groups ACTION [ID]

ARGUMENTS
  ACTION  (list|info) [default: list] Specify the type of action to run
  ID      Specify the resource ID

OPTIONS
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/groups.js

checkly help [COMMAND]

display help for checkly

USAGE
  $ checkly help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

checkly init PROJECTNAME

Initialise a new Checkly Project

USAGE
  $ checkly init PROJECTNAME

ARGUMENTS
  PROJECTNAME  [default: checkly-cli] Project name

OPTIONS
  -f, --force  force mode

See code: src/commands/init.js

checkly link [ID]

Link your checkly directory with an existing project

USAGE
  $ checkly link [ID]

ARGUMENTS
  ID  Specify the projectId

OPTIONS
  -f, --force  force mode

See code: src/commands/link.js

checkly login

Login with a Checkly API Key

USAGE
  $ checkly login

OPTIONS
  -i, --account-id=account-id  Checkly account ID. (This flag is required if you are using -k (--api-key) flag

  -k, --api-key=api-key        Checkly User API Key.
                               If you did not have one, create it at: https://app.checklyhq.com/account/api-keys

See code: src/commands/login.js

checkly logout

Logout and clear local conf

USAGE
  $ checkly logout

OPTIONS
  -f, --force  force mode

See code: src/commands/logout.js

checkly projects [ACTION]

Manage Projects

USAGE
  $ checkly projects [ACTION]

ARGUMENTS
  ACTION  (list|create|delete) [default: list] Project action to execute

OPTIONS
  -i, --projectId=projectId      project id
  -n, --name=name                project name
  -o, --output=plain|human|json  [default: human] output type
  -r, --repoUrl=repoUrl          repo url

See code: src/commands/projects.js

checkly run [CHECKPATH]

Run and test your checks on Checkly

USAGE
  $ checkly run [CHECKPATH]

ARGUMENTS
  CHECKPATH  Which check would you like to execute?

OPTIONS
  -l, --location=location        [default: eu-central-1] Where should the check run at?
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/run.js

checkly status ACTION

Status dashboard

USAGE
  $ checkly status ACTION

ARGUMENTS
  ACTION  (list|info) [default: list] Specify the type of action to run

OPTIONS
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/status.js

checkly switch

Switch user account

USAGE
  $ checkly switch

OPTIONS
  -a, --account-id=account-id    The id of the account you want to switch.
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/switch.js

checkly whoami

See your logged account and user

USAGE
  $ checkly whoami

OPTIONS
  -o, --output=plain|human|json  [default: human] output type

See code: src/commands/whoami.js

Troubleshooting

You can enable global debug output by setting the DEBUG=*.

For example:

DEBUG=* checkly init

Contributing

All contributions are welcome, please stick to the eslint and prettier settings.

License

Apache 2.0