Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"plugin:github/recommended",
"plugin:prettier/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
"plugin:import/typescript",
"plugin:@typescript-eslint/strict"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: "https://registry.npmjs.org"
cache: "pnpm"

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
notes.txt
dist/
node_modules/
node_modules/
.idea
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 GitHub, Inc. and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
51 changes: 22 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Octomind CLI

![Continuous Integration](https://github.com/octomind-dev/cli/actions/workflows/ts.yml/badge.svg)

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](https://octomind.dev/docs/api-reference/)

## Installation
## Usage

1. Clone the repository
2. Install dependencies:
```bash
pnpm install
```
1. Install the package - `npm i -g @octomind/cli` and use it directly e.g. `@octomind/cli -h`
2. Use the cli through npx e.g. `npx @octomind/cli -h`

## Commands

Expand All @@ -19,7 +18,7 @@ pnpm install
Run test cases against a specified URL.

```bash
tsx src/index.ts execute \
npx @octomind/cli execute \
--api-key <key> \
--test-target-id <id> \
--url <url> \
Expand All @@ -41,7 +40,7 @@ Options:
Retrieve details about a specific test report.

```bash
tsx src/index.ts report \
npx @octomind/cli report \
--api-key <key> \
--test-target-id <id> \
--report-id <id> \
Expand Down Expand Up @@ -98,7 +97,7 @@ Example JSON output:
Register a new private location worker. If you use the [private location worker](https://github.com/OctoMind-dev/private-location-worker) it will register itself on startup automatically.

```bash
tsx src/index.ts register-location \
npx @octomind/cli register-location \
--api-key <key> \
--name <name> \
--proxypass <password> \
Expand All @@ -120,7 +119,7 @@ Options:
Remove a registered private location worker. If you use the [private location worker](https://github.com/OctoMind-dev/private-location-worker) it will unregister itself when going offline automatically.

```bash
tsx src/index.ts unregister-location \
npx @octomind/cli unregister-location \
--api-key <key> \
--name <name> \
[--json]
Expand All @@ -136,7 +135,7 @@ Options:
List all registered private locations.

```bash
tsx src/index.ts list-private-locations \
npx @octomind/cli list-private-locations \
--api-key <key> \
[--json]
```
Expand All @@ -161,7 +160,7 @@ Private Locations:
List all available environments.

```bash
tsx src/index.ts list-environments \
npx @octomind/cli list-environments \
--api-key <key> \
--test-target-id <id> \
[--json]
Expand All @@ -177,7 +176,7 @@ Options:
Create a new environment for a test target.

```bash
tsx src/index.ts create-environment \
npx @octomind/cli create-environment \
--api-key <key> \
--test-target-id <id> \
--name <name> \
Expand Down Expand Up @@ -211,7 +210,7 @@ Options:
Update an existing environment.

```bash
tsx src/index.ts update-environment \
npx @octomind/cli update-environment \
--api-key <key> \
--test-target-id <id> \
--environment-id <id> \
Expand Down Expand Up @@ -247,7 +246,7 @@ Options:
Delete an existing environment.

```bash
tsx src/index.ts delete-environment \
npx @octomind/cli delete-environment \
--api-key <key> \
--test-target-id <id> \
--environment-id <id> \
Expand Down Expand Up @@ -290,25 +289,19 @@ Example of JSON output:
}
```

## Error Handling

The CLI will:
- Validate required parameters before making API calls
- Display clear error messages for missing or invalid parameters
- Show API error responses with details when available
- Exit with status code 1 on errors

## Development

1. Clone the repository
2. Install dependencies:
```bash
pnpm install
```

The CLI is written in TypeScript and uses the following dependencies:
- `commander`: For command-line argument parsing
- `axios`: For making HTTP requests

To build from source:
```bash
npm run build
```

## License

This project is licensed under the MIT License - see the LICENSE file for details.
pnpm run build
```
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "octomind-cli",
"version": "1.0.1",
"name": "@octomind/cli",
"version": "1.0.0",
"description": "a command line client for octomind apis",
"main": "./dist/index.js",
"packageManager": "pnpm@9.5.0+sha256.dbdf5961c32909fb030595a9daa1dae720162e658609a8f92f2fa99835510ca5",
"packageManager": "pnpm@9.15.6+sha512.139cab068fdf0b751268179ac5f909b5be72afb4a75c513d1905d151befc8977b593d3cf8671ed83d4d6637c5c94b98ffbce108125de4a5a27a31233601a99de",
"engines": {
"node": ">=20.0.0"
},
Expand All @@ -16,7 +16,7 @@
},
"keywords": [],
"author": "",
"license": "ISC",
"license": "MIT",
"dependencies": {
"axios": "^1.7.9",
"commander": "^13.1.0",
Expand Down
Loading
Loading