@mainwave/cli 0.4.0-rc.1 → 0.4.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.
Files changed (41) hide show
  1. package/README.md +47 -8
  2. package/dist/adapters/claude-code.js +39 -5
  3. package/dist/adapters/claude-code.js.map +1 -1
  4. package/dist/adapters/claude-desktop.js +3 -0
  5. package/dist/adapters/claude-desktop.js.map +1 -1
  6. package/dist/adapters/codex-cli.js +8 -0
  7. package/dist/adapters/codex-cli.js.map +1 -1
  8. package/dist/adapters/copilot-chat.js +9 -0
  9. package/dist/adapters/copilot-chat.js.map +1 -1
  10. package/dist/adapters/copilot-cli.js +8 -0
  11. package/dist/adapters/copilot-cli.js.map +1 -1
  12. package/dist/adapters/cursor-enterprise.js +9 -0
  13. package/dist/adapters/cursor-enterprise.js.map +1 -1
  14. package/dist/adapters/cursor.js +8 -0
  15. package/dist/adapters/cursor.js.map +1 -1
  16. package/dist/core/apply.js +18 -2
  17. package/dist/core/apply.js.map +1 -1
  18. package/dist/core/auth-commands.js +16 -6
  19. package/dist/core/auth-commands.js.map +1 -1
  20. package/dist/core/doctor.js +8 -1
  21. package/dist/core/doctor.js.map +1 -1
  22. package/dist/core/interview.js +6 -5
  23. package/dist/core/interview.js.map +1 -1
  24. package/dist/core/platform.js +15 -0
  25. package/dist/core/platform.js.map +1 -1
  26. package/dist/core/prompts.js +7 -2
  27. package/dist/core/prompts.js.map +1 -1
  28. package/dist/core/skills.js +203 -0
  29. package/dist/core/skills.js.map +1 -0
  30. package/dist/core/use-case.js +34 -58
  31. package/dist/core/use-case.js.map +1 -1
  32. package/dist/core/wizard.js +196 -7
  33. package/dist/core/wizard.js.map +1 -1
  34. package/dist/main.js +63 -11
  35. package/dist/main.js.map +1 -1
  36. package/package.json +2 -1
  37. package/skills/mainwave-instrument/SKILL.md +168 -0
  38. package/skills/mainwave-instrument/reference/api.md +142 -0
  39. package/skills/mainwave-instrument/reference/frameworks.md +170 -0
  40. package/skills/mainwave-instrument/reference/troubleshooting.md +131 -0
  41. package/skills/mainwave-setup/SKILL.md +114 -0
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: mainwave-setup
3
+ description: Connect this coding tool to Mainwave so its sessions produce telemetry — sign in, pick a use case, mint a per-developer key, write the config, and prove a span arrived. Use when asked to set up Mainwave, connect to Mainwave, fix a broken or stale Mainwave config, or check whether telemetry is actually flowing. Drives the mainwave-cli; never edit the tool's settings by hand.
4
+ ---
5
+
6
+ # Connecting a coding tool to Mainwave
7
+
8
+ The `mainwave-cli` does this whole flow. Your job is to drive it and read what
9
+ it tells you — **never hand-edit a settings file to add telemetry config.** The
10
+ CLI writes several files atomically, keeps secrets out of the ones that get
11
+ committed, and knows each tool's key names. A hand-written env block is how
12
+ people end up with a key in a repo and telemetry that silently doesn't flow.
13
+
14
+ Every prompt has a flag, so the whole flow runs without a terminal.
15
+
16
+ ## 1. Sign in
17
+
18
+ ```bash
19
+ npx @mainwave/cli@latest login --device
20
+ ```
21
+
22
+ `--device` matters here. The CLI shows a short code and opens the browser; the
23
+ human approves in the Mainwave session they already have. Without it, a run
24
+ with no TTY — which is what you are — assumes nobody is watching, falls back to
25
+ email and password, and stops asking for `MAINWAVE_EMAIL`.
26
+
27
+ Print the code and the URL for the user, and tell them to approve in the
28
+ browser. Then wait — the command blocks until they do, or until it times out.
29
+
30
+ If the user is on CI or has no browser, `MAINWAVE_EMAIL` and `MAINWAVE_PASSWORD`
31
+ in the environment take the password path with no flags at all. **Never ask the
32
+ user to type a password to you, and never put one on the command line.**
33
+
34
+ Already signed in? `whoami` says so without re-authenticating:
35
+
36
+ ```bash
37
+ npx @mainwave/cli@latest whoami --json
38
+ ```
39
+
40
+ ## 2. Set up this tool
41
+
42
+ ```bash
43
+ npx @mainwave/cli@latest setup <adapter> --yes --json
44
+ ```
45
+
46
+ Use the adapter for the tool you are running inside — `claude-code`, `codex`,
47
+ `copilot-cli`, `copilot-chat`, `cursor`, `claude-desktop`. Run `setup` with no
48
+ adapter to see what the CLI detects on this machine.
49
+
50
+ `--json` gives you one parseable document on stdout; narrative goes to stderr.
51
+ `--yes` is required for a non-interactive write — without it the CLI refuses
52
+ rather than showing a diff nobody confirms.
53
+
54
+ Flags worth knowing, all optional:
55
+
56
+ - `--scope local` writes repo config instead of user-level. Global is the
57
+ default and is usually right; local is a deliberate choice the user makes.
58
+ - `--use-case "<name>"` creates a use case by name, `--ucid <id|url>` binds an
59
+ existing one, `--no-use-case` skips. Left alone, the CLI asks — which it
60
+ cannot do without a terminal, so pass one of these.
61
+ - `--opt-in prompts,tool-details,tool-content` turns on the sensitive-data
62
+ captures, all off by default.
63
+
64
+ **Ask before enabling any opt-in.** `prompts` sends the user's prompt text off
65
+ the machine. That is the user's call every time, not a default you pick for
66
+ them, and not something to enable because it makes the demo better.
67
+
68
+ ## 3. Prove it works
69
+
70
+ ```bash
71
+ npx @mainwave/cli@latest verify --json
72
+ ```
73
+
74
+ This pushes a sample trace and waits for it to land, so it proves the network
75
+ path and the key. It does **not** prove the tool itself is emitting — the tool
76
+ has to run first, and most tools only read the new config at launch.
77
+
78
+ So: tell the user to restart the tool, have them do some work in it, then run
79
+ `verify --no-sample` to watch for the tool's own spans without the synthetic
80
+ one. Report the link it prints.
81
+
82
+ ## When something is already there
83
+
84
+ ```bash
85
+ npx @mainwave/cli@latest doctor <adapter> --json
86
+ npx @mainwave/cli@latest status --json
87
+ ```
88
+
89
+ `doctor` walks the whole settings hierarchy — including managed and org-policy
90
+ layers the CLI cannot write — and reports kill switches, stale versions, and
91
+ overrides. Run it before concluding anything is broken. A config that looks
92
+ right in the user file can be overridden a layer up, and `doctor` is the only
93
+ thing that sees that.
94
+
95
+ Re-running `setup` is safe and is the fix for most staleness: it converges
96
+ rather than duplicating.
97
+
98
+ ## Guardrails
99
+
100
+ - **Never write telemetry config by hand.** Use the CLI. If the CLI cannot do
101
+ what is needed, say so rather than reaching for the settings file.
102
+ - **Never print an API key, a token, or the contents of `~/.mainwave/credentials.json`.**
103
+ The CLI masks secrets in its own output; don't undo that by `cat`-ing files.
104
+ - **Never enable a data opt-in without asking.**
105
+ - **Never commit a settings file containing a key.** If `--scope local` wrote
106
+ into the repo, check what is tracked before suggesting a commit.
107
+ - Report what the CLI reported. Do not summarize a failure into a success — a
108
+ `verify` that timed out is a timeout, not "set up successfully".
109
+
110
+ ## Instrumenting an application
111
+
112
+ This skill connects a _coding tool_. Wiring the Mainwave SDK into an application
113
+ — an agent, a service, a pipeline — is a different job with its own skill:
114
+ `mainwave-instrument`.