@bctrl/cli 0.1.7 → 0.1.8
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 +49 -45
- package/dist/bin/bctrl.js +0 -0
- package/package.json +14 -12
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BCTRL CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line tools for BCTRL cloud browser automation. Use it to create browser runtimes, start live sessions, submit hosted invocations, inspect runs and files, and manage account resources from a terminal or script.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -8,66 +8,56 @@ CLI for controlling BCTRL runtimes, files, runs, vault secrets, tools, and accou
|
|
|
8
8
|
npm install -g @bctrl/cli
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Requires Node.js 22.14 or newer.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Authenticate
|
|
14
14
|
|
|
15
|
-
For
|
|
15
|
+
For an interactive terminal, start the browser approval flow and wait for completion:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
bctrl auth login --url --wait
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
For agents
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
bctrl auth login --url
|
|
25
|
-
# approve the printed URL
|
|
26
|
-
bctrl auth login
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Use an API key for CI or a single shell:
|
|
21
|
+
For CI, agents, or one-off shells, use an API key:
|
|
30
22
|
|
|
31
23
|
```bash
|
|
32
24
|
export BCTRL_API_KEY="bctrl_..."
|
|
25
|
+
bctrl auth status
|
|
33
26
|
```
|
|
34
27
|
|
|
35
|
-
`BCTRL_API_KEY` takes precedence over stored
|
|
28
|
+
`BCTRL_API_KEY` takes precedence over credentials stored by `bctrl auth login`.
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
## Quick Start
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
bctrl auth status
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Point contributors at a local or staging stack with `BCTRL_API_URL`:
|
|
32
|
+
Create a browser runtime, start it, run an extraction task, then stop it:
|
|
44
33
|
|
|
45
34
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
bctrl runtime create --name research-browser --json
|
|
36
|
+
bctrl runtime start <runtime-id> --json
|
|
48
37
|
|
|
49
|
-
|
|
38
|
+
bctrl runtime invocation create <runtime-id> \
|
|
39
|
+
--action extract \
|
|
40
|
+
--instruction "Extract the page title." \
|
|
41
|
+
--json
|
|
50
42
|
|
|
51
|
-
|
|
52
|
-
bctrl
|
|
53
|
-
bctrl runtime create --space sp_123 --name checkout-test
|
|
54
|
-
bctrl runtime start rt_123
|
|
55
|
-
bctrl runtime stop rt_123
|
|
43
|
+
bctrl runtime invocation wait <runtime-id> <invocation-id> --json
|
|
44
|
+
bctrl runtime stop <runtime-id>
|
|
56
45
|
```
|
|
57
46
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Use `--input` for full request bodies:
|
|
47
|
+
For full request bodies, pass JSON with `--body`. Inline JSON, `@file`, and `-` for stdin are supported:
|
|
61
48
|
|
|
62
49
|
```bash
|
|
63
|
-
bctrl runtime create
|
|
50
|
+
bctrl runtime invocation create <runtime-id> \
|
|
51
|
+
--body '{"action":"observe","instruction":"Summarize the current page."}' \
|
|
52
|
+
--json
|
|
53
|
+
|
|
54
|
+
cat invocation.json | bctrl runtime invocation create <runtime-id> --body - --json
|
|
64
55
|
```
|
|
65
56
|
|
|
66
|
-
Use
|
|
57
|
+
Use `--params` for path and query overrides when you need the exact API surface:
|
|
67
58
|
|
|
68
59
|
```bash
|
|
69
|
-
|
|
70
|
-
| bctrl runtime create --input -
|
|
60
|
+
bctrl run list --params '{"limit":25}' --json
|
|
71
61
|
```
|
|
72
62
|
|
|
73
63
|
## Output
|
|
@@ -75,35 +65,49 @@ echo '{"type":"browser","spaceId":"sp_123","name":"agent-runtime"}' \
|
|
|
75
65
|
Print full JSON:
|
|
76
66
|
|
|
77
67
|
```bash
|
|
78
|
-
bctrl runtime list --
|
|
68
|
+
bctrl runtime list --json
|
|
79
69
|
```
|
|
80
70
|
|
|
81
|
-
Print selected
|
|
71
|
+
Print selected fields:
|
|
82
72
|
|
|
83
73
|
```bash
|
|
84
|
-
bctrl runtime list --
|
|
74
|
+
bctrl runtime list --json id,status,name
|
|
85
75
|
```
|
|
86
76
|
|
|
87
|
-
Filter with
|
|
77
|
+
Filter with jq syntax:
|
|
88
78
|
|
|
89
79
|
```bash
|
|
90
|
-
bctrl runtime list --
|
|
80
|
+
bctrl runtime list --json --jq '.data[] | select(.status == "active")'
|
|
91
81
|
```
|
|
92
82
|
|
|
93
83
|
Render with a template:
|
|
94
84
|
|
|
95
85
|
```bash
|
|
96
86
|
bctrl runtime list \
|
|
97
|
-
--space sp_123 \
|
|
98
87
|
--json \
|
|
99
88
|
--template '{{#each data}}{{id}} {{status}}{{newline}}{{/each}}'
|
|
100
89
|
```
|
|
101
90
|
|
|
102
|
-
##
|
|
91
|
+
## Common Commands
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
bctrl space list
|
|
95
|
+
bctrl runtime create --name browser-task
|
|
96
|
+
bctrl runtime start <runtime-id>
|
|
97
|
+
bctrl runtime target create <runtime-id> --uri https://example.com --activate
|
|
98
|
+
bctrl runtime invocation create <runtime-id> --action act --instruction "Click the sign in button"
|
|
99
|
+
bctrl run list --json
|
|
100
|
+
bctrl runtime stop <runtime-id>
|
|
101
|
+
```
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
Run any command with `--help` for the exact arguments and flags:
|
|
105
104
|
|
|
106
105
|
```bash
|
|
107
|
-
bctrl runtime create --help
|
|
108
|
-
bctrl runtime start --help
|
|
106
|
+
bctrl runtime invocation create --help
|
|
109
107
|
```
|
|
108
|
+
|
|
109
|
+
## Documentation
|
|
110
|
+
|
|
111
|
+
- CLI guide: https://platform.bctrl.ai/cli
|
|
112
|
+
- Command reference: https://platform.bctrl.ai/cli/reference
|
|
113
|
+
- API reference: https://platform.bctrl.ai/api-reference
|
package/dist/bin/bctrl.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bctrl/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "BCTRL command-line interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -19,6 +19,17 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
24
|
+
"build": "pnpm run clean && tsc -p tsconfig.json",
|
|
25
|
+
"generate:cli-reference": "tsx scripts/generate-cli-reference.ts",
|
|
26
|
+
"check:cli-reference": "tsx scripts/generate-cli-reference.ts --check",
|
|
27
|
+
"dev": "tsx src/bin/bctrl.ts",
|
|
28
|
+
"prepack": "pnpm run build",
|
|
29
|
+
"test": "tsx --test \"tests/**/*.test.ts\"",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"typecheck:tests": "tsc --noEmit -p tests/tsconfig.json"
|
|
32
|
+
},
|
|
22
33
|
"keywords": [
|
|
23
34
|
"bctrl",
|
|
24
35
|
"cli",
|
|
@@ -27,6 +38,7 @@
|
|
|
27
38
|
],
|
|
28
39
|
"author": "",
|
|
29
40
|
"license": "ISC",
|
|
41
|
+
"packageManager": "pnpm@10.12.4",
|
|
30
42
|
"engines": {
|
|
31
43
|
"node": ">=22.14.0"
|
|
32
44
|
},
|
|
@@ -42,15 +54,5 @@
|
|
|
42
54
|
"@types/node": "^25.7.0",
|
|
43
55
|
"tsx": "^4.21.0",
|
|
44
56
|
"typescript": "^6.0.3"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
48
|
-
"build": "pnpm run clean && tsc -p tsconfig.json",
|
|
49
|
-
"generate:cli-reference": "tsx scripts/generate-cli-reference.ts",
|
|
50
|
-
"check:cli-reference": "tsx scripts/generate-cli-reference.ts --check",
|
|
51
|
-
"dev": "tsx src/bin/bctrl.ts",
|
|
52
|
-
"test": "tsx --test \"tests/**/*.test.ts\"",
|
|
53
|
-
"typecheck": "tsc --noEmit",
|
|
54
|
-
"typecheck:tests": "tsc --noEmit -p tests/tsconfig.json"
|
|
55
57
|
}
|
|
56
|
-
}
|
|
58
|
+
}
|