A command-line interface for interacting with the Octomind API. This CLI allows you to execute tests, retrieve test reports, and manage private locations as well as environments. See API documentation

Installation

  1. Use the cli through npx e.g.
npx @octomind/octomind -h
  1. For global installation see installation

Octomind

Octomind cli tool. Additional documentation see https://octomind.dev/docs/api-reference/ Usage:
octomind [options] [command]

Options

OptionDescriptionRequiredDefault
-V, --versionoutput the version numberNo

octomind CLI Documentation

Octomind cli tool. Additional documentation see https://octomind.dev/docs/api-reference/

Setup

init

Initialize configuration by setting up API key. This will create a config file in ~/.config/octomind.json Usage:
octomind init [options]
Example:
octomind init --test-target-id 3435918b-3d29-4ebd-8c68-9a540532f45a --api-key your-api-key

Options

OptionDescriptionRequiredDefault
-t, --test-target-id <id>Test target IDYes
-k, --api-key <key>the api key for authenticationYes
-f, --forceForce overwrite existing configurationNo

switch-test-target

Switch to a different test target. This will list all available test targets and update the config file in ~/.config/octomind.json Usage:
octomind switch-test-target [options]
Example:
octomind switch-test-target

Completion

install-completion

Install tab completion Usage:
octomind install-completion [options]
Example:
octomind install-completion

uninstall-completion

Uninstall tab completion Usage:
octomind uninstall-completion [options]
Example:
octomind uninstall-completion

completion

Tab completion Usage:
octomind completion [options]
Example:
octomind completion

Environments

list-environments

List all environments Usage:
octomind list-environments [options]
Example:
octomind list-environments

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

create-environment

Create a new environment Usage:
octomind create-environment [options]
Example:
octomind create-environment --name "Production" --discovery-url https://example.com

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-n, --name <name>Environment nameYes
-d, --discovery-url <url>Discovery URLYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo
--test-account-username [username]Test account usernameNo
--test-account-password [password]Test account passwordNo
--test-account-otp-initializer-key [key]Test account OTP initializer keyNo
--basic-auth-username [username]Basic auth usernameNo
--basic-auth-password [password]Basic auth passwordNo
--private-location-name [name]Private location nameNo

environment

Get an environment Usage: environment [options]

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-e, --environment-id <id>Environment IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

update-environment

Update an existing environment Usage: update-environment [options]

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-e, --environment-id <id>Environment IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo
-n, --name [name]Environment nameNo
-d, --discovery-url [url]Discovery URLNo
--test-account-username [username]Test account usernameNo
--test-account-password [password]Test account passwordNo
--test-account-otp-initializer-key [key]Test account OTP initializer keyNo
--basic-auth-username [username]Basic auth usernameNo
--basic-auth-password [password]Basic auth passwordNo
--private-location-name [name]Private location nameNo

delete-environment

Delete an environment Usage:
octomind delete-environment [options]
Example:
octomind delete-environment --environment-id 826c15af-644b-4b28-89b4-f50ff34e46b7

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-e, --environment-id <id>Environment IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

Execute

debug

run test cases against local build Usage: debug [options]

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-u, --url <url>url the tests should run againstYes
-c, --test-case-id [uuid]id of the test case you want to run, if not provided will run all test cases in the test targetNo
-e, --environment-id [uuid]id of the environment you want to run against, if not provided will run all test cases against the default environmentNo
-t, --test-target-id [uuid]id of the test target of the test case, if not provided will use the test target id from the configNo
--headlessif we should run headless without the UI of playwright and the browserNo
--persistif we should write playwright config and files to current directory, you can then run ‘npx playwright test’ to run them againNo
--grep [substring]filter test cases by substringNo

execute

Execute test cases to create a test report Usage:
octomind execute [options]
Example:
octomind execute --url https://example.com

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-u, --url <url>URL to testYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo
-e, --environment-name [name]Environment nameNodefault
-d, --description [text]Test descriptionNo
-g, --tags [tags]comma separated list of tagsNo
-v, --variables-to-overwrite [variables]JSON object of variables to overwriteNo

create-discovery

Create a new test case discovery Usage:
octomind create-discovery [options]
Example:
octomind create-discovery --name "Login Test" --prompt "Test the login functionality"

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-n, --name <name>Discovery nameYes
-p, --prompt <prompt>Discovery promptYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo
-e, --entry-point-url-path [path]Entry point URL pathNo
--prerequisite-id [id]Prerequisite test case IDNo
--external-id [id]External identifierNo
--assigned-tag-ids [ids]Comma-separated list of tag IDsNo
--folder-id [id]Folder IDNo

Notifications

notifications

Get notifications for a test target Usage:
octomind notifications [options]
Example:
octomind notifications

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

Private Locations

register-location

Register a private location Usage:
octomind register-location [options]
Example:
octomind register-location --name "Office Network" --address 192.168.1.100 --username user --password pass

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-n, --name <name>Location nameYes
-p, --password <password>Proxy passwordYes
-u, --username <user>Proxy userYes
-a, --address <address>Location addressYes

unregister-location

Unregister a private location Usage:
octomind unregister-location [options]
Example:
octomind unregister-location --location-id 7f8d6e5c-4b3a-2a1c-0f9e-8d7c6b5a4b3a

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-n, --name <name>Location nameYes

list-private-locations

List all private locations Usage:
octomind list-private-locations [options]
Example:
octomind list-private-locations

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo

start-private-location

Start a private location worker, see https://octomind.dev/docs/proxy/private-location Usage:
octomind start-private-location [options]
Example:
octomind start-private-location --name "Office Network"

Options

OptionDescriptionRequiredDefault
-n, --name [name]Location nameNo
-u, --username [username]Proxy userNo
-p, --password [password]Proxy passwordNo
-l, --host-networkUse host network (default: false). If set you can use localhost directlyNofalse

stop-private-location

Stop a private location worker, see https://octomind.dev/docs/proxy/private-location Usage:
octomind stop-private-location [options]
Example:
octomind stop-private-location

Test Cases

delete-test-case

Delete a test case Usage: delete-test-case [options]

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-c, --test-case-id <id>Test case IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

code

Get the code of a specific test case Usage: code [options]

Options

OptionDescriptionRequiredDefault
-c, --test-case-id <id>Test case IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo
-e, --environment-id [id]Environment IDNodefault
-u, --url <url>URL to execute the test case againstYes
Usage:
octomind code [options]
Example:
octomind code --test-case-id 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d --url https://example.com
Output:
import {
  test,
  expect,
  chromium,
  Browser,
  type CDPSession,
  type TestInfo,
  type Locator,
  type Page,
  type Response,
  type BrowserContext,
  type FileChooser,
} from "@playwright/test";
import fs from "fs";
import os from "os";
import path from "path";
import fsPromises from "fs/promises";
import { setTimeout } from "timers/promises";
import { Readable } from "stream";
import { finished } from "stream/promises";
import { URL } from "url";

declare global {
  interface Window {
    octomindWrittenValueTracker?: WeakMap<HTMLElement, string>;
  }
}

const handleHydrationIssues = async (
...

test-case

Get details of a specific test case Usage:
octomind test-case [options]
Example:
octomind test-case --test-case-id 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-c, --test-case-id <id>Test case IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

list-test-cases

List all test cases Usage:
octomind list-test-cases [options]
Example:
octomind list-test-cases

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

Test Reports

test-report

Get test report details Usage:
octomind test-report [options]
Example:
octomind test-report --test-report-id 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo
-r, --test-report-id <id>Test report IDYes
-t, --test-target-id [id]Test target ID, if not provided will use the test target id from the configNo

Test Targets

list-test-targets

List all test targets Usage:
octomind list-test-targets [options]
Example:
octomind list-test-targets

Options

OptionDescriptionRequiredDefault
-j, --jsonOutput raw JSON responseNo

Output Formats

By default, the CLI provides formatted text output for better readability. Add the --json flag to any command to get the raw JSON response instead. This is useful for scripting or when you need to process the output programmatically. Example of JSON output:
{
  "id": "826c15af-644b-4b28-89b4-f50ff34e46b7",
  "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a",
  "status": "PASSED",
  "executionUrl": "https://example.com",
  "testResults": [
    {
      "id": "abc-123-456",
      "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a",
      "testCaseId": "test-1",
      "status": "PASSED",
      "traceUrl": "https://storage.googleapis.com/automagically-traces/abc-123-trace.zip"
    },
    {
      "id": "def-456-789",
      "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a",
      "testCaseId": "test-2",
      "status": "PASSED",
      "traceUrl": "https://storage.googleapis.com/automagically-traces/def-456-trace.zip"
    }
  ]
}

Development

  1. Clone the repository
  2. Install dependencies:
pnpm install
The CLI is written in TypeScript and uses the following dependencies: To build from source:
pnpm run build