@testsprite/testsprite-cli 0.1.2 → 0.3.0
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 +34 -26
- package/dist/commands/agent.d.ts +52 -0
- package/dist/commands/agent.js +341 -93
- package/dist/commands/auth.js +29 -27
- package/dist/commands/doctor.d.ts +49 -0
- package/dist/commands/doctor.js +211 -0
- package/dist/commands/init.d.ts +7 -1
- package/dist/commands/init.js +66 -26
- package/dist/commands/project.d.ts +50 -1
- package/dist/commands/project.js +257 -43
- package/dist/commands/test.d.ts +214 -12
- package/dist/commands/test.js +1310 -174
- package/dist/commands/usage.js +13 -12
- package/dist/index.js +71 -18
- package/dist/lib/agent-targets.d.ts +169 -22
- package/dist/lib/agent-targets.js +335 -34
- package/dist/lib/bundle.d.ts +51 -1
- package/dist/lib/bundle.js +146 -55
- package/dist/lib/client-factory.d.ts +43 -0
- package/dist/lib/client-factory.js +89 -2
- package/dist/lib/config.d.ts +2 -0
- package/dist/lib/config.js +11 -2
- package/dist/lib/credentials.d.ts +7 -0
- package/dist/lib/credentials.js +40 -1
- package/dist/lib/dry-run/samples.d.ts +5 -0
- package/dist/lib/dry-run/samples.js +54 -9
- package/dist/lib/flaky.d.ts +80 -0
- package/dist/lib/flaky.js +76 -0
- package/dist/lib/http.d.ts +20 -0
- package/dist/lib/http.js +216 -132
- package/dist/lib/interrupt.d.ts +61 -0
- package/dist/lib/interrupt.js +97 -0
- package/dist/lib/junit-report.d.ts +58 -0
- package/dist/lib/junit-report.js +210 -0
- package/dist/lib/output.d.ts +16 -1
- package/dist/lib/output.js +24 -2
- package/dist/lib/pagination.d.ts +4 -3
- package/dist/lib/pagination.js +34 -6
- package/dist/lib/prompt.js +52 -8
- package/dist/lib/proxy.d.ts +29 -0
- package/dist/lib/proxy.js +30 -0
- package/dist/lib/render-error.d.ts +13 -0
- package/dist/lib/render-error.js +30 -7
- package/dist/lib/skill-nudge.d.ts +2 -2
- package/dist/lib/skill-nudge.js +13 -4
- package/dist/lib/target-url.js +8 -1
- package/dist/lib/ticker.d.ts +11 -1
- package/dist/lib/ticker.js +33 -1
- package/dist/lib/update-check.d.ts +67 -0
- package/dist/lib/update-check.js +246 -0
- package/dist/version-guard.d.ts +33 -0
- package/dist/version-guard.js +39 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/skills/testsprite-onboard.skill.md +183 -0
- package/skills/testsprite-verify.codex.md +2 -0
- package/skills/testsprite-verify.skill.md +52 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ AI ships code in minutes — verifying it hasn't. `testsprite` opens your live a
|
|
|
17
17
|
<p>
|
|
18
18
|
<a href="https://www.npmjs.com/package/@testsprite/testsprite-cli"><img src="https://img.shields.io/npm/v/@testsprite/testsprite-cli?color=19C379&label=npm" alt="npm version"></a>
|
|
19
19
|
<a href="https://www.npmjs.com/package/@testsprite/testsprite-cli"><img src="https://img.shields.io/npm/dm/@testsprite/testsprite-cli?color=19C379&label=downloads" alt="npm downloads"></a>
|
|
20
|
-
<a href="#quickstart"><img src="https://img.shields.io/badge/node
|
|
20
|
+
<a href="#quickstart"><img src="https://img.shields.io/badge/node-20.19%2B%20%7C%2022.13%2B%20%7C%2024%2B-19C379" alt="Node 20.19+, 22.13+, or 24+"></a>
|
|
21
21
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-0A0A0A" alt="License Apache 2.0"></a>
|
|
22
22
|
<a href="https://github.com/TestSprite/testsprite-cli/actions/workflows/ci.yml"><img src="https://github.com/TestSprite/testsprite-cli/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
23
23
|
</p>
|
|
@@ -54,14 +54,14 @@ If you find `testsprite` useful, a GitHub Star ⭐️ would be greatly appreciat
|
|
|
54
54
|
|
|
55
55
|
## Quickstart
|
|
56
56
|
|
|
57
|
-
Requires **Node.js
|
|
57
|
+
Requires **Node.js 20.19+**, **22.13+**, or **24+**. (No global install? `npx @testsprite/testsprite-cli` works too.)
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
npm install -g @testsprite/testsprite-cli
|
|
61
61
|
testsprite setup
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
`testsprite setup` prompts for your [API key](https://www.testsprite.com), verifies it, and installs the verification-loop skill for your coding agent (`claude`, `cursor`, `cline`, `antigravity`, `codex`, etc.) — one command, so your agent is wired to verify its own work. Non-interactive (CI / onboarding scripts):
|
|
64
|
+
`testsprite setup` prompts for your [API key](https://www.testsprite.com), verifies it, and installs the verification-loop skill for your coding agent (`claude`, `cursor`, `cline`, `windsurf`, `antigravity`, `codex`, etc.) — one command, so your agent is wired to verify its own work. Non-interactive (CI / onboarding scripts):
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
TESTSPRITE_API_KEY=sk-... testsprite setup --from-env --yes --agent claude
|
|
@@ -69,6 +69,8 @@ TESTSPRITE_API_KEY=sk-... testsprite setup --from-env --yes --agent claude
|
|
|
69
69
|
|
|
70
70
|
> **Pointing a coding agent (Claude Code, Cursor, Codex, Cline, …) at TestSprite?** Have it run `testsprite setup` first — that installs the verification skill, so the agent knows how to create, run, and triage tests on its own (instead of guessing from this README). New here? Start with the **[getting-started overview](https://docs.testsprite.com/cli/getting-started/overview)**.
|
|
71
71
|
|
|
72
|
+
> **Privacy note:** interactive runs check the npm registry at most once per 24 h to offer a "new version available" notice — package name only, never your key or data; `TESTSPRITE_NO_UPDATE_NOTIFIER=1` disables it. Details in [DOCUMENTATION.md → Update notice](./DOCUMENTATION.md#update-notice).
|
|
73
|
+
|
|
72
74
|
From there, the loop runs on its own — an example session, typed by the coding agent:
|
|
73
75
|
|
|
74
76
|
```bash
|
|
@@ -89,28 +91,34 @@ Prefer to configure each step by hand (or learn the surface offline with `--dry-
|
|
|
89
91
|
|
|
90
92
|
## Commands
|
|
91
93
|
|
|
92
|
-
| Group | Command | What it does
|
|
93
|
-
| --------- | --------------------------------------------------- |
|
|
94
|
-
| **Setup** | `setup` | **Start here** — one command: configure your API key, verify it, and install the agent verification skill
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
| | `
|
|
99
|
-
|
|
|
100
|
-
| | `test
|
|
101
|
-
| | `test
|
|
102
|
-
| | `test
|
|
103
|
-
| | `test
|
|
104
|
-
|
|
|
105
|
-
| | `test
|
|
106
|
-
| | `test
|
|
107
|
-
|
|
|
108
|
-
| | `
|
|
109
|
-
|
|
|
110
|
-
| | `test
|
|
111
|
-
| | `test
|
|
112
|
-
| | `
|
|
113
|
-
|
|
|
94
|
+
| Group | Command | What it does |
|
|
95
|
+
| --------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| **Setup** | `setup` | **Start here** — one command: configure your API key, verify it, and install the agent verification skill |
|
|
97
|
+
| | `doctor` | Environment diagnostic — CLI/Node versions, profile, endpoint, credentials, connectivity, agent skill; exits non-zero on failure |
|
|
98
|
+
| **Auth** | `auth status` | Resolve the active profile to its user, key, env, and scopes |
|
|
99
|
+
| | `auth remove` | Remove the active profile from the credentials file |
|
|
100
|
+
| | `usage` (alias `credits`) | Account pre-flight: identity, plus credit balance / plan info when the backend supplies them |
|
|
101
|
+
| **Read** | `project list` / `project get` | List projects / fetch one by id |
|
|
102
|
+
| | `test list` / `test get` | List tests under a project / fetch one by id |
|
|
103
|
+
| | `test code get` | Print (or write) the generated test source |
|
|
104
|
+
| | `test steps` | List the latest run's steps with screenshot / DOM pointers |
|
|
105
|
+
| | `test result` | Latest result; `--history` lists a test's prior runs |
|
|
106
|
+
| | `test failure get` | The agent entry point: one self-contained latest-failure bundle |
|
|
107
|
+
| | `test failure summary` | One-screen triage card (no media download) |
|
|
108
|
+
| | `test diff` | Compare two runs — verdict, failure kind, per-step status flips, code-version drift |
|
|
109
|
+
| **Write** | `test scaffold` / `test lint` | Author plans locally: emit a schema-correct starter, validate plan files offline — no network, no credentials |
|
|
110
|
+
| | `test create` / `test create-batch` | Create a test (or bulk-create from a plan file); `--produces` / `--needs` / `--category` wire BE dependency metadata |
|
|
111
|
+
| | `test update` / `test delete` / `test delete-batch` | Edit metadata / permanently delete (no restore window; `--confirm` required) |
|
|
112
|
+
| | `test code put` | Replace generated code (etag-guarded) |
|
|
113
|
+
| | `test plan put` | Replace a frontend test's plan-steps |
|
|
114
|
+
| | `project create` / `project update` | Manage projects |
|
|
115
|
+
| | `project credential` / `project auto-auth` | Configure backend-test auth: a static injected credential, or auto-refresh login (Pro) |
|
|
116
|
+
| **Run** | `test run` | Trigger a fresh run; `--wait` blocks until terminal; `--all --project <id>` runs all tests in a project in wave order |
|
|
117
|
+
| | `test rerun` | Cheap replay of one/many tests (FE verbatim; BE with deps); `--all --project <id>` reruns all tests |
|
|
118
|
+
| | `test flaky` | Replay a test several times (auto-heal off) and report a stability score |
|
|
119
|
+
| | `test wait` | Block on one or more `runId`s until terminal |
|
|
120
|
+
| | `test artifact get` | Download the failure bundle for a specific `runId` |
|
|
121
|
+
| **Agent** | `agent install` / `agent list` / `agent status` | Add, list, or health-check coding-agent skills (pure-local): `claude`, `codex`, `cursor`, `cline`, `antigravity`, `kiro`, `windsurf`, `copilot` |
|
|
114
122
|
|
|
115
123
|
> The earlier command names — `init`, `auth configure`, `auth whoami`, `auth logout` — still work as hidden, deprecated aliases (each prints a one-line notice pointing at the new name), so existing scripts keep running. `auth configure` now runs the full `setup` (it also installs the skill).
|
|
116
124
|
|
|
@@ -173,7 +181,7 @@ That's the point of all of this: you no longer need the biggest, most expensive
|
|
|
173
181
|
|
|
174
182
|
## Contributing
|
|
175
183
|
|
|
176
|
-
Contributions are welcome — the CLI is plain TypeScript/Node (
|
|
184
|
+
Contributions are welcome — the CLI is plain TypeScript/Node (20.19+, 22.13+, or 24+), tested with Vitest, built with `tsc`. Getting a dev loop running takes a minute:
|
|
177
185
|
|
|
178
186
|
```bash
|
|
179
187
|
git clone https://github.com/TestSprite/testsprite-cli.git
|
package/dist/commands/agent.d.ts
CHANGED
|
@@ -32,20 +32,72 @@ export interface InstallResult {
|
|
|
32
32
|
target: AgentTarget;
|
|
33
33
|
path: string;
|
|
34
34
|
action: InstallAction;
|
|
35
|
+
/**
|
|
36
|
+
* Skill(s) this result covers. Own-file targets produce one result per skill
|
|
37
|
+
* (`[skill]`); the codex managed-section target produces ONE result whose
|
|
38
|
+
* section aggregates every installed skill (`[...skills]`).
|
|
39
|
+
*/
|
|
40
|
+
skills: string[];
|
|
35
41
|
}
|
|
36
42
|
type CommonOptions = FactoryCommonOptions;
|
|
37
43
|
interface InstallOptions extends CommonOptions {
|
|
38
44
|
target: string[];
|
|
45
|
+
/** Skill subset to install; empty/absent → {@link DEFAULT_SKILLS}. */
|
|
46
|
+
skills?: string[];
|
|
39
47
|
dir?: string;
|
|
40
48
|
force: boolean;
|
|
41
49
|
}
|
|
42
50
|
export declare function runInstall(opts: InstallOptions, deps?: AgentDeps): Promise<void>;
|
|
43
51
|
export interface ListResult {
|
|
44
52
|
target: AgentTarget;
|
|
53
|
+
skill: string;
|
|
45
54
|
status: string;
|
|
46
55
|
mode: string;
|
|
47
56
|
path: string;
|
|
48
57
|
}
|
|
49
58
|
export declare function runList(opts: CommonOptions, deps?: AgentDeps): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Health of one installed skill artifact, as reported by `agent status`.
|
|
61
|
+
*
|
|
62
|
+
* Decision order (first match wins):
|
|
63
|
+
* - 'absent' : nothing at the landing path (codex: no managed section,
|
|
64
|
+
* including an AGENTS.md that exists without our sentinels).
|
|
65
|
+
* - 'corrupt' : codex only. Dangling or duplicated sentinels, the same
|
|
66
|
+
* classification `agent install` refuses on; status REPORTS it
|
|
67
|
+
* instead of refusing.
|
|
68
|
+
* - 'unmarked' : artifact present but carries no testsprite-skill marker
|
|
69
|
+
* (installed before markers existed), or the landing path is
|
|
70
|
+
* occupied by a non-regular file (never followed).
|
|
71
|
+
* - 'stale' : marker present, but its hash differs from the current
|
|
72
|
+
* canonical body: a re-install would change the content. Edits
|
|
73
|
+
* on top of an OLD install also read stale (older renders
|
|
74
|
+
* cannot be reproduced); the remedy is the same re-install.
|
|
75
|
+
* - 'modified' : marker hash matches the current body, but the artifact bytes
|
|
76
|
+
* differ from the canonical render carrying that same marker
|
|
77
|
+
* line: the user edited the artifact after install.
|
|
78
|
+
* - 'ok' : marker hash matches and the bytes equal the canonical render
|
|
79
|
+
* with the file's own marker line (a version-string-only lag
|
|
80
|
+
* with an unchanged body still reads ok).
|
|
81
|
+
*
|
|
82
|
+
* For the codex managed section, ONE marker names every aggregated skill
|
|
83
|
+
* ('+'-joined); skills not named by the marker report 'absent'.
|
|
84
|
+
*/
|
|
85
|
+
export type SkillArtifactState = 'ok' | 'stale' | 'modified' | 'unmarked' | 'absent' | 'corrupt';
|
|
86
|
+
export interface StatusResult {
|
|
87
|
+
target: AgentTarget;
|
|
88
|
+
skill: string;
|
|
89
|
+
path: string;
|
|
90
|
+
state: SkillArtifactState;
|
|
91
|
+
}
|
|
92
|
+
interface StatusOptions extends CommonOptions {
|
|
93
|
+
dir?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* `agent status`: one row per (target × default skill), each classified per
|
|
97
|
+
* the {@link SkillArtifactState} contract. Exit contract: returns normally
|
|
98
|
+
* (exit 0) when every row is 'ok' or 'absent'; throws CLIError exit 1 when any
|
|
99
|
+
* row is stale/modified/unmarked/corrupt, so the command can gate CI.
|
|
100
|
+
*/
|
|
101
|
+
export declare function runStatus(opts: StatusOptions, deps?: AgentDeps): Promise<void>;
|
|
50
102
|
export declare function createAgentCommand(deps?: AgentDeps): Command;
|
|
51
103
|
export {};
|