@supercheck/cli 0.1.0-beta.2 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # @supercheck/cli
2
2
 
3
- Supercheck CLI monitoring-as-code for Playwright and k6.
3
+ Open-Source Testing, Monitoring, and Reliability as Code.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@supercheck/cli.svg)](https://www.npmjs.com/package/@supercheck/cli)
6
+ [![License](https://img.shields.io/badge/license-Supercheck_Community_License-blue.svg)](LICENSE)
7
+
8
+ The Supercheck CLI provides a first-class command-line interface for managing your testing and monitoring infrastructure as code. It is designed for CI/CD integration, automation, and power-user workflows.
9
+
10
+ ## Features
11
+
12
+ - **Monitoring-as-Code**: Define monitors, tests, and status pages in TypeScript.
13
+ - **CI/CD Integration**: Trigger jobs and wait for results directly from your pipeline.
14
+ - **Local Development**: Run and debug tests locally before deploying.
15
+ - **Full API Access**: Manage all resources (jobs, variables, tags) from the terminal.
4
16
 
5
17
  ## Installation
6
18
 
@@ -8,31 +20,68 @@ Supercheck CLI — monitoring-as-code for Playwright and k6.
8
20
  npm install -g @supercheck/cli
9
21
  ```
10
22
 
11
- Or use with npx:
23
+ Or run directly with `npx`:
12
24
 
13
25
  ```bash
14
- npx @supercheck/cli
26
+ npx @supercheck/cli --help
15
27
  ```
16
28
 
17
29
  ## Quick Start
18
30
 
19
- ```bash
20
- # Initialize a new project
21
- supercheck init
31
+ 1. **Initialize a new project**:
32
+ ```bash
33
+ supercheck init
34
+ ```
35
+ This creates a `supercheck.config.ts` and a `_supercheck_` directory with example tests.
22
36
 
23
- # Authenticate
24
- supercheck login --token <your-token>
37
+ 2. **Authenticate**:
38
+ ```bash
39
+ supercheck login --token sck_live_...
40
+ ```
41
+ You can generate a CLI token in your Dashboard under **Project Settings > CLI Tokens**.
25
42
 
26
- # Validate config
27
- supercheck config validate
43
+ 3. **Validate configuration**:
44
+ ```bash
45
+ supercheck config validate
46
+ ```
28
47
 
29
- # Check API health
30
- supercheck health
31
- ```
48
+ 4. **Deploy to Cloud**:
49
+ ```bash
50
+ supercheck deploy
51
+ ```
52
+
53
+ ## Command Reference
54
+
55
+ ### Authentication
56
+
57
+ - `supercheck login --token <token>`: Authenticate with a CLI token.
58
+ - `supercheck logout`: clear stored credentials.
59
+ - `supercheck whoami`: Show current authentication context.
60
+
61
+ ### Jobs & Runs
62
+
63
+ - `supercheck job list`: List all jobs.
64
+ - `supercheck job trigger <id> --wait`: Trigger a job and wait for completion (ideal for CI/CD).
65
+ - `supercheck job run --id <id>`: Run a job immediately.
66
+ - `supercheck run list`: List recent execution runs.
67
+ - `supercheck run stream <id>`: Stream live console output from a running job.
68
+
69
+ ### Tests & Monitors
70
+
71
+ - `supercheck test list`: List all tests.
72
+ - `supercheck test create --file <path>`: Create a new test from a script file.
73
+ - `supercheck monitor list`: List all monitors.
74
+ - `supercheck monitor status <id>`: Check the real-time status of a monitor.
75
+
76
+ ### Resources
77
+
78
+ - `supercheck pull`: Sync cloud resources to your local config.
79
+ - `supercheck diff`: Preview changes between local config and cloud.
80
+ - `supercheck deploy`: Apply local config changes to the cloud.
32
81
 
33
82
  ## Configuration
34
83
 
35
- Create a `supercheck.config.ts` in your project root:
84
+ The `supercheck.config.ts` file is the source of truth for your project configuration.
36
85
 
37
86
  ```typescript
38
87
  import { defineConfig } from '@supercheck/cli'
@@ -40,40 +89,49 @@ import { defineConfig } from '@supercheck/cli'
40
89
  export default defineConfig({
41
90
  schemaVersion: '1.0',
42
91
  project: {
43
- organization: 'my-org',
44
- project: 'my-project',
92
+ organization: 'my-org-slug',
93
+ project: 'my-project-slug',
45
94
  },
46
95
  tests: {
47
96
  playwright: {
48
97
  testMatch: '_supercheck_/tests/**/*.pw.ts',
49
- browser: 'chromium',
50
98
  },
51
99
  k6: {
52
100
  testMatch: '_supercheck_/tests/**/*.k6.ts',
53
101
  },
54
102
  },
103
+ monitors: [
104
+ {
105
+ name: 'API Health',
106
+ type: 'http_request',
107
+ target: 'https://api.example.com/health',
108
+ frequencyMinutes: 5,
109
+ }
110
+ ]
55
111
  })
56
112
  ```
57
113
 
58
- ## File Conventions
114
+ ## CI/CD Integration
59
115
 
60
- ```
61
- _supercheck_/
62
- ├── tests/
63
- │ ├── homepage.pw.ts # Playwright test
64
- │ └── load-test.k6.ts # k6 test
65
- ├── monitors/
66
- │ └── api-monitor.ts # Monitor definition
67
- └── status-pages/
68
- └── main-status.ts # Status page definition
116
+ ### GitHub Actions
117
+
118
+ ```yaml
119
+ - name: Run E2E Tests
120
+ run: |
121
+ npx @supercheck/cli job trigger ${{ secrets.SUPERCHECK_JOB_ID }} --wait --json
122
+ env:
123
+ SUPERCHECK_TOKEN: ${{ secrets.SUPERCHECK_TOKEN }}
69
124
  ```
70
125
 
71
- ## Development
126
+ ### GitLab CI
72
127
 
73
- ```bash
74
- npm install
75
- npm run dev # Watch mode
76
- npm run build # Production build
77
- npm run typecheck # Type checking
78
- npm run supercheck # Run CLI in dev mode
128
+ ```yaml
129
+ test:
130
+ image: node:18
131
+ script:
132
+ - npm install -g @supercheck/cli
133
+ - supercheck job trigger $SUPERCHECK_JOB_ID --wait
134
+ variables:
135
+ SUPERCHECK_TOKEN: $SUPERCHECK_TOKEN
79
136
  ```
137
+
@@ -210,7 +210,7 @@ function requireTriggerKey() {
210
210
  }
211
211
 
212
212
  // src/version.ts
213
- var CLI_VERSION = true ? "0.1.0-beta.2" : "0.0.0-dev";
213
+ var CLI_VERSION = true ? "0.1.0-beta.3" : "0.0.0-dev";
214
214
 
215
215
  // src/api/client.ts
216
216
  import { ProxyAgent } from "undici";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supercheck/cli",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-beta.3",
4
4
  "description": "Open-Source Testing, Monitoring, and Reliability — as Code",
5
5
  "keywords": [
6
6
  "monitoring",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "author": "Supercheck <hello@supercheck.io>",
24
24
  "type": "module",
25
- "license": "SEE LICENSE IN LICENSE",
25
+ "license": "Supercheck Community License",
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },