@cliwatch/cli-bench 0.6.3 → 0.7.1

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +3 -0
  3. package/dist/assertions.d.ts +1 -1
  4. package/dist/assertions.d.ts.map +1 -1
  5. package/dist/assertions.js +6 -6
  6. package/dist/assertions.js.map +1 -1
  7. package/dist/ci.d.ts.map +1 -1
  8. package/dist/ci.js +14 -0
  9. package/dist/ci.js.map +1 -1
  10. package/dist/client/index.d.ts +1 -1
  11. package/dist/client/index.d.ts.map +1 -1
  12. package/dist/client/types.gen.d.ts +143 -93
  13. package/dist/client/types.gen.d.ts.map +1 -1
  14. package/dist/client/zod.gen.d.ts +75 -42
  15. package/dist/client/zod.gen.d.ts.map +1 -1
  16. package/dist/client/zod.gen.js +86 -54
  17. package/dist/client/zod.gen.js.map +1 -1
  18. package/dist/config.d.ts +2 -3
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/config.js +8 -15
  21. package/dist/config.js.map +1 -1
  22. package/dist/exec.d.ts +2 -0
  23. package/dist/exec.d.ts.map +1 -1
  24. package/dist/exec.js +6 -2
  25. package/dist/exec.js.map +1 -1
  26. package/dist/github-comment.d.ts +16 -0
  27. package/dist/github-comment.d.ts.map +1 -0
  28. package/dist/github-comment.js +90 -0
  29. package/dist/github-comment.js.map +1 -0
  30. package/dist/index.d.ts +2 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +31 -36
  33. package/dist/index.js.map +1 -1
  34. package/dist/init.js +1 -1
  35. package/dist/models.d.ts +9 -9
  36. package/dist/models.d.ts.map +1 -1
  37. package/dist/models.js +1 -1
  38. package/dist/models.js.map +1 -1
  39. package/dist/project.d.ts +11 -2
  40. package/dist/project.d.ts.map +1 -1
  41. package/dist/project.js +108 -9
  42. package/dist/project.js.map +1 -1
  43. package/dist/prompt.d.ts +2 -8
  44. package/dist/prompt.d.ts.map +1 -1
  45. package/dist/prompt.js +2 -35
  46. package/dist/prompt.js.map +1 -1
  47. package/dist/providers.d.ts +9 -7
  48. package/dist/providers.d.ts.map +1 -1
  49. package/dist/providers.js +26 -8
  50. package/dist/providers.js.map +1 -1
  51. package/dist/runner.d.ts +32 -4
  52. package/dist/runner.d.ts.map +1 -1
  53. package/dist/runner.js +177 -177
  54. package/dist/runner.js.map +1 -1
  55. package/dist/schemas.d.ts +20 -1
  56. package/dist/schemas.d.ts.map +1 -1
  57. package/dist/schemas.js +8 -1
  58. package/dist/schemas.js.map +1 -1
  59. package/dist/suite-generator.d.ts.map +1 -1
  60. package/dist/suite-generator.js +93 -10
  61. package/dist/suite-generator.js.map +1 -1
  62. package/package.json +2 -2
  63. package/dist/help-loader.d.ts +0 -17
  64. package/dist/help-loader.d.ts.map +0 -1
  65. package/dist/help-loader.js +0 -65
  66. package/dist/help-loader.js.map +0 -1
  67. package/task_suites/curl.yaml +0 -138
  68. package/task_suites/docker.yaml +0 -163
  69. package/task_suites/gh.yaml +0 -118
  70. package/task_suites/jq.yaml +0 -172
  71. package/task_suites/kubectl.yaml +0 -74
@@ -1,118 +0,0 @@
1
- cli: gh
2
-
3
- tasks:
4
- # -- Easy --------------------------------------------------------------------
5
- - id: list-repos
6
- intent: "List all public repositories for the GitHub user 'octocat'"
7
- difficulty: easy
8
- category: query
9
- max_turns: 3
10
- assert:
11
- - ran: "gh repo list.*octocat"
12
- - ran: "--visibility"
13
-
14
- - id: view-issue
15
- intent: "View the details of issue #42 in the repository cli/cli"
16
- difficulty: easy
17
- category: crud
18
- max_turns: 3
19
- assert:
20
- - ran: "gh issue view.*42"
21
- - ran: "--repo.*cli/cli"
22
-
23
- - id: list-prs-json
24
- intent: "List open pull requests in the current repo and output as JSON with fields number, title, and author"
25
- difficulty: easy
26
- category: output
27
- max_turns: 3
28
- assert:
29
- - ran: "gh pr list"
30
- - ran: "--json"
31
-
32
- - id: whoami
33
- intent: "Show which GitHub account you're currently authenticated as"
34
- difficulty: easy
35
- category: auth
36
- max_turns: 3
37
- assert:
38
- - ran: "gh auth status"
39
-
40
- - id: set-config
41
- intent: "Set the default git protocol to SSH for GitHub CLI"
42
- difficulty: easy
43
- category: config
44
- max_turns: 3
45
- assert:
46
- - ran: "gh config set.*git_protocol.*ssh"
47
-
48
- # -- Medium ------------------------------------------------------------------
49
- - id: create-issue-with-labels
50
- intent: "Create a new issue titled 'Login page broken' with labels 'bug' and 'urgent' in the repository myorg/myapp"
51
- difficulty: medium
52
- category: crud
53
- max_turns: 5
54
- assert:
55
- - ran: "gh issue create"
56
- - ran: "--title"
57
- - ran: "--label"
58
- - ran: "--repo.*myorg/myapp"
59
-
60
- - id: create-release
61
- intent: "Create a new release tagged v2.0.0 with title 'Major Release' and auto-generate the release notes"
62
- difficulty: medium
63
- category: crud
64
- max_turns: 5
65
- assert:
66
- - ran: "gh release create.*v2.0.0"
67
- - ran: "--title"
68
- - ran: "--generate-notes"
69
-
70
- - id: search-issues
71
- intent: "Search for open issues labeled 'good first issue' in the rust-lang/rust repository"
72
- difficulty: medium
73
- category: query
74
- max_turns: 5
75
- assert:
76
- - ran: "gh search issues"
77
- - ran: "--repo.*rust-lang/rust"
78
- - ran: "--label"
79
-
80
- - id: pr-diff
81
- intent: "Show the diff for pull request #500 in the current repository"
82
- difficulty: medium
83
- category: query
84
- max_turns: 5
85
- assert:
86
- - ran: "gh pr diff.*500"
87
-
88
- # -- Hard --------------------------------------------------------------------
89
- - id: review-pr-workflow
90
- intent: "Check out pull request #123, then approve it with the comment 'Looks good, tests pass'"
91
- difficulty: hard
92
- category: workflow
93
- max_turns: 7
94
- assert:
95
- - ran: "gh pr checkout.*123"
96
- - ran: "gh pr review.*123.*--approve"
97
-
98
- - id: api-graphql
99
- intent: "Use the GitHub API to fetch the description of the repository cli/cli using a GraphQL query"
100
- difficulty: hard
101
- category: query
102
- max_turns: 7
103
- assert:
104
- - ran: "gh api graphql"
105
- - ran: "repository"
106
-
107
- - id: create-repo-full
108
- intent: "Create a new private repository called 'my-project' with a README, a .gitignore for Python, and the MIT license"
109
- difficulty: hard
110
- category: crud
111
- max_turns: 7
112
- assert:
113
- - ran: "gh repo create.*my-project"
114
- - ran: "--private"
115
- - ran: "--add-readme"
116
- - ran: "--gitignore"
117
- - ran: "--license"
118
- - not_ran: "--public"
@@ -1,172 +0,0 @@
1
- cli: jq
2
- version_command: "jq --version"
3
-
4
- tasks:
5
- # -- Easy --------------------------------------------------------------------
6
- - id: pretty-print
7
- intent: "Pretty-print the JSON file /tmp/bench-workspace/data.json"
8
- difficulty: easy
9
- category: query
10
- setup:
11
- - "mkdir -p /tmp/bench-workspace"
12
- - "echo '{\"name\":\"alice\",\"age\":30,\"active\":true}' > /tmp/bench-workspace/data.json"
13
- max_turns: 2
14
- assert:
15
- - ran: "jq.*data.json"
16
- - exit_code: 0
17
- - output_contains: "alice"
18
-
19
- - id: extract-field
20
- intent: "Extract the 'name' field from /tmp/bench-workspace/data.json"
21
- difficulty: easy
22
- category: query
23
- setup:
24
- - "mkdir -p /tmp/bench-workspace"
25
- - "echo '{\"name\":\"alice\",\"age\":30}' > /tmp/bench-workspace/data.json"
26
- max_turns: 3
27
- assert:
28
- - ran: "jq.*\\.name.*data.json"
29
- - output_contains: "alice"
30
-
31
- - id: raw-output
32
- intent: "Extract the 'name' field from /tmp/bench-workspace/data.json as a raw string without quotes"
33
- difficulty: easy
34
- category: output
35
- setup:
36
- - "mkdir -p /tmp/bench-workspace"
37
- - "echo '{\"name\":\"alice\"}' > /tmp/bench-workspace/data.json"
38
- max_turns: 3
39
- assert:
40
- - ran: "jq.*-r|--raw-output"
41
- - ran: "\\.name"
42
-
43
- - id: array-length
44
- intent: "Count the number of items in the JSON array in /tmp/bench-workspace/list.json"
45
- difficulty: easy
46
- category: query
47
- setup:
48
- - "mkdir -p /tmp/bench-workspace"
49
- - "echo '[1,2,3,4,5]' > /tmp/bench-workspace/list.json"
50
- max_turns: 3
51
- assert:
52
- - ran: "jq.*length.*list.json"
53
- - output_contains: "5"
54
-
55
- # -- Medium ------------------------------------------------------------------
56
- - id: filter-array
57
- intent: "From /tmp/bench-workspace/users.json, select only users where age is greater than 25"
58
- difficulty: medium
59
- category: query
60
- setup:
61
- - "mkdir -p /tmp/bench-workspace"
62
- - "echo '[{\"name\":\"alice\",\"age\":30},{\"name\":\"bob\",\"age\":20},{\"name\":\"carol\",\"age\":35}]' > /tmp/bench-workspace/users.json"
63
- max_turns: 5
64
- assert:
65
- - ran: "jq.*select.*age.*25.*users.json"
66
- - output_contains: "alice"
67
- - output_contains: "carol"
68
-
69
- - id: map-transform
70
- intent: "From /tmp/bench-workspace/users.json, extract just the names of all users as a JSON array"
71
- difficulty: medium
72
- category: output
73
- setup:
74
- - "mkdir -p /tmp/bench-workspace"
75
- - "echo '[{\"name\":\"alice\",\"age\":30},{\"name\":\"bob\",\"age\":20}]' > /tmp/bench-workspace/users.json"
76
- max_turns: 5
77
- assert:
78
- - ran: "jq.*\\.name.*users.json|jq.*map.*users.json"
79
- - output_contains: "alice"
80
- - output_contains: "bob"
81
-
82
- - id: nested-access
83
- intent: "From /tmp/bench-workspace/config.json, extract the host field from inside the database object"
84
- difficulty: medium
85
- category: query
86
- setup:
87
- - "mkdir -p /tmp/bench-workspace"
88
- - "echo '{\"database\":{\"host\":\"localhost\",\"port\":5432},\"cache\":{\"host\":\"redis\"}}' > /tmp/bench-workspace/config.json"
89
- max_turns: 5
90
- assert:
91
- - ran: "jq.*\\.database\\.host.*config.json"
92
- - output_contains: "localhost"
93
-
94
- # -- Hard --------------------------------------------------------------------
95
- - id: group-and-count
96
- intent: "From /tmp/bench-workspace/events.json, group the events by their 'type' field and count how many of each type there are"
97
- difficulty: hard
98
- category: query
99
- setup:
100
- - "mkdir -p /tmp/bench-workspace"
101
- - "echo '[{\"type\":\"click\",\"page\":\"/home\"},{\"type\":\"view\",\"page\":\"/about\"},{\"type\":\"click\",\"page\":\"/pricing\"},{\"type\":\"view\",\"page\":\"/home\"},{\"type\":\"click\",\"page\":\"/home\"}]' > /tmp/bench-workspace/events.json"
102
- max_turns: 7
103
- assert:
104
- - ran: "jq.*group_by.*events.json"
105
- - output_contains: "click"
106
- - output_contains: "view"
107
-
108
- - id: merge-objects
109
- intent: "Merge /tmp/bench-workspace/defaults.json and /tmp/bench-workspace/overrides.json, where overrides take precedence"
110
- difficulty: hard
111
- category: crud
112
- setup:
113
- - "mkdir -p /tmp/bench-workspace"
114
- - "echo '{\"color\":\"red\",\"size\":10,\"debug\":false}' > /tmp/bench-workspace/defaults.json"
115
- - "echo '{\"color\":\"blue\",\"verbose\":true}' > /tmp/bench-workspace/overrides.json"
116
- max_turns: 7
117
- assert:
118
- - ran: "jq"
119
- - output_contains: "blue"
120
- - output_contains: "verbose"
121
-
122
- - id: csv-output
123
- intent: "Convert /tmp/bench-workspace/users.json into CSV format with columns name and age"
124
- difficulty: hard
125
- category: output
126
- setup:
127
- - "mkdir -p /tmp/bench-workspace"
128
- - "echo '[{\"name\":\"alice\",\"age\":30},{\"name\":\"bob\",\"age\":20}]' > /tmp/bench-workspace/users.json"
129
- max_turns: 7
130
- assert:
131
- - ran: "jq.*-r|--raw-output"
132
- - ran: "@csv|@tsv|join"
133
- - output_contains: "alice"
134
- - output_contains: "bob"
135
-
136
- - id: recursive-descent
137
- intent: "From /tmp/bench-workspace/deep.json, find ALL values of any key named 'id' anywhere in the nested structure, no matter how deep"
138
- difficulty: hard
139
- category: query
140
- setup:
141
- - "mkdir -p /tmp/bench-workspace"
142
- - "echo '{\"id\":1,\"children\":[{\"id\":2,\"meta\":{\"id\":3}},{\"id\":4}]}' > /tmp/bench-workspace/deep.json"
143
- max_turns: 7
144
- assert:
145
- - ran: "jq.*\\.\\..*id|jq.*recurse.*id"
146
- - output_contains: "1"
147
- - output_contains: "3"
148
-
149
- - id: conditional-update
150
- intent: "In /tmp/bench-workspace/items.json, update the price to 0 for all items where the stock is 0, and output the modified JSON"
151
- difficulty: hard
152
- category: crud
153
- setup:
154
- - "mkdir -p /tmp/bench-workspace"
155
- - "echo '[{\"name\":\"A\",\"price\":10,\"stock\":5},{\"name\":\"B\",\"price\":20,\"stock\":0},{\"name\":\"C\",\"price\":15,\"stock\":0}]' > /tmp/bench-workspace/items.json"
156
- max_turns: 7
157
- assert:
158
- - ran: "jq.*if.*stock.*then|jq.*select.*stock|jq.*map.*stock"
159
- - output_contains: "\"price\":0"
160
-
161
- - id: pivot-table
162
- intent: "From /tmp/bench-workspace/sales.json, create an object where each key is a unique region and each value is the total revenue for that region"
163
- difficulty: hard
164
- category: query
165
- setup:
166
- - "mkdir -p /tmp/bench-workspace"
167
- - "echo '[{\"region\":\"US\",\"revenue\":100},{\"region\":\"EU\",\"revenue\":200},{\"region\":\"US\",\"revenue\":150},{\"region\":\"EU\",\"revenue\":50}]' > /tmp/bench-workspace/sales.json"
168
- max_turns: 7
169
- assert:
170
- - ran: "jq.*group_by.*region"
171
- - output_contains: "US"
172
- - output_contains: "250"
@@ -1,74 +0,0 @@
1
- cli: kubectl
2
- version_command: "kubectl version --client --short 2>/dev/null || kubectl version --client -o yaml | head -5"
3
-
4
- tasks:
5
- - id: get-help
6
- intent: "Show help information for kubectl"
7
- max_turns: 2
8
- assert:
9
- - ran: "kubectl.*--help"
10
- - output_contains: "kubectl"
11
-
12
- - id: create-namespace-dry-run
13
- intent: "Create a namespace called 'test-ns' but only show what would be created, don't actually create it"
14
- assert:
15
- - output_contains: "test-ns"
16
- - ran: "kubectl create"
17
- - ran: "dry-run"
18
-
19
- - id: create-deployment-dry-run
20
- intent: "Create a deployment named 'nginx-app' using the nginx image, show the YAML output without creating it"
21
- assert:
22
- - output_contains: "nginx-app"
23
- - output_contains: "nginx"
24
- - ran: "kubectl create deploy"
25
-
26
- - id: create-configmap-literal
27
- intent: "Create a configmap named 'app-config' with database_url=localhost:5432 and debug=true, just show what it would look like"
28
- assert:
29
- - output_contains: "app-config"
30
- - output_contains: "database_url"
31
- - output_contains: "debug"
32
-
33
- - id: create-job-with-command
34
- intent: "Create a job named 'backup-job' using busybox that runs 'echo backup completed', show the YAML"
35
- assert:
36
- - output_contains: "backup-job"
37
- - output_contains: "busybox"
38
- - ran: "kubectl create job"
39
-
40
- - id: create-cronjob-schedule
41
- intent: "Create a cronjob named 'daily-cleanup' that runs every day at 2 AM using busybox with command 'rm -rf /tmp/*'"
42
- assert:
43
- - output_contains: "daily-cleanup"
44
- - output_contains: "busybox"
45
- - ran: "kubectl create cronjob"
46
-
47
- - id: create-deployment-replicas
48
- intent: "Create a deployment named 'web-app' using nginx image with 3 replicas"
49
- assert:
50
- - output_contains: "web-app"
51
- - output_contains: "replicas"
52
- - ran: "kubectl create deploy"
53
-
54
- - id: create-configmap-from-file
55
- intent: "Create a configmap named 'nginx-config' from the file at /tmp/bench-workspace/nginx.conf"
56
- setup:
57
- - "mkdir -p /tmp/bench-workspace && echo 'server { listen 80; }' > /tmp/bench-workspace/nginx.conf"
58
- assert:
59
- - output_contains: "nginx-config"
60
- - ran: "kubectl create configmap"
61
-
62
- - id: create-clusterrole-permissions
63
- intent: "Create a cluster role named 'pod-reader' that allows get, list, and watch on pods"
64
- assert:
65
- - output_contains: "pod-reader"
66
- - ran: "kubectl create clusterrole"
67
-
68
- - id: create-ingress-complex
69
- intent: "Create an ingress named 'web-ingress' routing foo.com/api to api-service:8080 and foo.com/web to web-service:80"
70
- difficulty: hard
71
- assert:
72
- - output_contains: "web-ingress"
73
- - output_contains: "foo.com"
74
- - ran: "kubectl create ingress"