@auracheck-ai/cli 0.0.0-stage → 0.2.2

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,3 +1,196 @@
1
- # Temporary Holding Version
1
+ # @auracheck-ai/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ One install, two roles:
4
+
5
+ - **You** use `auracheck` from the terminal to log in and bind a repo to an AuraCheck project.
6
+ - **Claude Code (or Cursor / Claude Desktop)** uses `auracheck mcp` behind the scenes to read your source code, author whitebox testcases, run them, and read evidence — all without leaving the repo.
7
+
8
+ Same binary, same sign-in, same project binding. The CLI also installs as `sixseven` (an alias
9
+ for the same command) so anyone already using `@sixseven-ai/cli`, existing docs, or muscle
10
+ memory keeps working unchanged — every example below works with either name.
11
+
12
+ > **Moved from `@sixseven-ai/cli`?** That package is deprecated in favor of this one. Install
13
+ > `@auracheck-ai/cli` instead (`npm i -g @auracheck-ai/cli`); the `sixseven` command still
14
+ > works exactly as before.
15
+
16
+ > **Upgrading from an older install?** AuraCheck moved off `sixseven-space.sprout.co.id` /
17
+ > `sixseven.sprout.co.id` / `sixseven-api.sprout.co.id` (BytePlus, switched off 2026-11-09)
18
+ > to `https://space.auracheck.ai.id`. Updating and running `auracheck`/`auracheck mcp` (or
19
+ > `sixseven`/`sixseven mcp`) rewrites a saved sign-in pointed at one of those hosts to the new
20
+ > one automatically — same account, same token, nothing to re-enter. A committed
21
+ > `.sixseven/config.json` with the old `baseUrl` is corrected in memory for that run with a
22
+ > notice on stderr; update the file by hand to stop seeing it.
23
+
24
+ ## Quick start
25
+
26
+ **1. Install the CLI**
27
+
28
+ ```bash
29
+ npm i -g @auracheck-ai/cli
30
+ ```
31
+
32
+ **2. Sign in with your browser**
33
+
34
+ ```bash
35
+ auracheck login
36
+ ```
37
+
38
+ Your browser opens AuraCheck; sign in the usual way and click **Allow the CLI**. The CLI saves a personal token to `~/.sixseven/credentials` (mode `0600`). It acts as you — same projects, same permissions — doesn't expire, and you can revoke it any time under **Profile → Active devices** or with `auracheck logout`. `auracheck auth status` shows who you are signed in as (it never prints the token).
39
+
40
+ > **CI / headless:** use a project CI token instead — **Integrations → CI/CD Tokens (Project)** → **Generate token**, then `auracheck login --token 67ci_…` (or `auracheck auth --token 67ci_…`, or the `SIXSEVEN_TOKEN` env var). A project CI token only reaches its own project.
41
+
42
+ **3. Run the wizard from your app's repo**
43
+
44
+ ```bash
45
+ cd /path/to/your/app
46
+ auracheck setup
47
+ ```
48
+
49
+ The wizard will ask for:
50
+
51
+ - **AuraCheck platform URL** — `https://space.auracheck.ai.id` (default; just hit Enter). This is the AuraCheck backend itself, **not** the URL of the app you want to test.
52
+ - **Sign-in** — skipped when `auracheck login` already worked; otherwise it opens the browser sign-in.
53
+
54
+ It then binds the repo to a project and (optionally) registers the MCP server with Claude Code.
55
+
56
+ > **Two URLs, one wizard:** the URL of the app you actually want to test (e.g. your staging or production site) is configured later — per testcase or per exploration — from inside AuraCheck, not here.
57
+
58
+ `auracheck setup` is a 3-step wizard that:
59
+
60
+ 1. **Logs you in** — browser sign-in (or `--token` for CI), saved to `~/.sixseven/credentials` (mode `0600`). Skips this step if a valid token is already saved.
61
+ 2. **Binds the repo** — lists your projects, pick one, writes `.sixseven/config.json`. Skips if a binding already exists (asks before re-binding).
62
+ 3. **Registers the MCP server** — if the `claude` CLI is on your PATH, runs `claude mcp add auracheck -- auracheck mcp` for you. Otherwise prints copy-paste JSON for Cursor (`.cursor/mcp.json`) or Claude Desktop.
63
+
64
+ That's it. Open Claude Code and ask *"list auracheck features"* to confirm.
65
+
66
+ > **Workspace dev?** If you haven't installed globally, the wizard auto-detects and uses the absolute path (`node /abs/path/dist/bin.js mcp`) so the MCP registration still works.
67
+
68
+ ## Commands
69
+
70
+ | Command | What |
71
+ |---|---|
72
+ | `auracheck setup` | **Guided wizard — start here.** Login → bind project → register MCP. |
73
+ | `auracheck login` | Sign in through the browser (`--token 67ci_…` for CI, `--no-browser` to print the link) |
74
+ | `auracheck auth status` | Who the CLI/MCP is signed in as, base URL, project (never prints the token) |
75
+ | `auracheck logout` | Revoke this sign-in and forget it locally |
76
+ | `auracheck init` | Just the bind step (writes `.sixseven/config.json`) |
77
+ | `auracheck status` | Show binding + token validity + feature/testcase counts |
78
+ | `auracheck doctor` | Diagnose config, token, backend reachability, project access |
79
+ | `auracheck mcp` | Start MCP server on stdio (spawned by Claude Code; you don't run this directly). Works outside a bound repo too: project tools then take a `projectId` (see `sixseven.list_projects`); `--project <id>` sets a default |
80
+
81
+ Every command above also works as `sixseven <command>` — same binary, same behavior.
82
+
83
+ ### Advanced: manual MCP registration
84
+
85
+ If you skipped the wizard's MCP step:
86
+
87
+ ```bash
88
+ # Claude Code
89
+ claude mcp add auracheck -- auracheck mcp
90
+
91
+ # Cursor — add to .cursor/mcp.json
92
+ {
93
+ "mcpServers": {
94
+ "auracheck": { "command": "auracheck", "args": ["mcp"] }
95
+ }
96
+ }
97
+ ```
98
+
99
+ ## MCP tools exposed
100
+
101
+ **Whitebox (source code)**
102
+
103
+ | Tool | Purpose |
104
+ |---|---|
105
+ | `sixseven.read_code` | Read a text file inside configured `codeRoots` |
106
+ | `sixseven.list_dir` | List a directory inside the repo |
107
+ | `sixseven.search_code` | Substring/regex search across `codeRoots` (≤200 hits) |
108
+
109
+ **Features & testcases**
110
+
111
+ | Tool | Purpose |
112
+ |---|---|
113
+ | `sixseven.list_features` | List features of the bound AuraCheck project |
114
+ | `sixseven.create_feature` | Create a feature (group of testcases) |
115
+ | `sixseven.list_testcases` | List testcases (optionally per platform) |
116
+ | `sixseven.get_testcase` | Fetch a testcase by id |
117
+ | `sixseven.create_testcase` | Push a new testcase to a feature |
118
+ | `sixseven.update_testcase` | Patch an existing testcase |
119
+
120
+ **Runs, execution, and evidence**
121
+
122
+ | Tool | Purpose |
123
+ |---|---|
124
+ | `sixseven.list_runs` | List recent runs for the bound project |
125
+ | `sixseven.create_run` | Create a run for one or more testcases |
126
+ | `sixseven.execute_run` | Trigger execution (fire-and-forget, 202) |
127
+ | `sixseven.get_run` | Get current run state (status, reportUrl, timestamps) |
128
+ | `sixseven.cancel_run` | Cancel an in-flight run |
129
+ | `sixseven.wait_for_run` | Poll until terminal status (or timeout). Returns summary + final run |
130
+ | `sixseven.list_run_testcases` | List testcases attached to a specific run |
131
+ | `sixseven.get_evidence` | Aggregate per-case attempts + step events + failed-step screenshots |
132
+ | `sixseven.get_screenshot` | Download a run screenshot (or any authenticated blob) to a local file so it can actually be looked at |
133
+
134
+ **Schedules (recurring runs)**
135
+
136
+ | Tool | Purpose |
137
+ |---|---|
138
+ | `sixseven.list_schedules` | List the project's recurring run schedules |
139
+ | `sixseven.get_schedule` | Fetch one schedule (cadence, next fire, filters, recipients) |
140
+ | `sixseven.create_schedule` | Create a cron schedule (validated server-side; warns when no configuration gives its runs a base URL) |
141
+ | `sixseven.update_schedule` | Patch a schedule — pause it, retime it, retarget its configuration |
142
+ | `sixseven.delete_schedule` | Delete a schedule (runs it already created are kept) |
143
+ | `sixseven.run_schedule_now` | Fire it now on the clock's own code path; returns `outcome` + the created `runId` |
144
+ | `sixseven.list_schedule_fires` | Occurrence history — why a schedule skipped (`skipped_overlap`, `skipped_misfire`, `skipped_capacity`, `no_cases`) |
145
+ | `sixseven.list_schedule_recipients` | Users eligible for `notifyUserIds`, resolved the way the server resolves them at send time |
146
+
147
+ **Auto-explore (blackbox)**
148
+
149
+ | Tool | Purpose |
150
+ |---|---|
151
+ | `sixseven.start_exploration` | Kick off AuraCheck's BFS crawler on seed URLs (server-side Puppeteer) |
152
+ | `sixseven.get_exploration` | Read the latest exploration snapshot (status + counts) |
153
+
154
+ **Bug filing**
155
+
156
+ | Tool | Purpose |
157
+ |---|---|
158
+ | `sixseven.file_bug` | Open an issue report against the bound project (after auto-fix loop confirms a real defect) |
159
+ | `sixseven.list_bugs` | List issue reports for the project |
160
+ | `sixseven.get_bug` | Fetch a single issue report by id |
161
+
162
+ **Context**
163
+
164
+ | Tool | Purpose |
165
+ |---|---|
166
+ | `sixseven.whoami` | Echo current user + project context |
167
+
168
+ > The MCP tool names keep the `sixseven.*` prefix regardless of which binary name you use —
169
+ > existing Claude Code/Cursor configs, skills, and prompts that reference them don't change.
170
+
171
+ ## Security & telemetry
172
+
173
+ - **No telemetry.** The CLI makes no outbound calls except to the AuraCheck backend you configured in `.sixseven/config.json`. There is no analytics, no crash reporter, no usage ping.
174
+ - **Source code stays local.** The CLI never auto-uploads files. Source content only leaves the machine if the developer (or Claude Code, on the developer's instruction) explicitly bakes it into a testcase payload.
175
+ - **File reads are sandboxed.** Reads are constrained to configured `codeRoots`, paths in `exclude` are refused, and path-traversal attempts (`../`, absolute paths) are rejected.
176
+ - **Stdout in `auracheck mcp` is strict JSON-RPC.** Human-readable logs go to stderr. Set `SIXSEVEN_DEBUG=1` to include stack traces on errors.
177
+ - **Credentials.** Tokens are saved to `~/.sixseven/credentials` with mode `0600`. The directory is created with mode `0700`. Tokens are never logged.
178
+
179
+ ## Walk-through
180
+
181
+ See [`USAGE.md`](./USAGE.md) for end-to-end prompt examples that drive Claude Code through generate → run → evidence → auto-fix → file-bug loops.
182
+
183
+ ## Config shape
184
+
185
+ `.sixseven/config.json`:
186
+
187
+ ```json
188
+ {
189
+ "baseUrl": "https://space.auracheck.ai.id",
190
+ "projectId": "uuid-of-project",
191
+ "defaultFeatureId": null,
192
+ "codeRoots": ["src", "apps"],
193
+ "exclude": ["node_modules", "dist", ".git", ".next"],
194
+ "platform": "web"
195
+ }
196
+ ```
package/USAGE.md ADDED
@@ -0,0 +1,117 @@
1
+ # @auracheck-ai/cli — Claude Code usage guide
2
+
3
+ Once `auracheck login` + `auracheck init` are done and the MCP server is registered (`claude mcp add auracheck -- node /abs/path/dist/bin.js mcp`), you can prompt Claude Code in plain language and it will pick the right `sixseven.*` tools on its own. (`sixseven` works as an alias for every command here, same binary.)
4
+
5
+ Below are real prompt patterns you can paste into Claude Code.
6
+
7
+ ---
8
+
9
+ ## 1. First sanity check
10
+
11
+ > Use `sixseven.whoami`. Then list features and tell me which one to use for login flow tests.
12
+
13
+ This confirms binding works and surfaces the feature you'll attach testcases to.
14
+
15
+ ---
16
+
17
+ ## 2. Whitebox testcase from source code
18
+
19
+ > I want a happy-path login testcase. Read `src/pages/Login.tsx` and the form schema next to it. Use the feature named "Auth". Create the testcase and run it on web. When the run finishes, tell me pass/fail and the report URL.
20
+
21
+ What Claude will do under the hood:
22
+
23
+ 1. `sixseven.search_code` for `Login.tsx` and schema files.
24
+ 2. `sixseven.read_code` on the matches.
25
+ 3. `sixseven.list_features` → pick "Auth" id.
26
+ 4. `sixseven.create_testcase` with a Midscene flow array inferred from the form fields, e.g. `[{ aiInput: "user@example.com", locate: "Email field" }, { aiTap: "Sign in" }, { aiAssert: "Dashboard is visible" }]`. A bare array is wrapped into the `tasks[]` structure the server requires; a YAML/JSON string already shaped that way is passed through untouched.
27
+ 5. `sixseven.create_run({ testCaseIds:[id], platform:"web" })`.
28
+ 6. `sixseven.execute_run`.
29
+ 7. `sixseven.wait_for_run` (defaults: 300 s timeout, 3 s poll).
30
+ 8. Reports back the result and report URL.
31
+
32
+ ---
33
+
34
+ ## 3. Auto-fix loop (testcase or app bug?)
35
+
36
+ > Run testcase `tc_abc123`. If it fails, fetch evidence and decide: is the testcase brittle (fix it and re-run), or is the app broken (file a bug with the screenshot, severity high)?
37
+
38
+ Claude will iterate via:
39
+
40
+ - `sixseven.create_run` → `execute_run` → `wait_for_run`.
41
+ - On fail: `sixseven.get_evidence({ runId })` → reads `failedSteps[].error` + `screenshotUrl`.
42
+ - Decides: `sixseven.update_testcase` (selector / step wording was off) **or** `sixseven.list_bugs` then `sixseven.file_bug({ title, severity:"high", evidences:[screenshotUrl] })`.
43
+ - Re-runs on update; stops after filing a bug.
44
+
45
+ You can cap iterations explicitly:
46
+
47
+ > Iterate at most 3 times.
48
+
49
+ ---
50
+
51
+ ## 4. Blackbox sweep before whitebox
52
+
53
+ > Start exploration on `https://staging.example.com/`. Wait until done. Then for every route that has a form or a primary CTA, propose a testcase in the "Smoke" feature and run them in parallel.
54
+
55
+ Claude will use:
56
+
57
+ - `sixseven.start_exploration({ seedUrls:[…], maxDepth:3 })`.
58
+ - Polls `sixseven.get_exploration` until `status === "completed"`.
59
+ - Cross-references discovered routes with `sixseven.search_code` (whitebox) to enrich each testcase.
60
+ - Bulk-creates testcases, bulk-creates one run with all of them, executes, waits.
61
+
62
+ ---
63
+
64
+ ## 5. Recurring runs (schedules)
65
+
66
+ > Schedule the "Checkout" feature to run every weekday at 09:00 Jakarta time against the staging configuration, and mail the result to the QA leads. Fire it once now so I can see it actually works.
67
+
68
+ Claude will use:
69
+
70
+ - `sixseven.list_features` → the "Checkout" id, and `sixseven.list_schedule_recipients` → the leads' user ids (a user absent from that list would silently receive nothing).
71
+ - `sixseven.create_schedule({ name, cronExpressions:["0 9 * * 1-5"], timezone:"Asia/Jakarta", configurationId, caseFilter:{ mode:"feature", featureIds:[…] }, notifyUserIds:[…] })`. Cron and timezone are validated server-side, so a bad cadence is rejected at creation rather than silently never firing.
72
+ - `sixseven.run_schedule_now` → fires on the clock's own code path and hands back the created `runId`, which chains straight into `sixseven.wait_for_run`.
73
+ - `sixseven.list_schedule_fires` when a schedule looks idle: it names the reason — `skipped_overlap` (the previous run is still live), `skipped_misfire` (the tick ran later than `misfireGraceMinutes`), `skipped_capacity`, or `no_cases`.
74
+
75
+ Two traps worth knowing:
76
+
77
+ - A schedule with **no `configurationId`**, on a project with no default configuration, produces runs with no base URL that fail at the first navigation. `create_schedule` returns a `warning` when it detects exactly that.
78
+ - `lastFiredAt` only tracks **clock-driven** fires. After `run_schedule_now` it stays as it was — read `list_schedule_fires` for the true history.
79
+
80
+ Use `enabled:false` while you are still shaping the cadence: `run_schedule_now` works on a paused schedule, so you can test it end to end before letting the clock have it.
81
+
82
+ ---
83
+
84
+ ## 6. Pre-flight every commit (CI prompt)
85
+
86
+ > For each changed file in this commit that lives in `src/pages/**`, find the testcase tagged with the route, run it on web, and exit non-zero if any fail. Print the SixSeven report URLs.
87
+
88
+ Best paired with `--allowedTools` in a CI Claude Code invocation so only `sixseven.*` and `git` are available.
89
+
90
+ ---
91
+
92
+ ## Tool reference (when Claude asks "what can I do?")
93
+
94
+ Whitebox: `read_code`, `list_dir`, `search_code`.
95
+
96
+ Features/testcases: `list_features`, `create_feature`, `list_testcases`, `get_testcase`, `create_testcase`, `update_testcase`.
97
+
98
+ Runs: `list_runs`, `create_run`, `execute_run`, `get_run`, `cancel_run`, `wait_for_run`, `list_run_testcases`, `get_evidence`.
99
+
100
+ Schedules: `list_schedules`, `get_schedule`, `create_schedule`, `update_schedule`, `delete_schedule`, `run_schedule_now`, `list_schedule_fires`, `list_schedule_recipients`.
101
+
102
+ Exploration: `start_exploration`, `get_exploration`.
103
+
104
+ Bugs: `file_bug`, `list_bugs`, `get_bug`.
105
+
106
+ Context: `whoami`.
107
+
108
+ ---
109
+
110
+ ## Tips for better Claude prompts
111
+
112
+ - Tell it the **feature name** rather than the id — it can resolve via `list_features`.
113
+ - Be explicit about **platform** (`web` / `android` / `ios`) when it differs from `.sixseven/config.json`.
114
+ - For iteration loops, set a **hard cap** ("at most 3 attempts") so Claude doesn't spin.
115
+ - If a step screenshot URL is a presigned S3 link, it expires (~1 h). Have Claude file the bug in the same session, not the next day.
116
+ - `get_testcase` returns `steps` as the **YAML/JSON string** the server stores, not an array — parse it before editing, then pass either form back to `update_testcase`.
117
+ - Set `SIXSEVEN_DEBUG=1` before `auracheck mcp` to see stack traces on stderr; Claude won't see them.