Instruqt CLI

The Instruqt CLI helps you to create and manage labs.

$ instruqt lab --help
Create and manage labs

Usage:
  instruqt lab [command]

Available Commands:
  format      Format the lab config at the given path
  init        Initialize a new lab from an example
  validate    Validate a local lab

Flags:
  -h, --help   help for lab

Use "instruqt lab [command] --help" for more information about a command.

Create a new lab

$ instruqt lab init --help
The init command creates a new lab from an example.

Usage:
  instruqt lab init [flags]

Flags:
  -h, --help   help for init

The init command will initialize a new lab. You can pick an example to start from. It will then download the example to you local system.

$ instruqt lab init
==> Initializing lab from example
  Lab title
  The title of the lab, e.g. 'Introduction to Kubernetes'
  > My first lab

  Target directory
  Local directory where to create the lab
  > my-first-lab/

┃ Pick an example to start from:
┃ > Container Terminal
┃   Container Service
┃   Quiz
┃   Task

  Create lab?

    Yes     No
    
==> Downloading example lab to: my-first-lab/
my-first-lab/
├── instructions/
│   └── page.md
├── content.hcl
├── layouts.hcl
├── main.hcl
├── page.md
├── sandbox.hcl
└── tabs.hcl

Validate lab configuration

$ instruqt lab validate --help
The validate command checks the local lab config. 
Path defaults to the current directory.

Usage:
  instruqt lab validate [path] [flags]

Flags:
  -h, --help   help for validate

The validate command can be used to check whether the lab configuration is valid. It will check for:

  • Valid configuration syntax

  • Required parameters

  • References to resources

Format lab config files

$ instruqt lab format --help
The format command formats the lab config at the given path.
If no path is given, it defaults to the current directory.

Usage:
  instruqt lab format [file | path] [flags]

Aliases:
  format, fmt

Flags:
  -h, --help   help for format

The format command can be used to apply standardized formatting to all lab configuration files.

View debug logs

$ instruqt lab logs --help
The logs command tails logs of the lab.

Usage:
  instruqt lab logs [team/lab] [flags]

Flags:
  -h, --help              help for logs
      --session string    The session ID. When set, this will take precedence over lab slug
      --severity string   Log severity, defaults to INFO. (default "INFO")
      --since string      The start datetime from which to return logs, either in relative duration (see: https://golang.org/pkg/time/#ParseDuration) or absolute format (RFC3339, https://golang.org/pkg/time/#Parse), defaults to 1 minute ago (default "-1m")

The logs endpoint can be used to view the logs for:

  • A specific session by using the --session flag with a session ID

  • All sessions of a particular lab by specifying the team/lab argument

Last updated