evals 2.2.8 → 2.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.
@@ -0,0 +1,355 @@
1
+ # Get Started With Arize AX
2
+
3
+ Guide the user from zero to their first traces in Arize AX. Use the AX CLI, the Arize agent skills, and the official docs.
4
+
5
+ Work through the flow below in order. Installing the AX CLI and Arize skills, authenticating, and listing your spaces are all fine before approval — those are your own tooling. But do not create AX resources (like API keys), edit application files, or install the app's tracing dependencies before the user approves the plan in Step 5.
6
+
7
+ ## Step 0: Welcome and confirm
8
+
9
+ Greet the user and show the plan, then ask before doing anything:
10
+
11
+ ```text
12
+ Welcome to Arize AX. I'll get you set up with tracing. Here's what I'll do:
13
+
14
+ 1. Install the AX CLI and Arize skills
15
+ 2. Create a free Arize AX account or sign you in
16
+ 3. Instrument this project or a new app
17
+ 4. Capture traces from your app
18
+
19
+ Shall I proceed?
20
+ ```
21
+
22
+ Do not proceed until the user approves.
23
+
24
+ ## Prerequisites
25
+
26
+ The AX CLI must be **arize-ax-cli `0.28.0` or newer** (Step 1 installs the latest) and needs **Python 3.11+** — a hard requirement. If Python is missing, stop and have the user install it from https://www.python.org/downloads/ and re-run. **Node.js 18+ with npx** is optional but installs the Arize skills; without it, don't stop — continue and use the docs paths in Step 6 (the Vercel AI SDK v7 starter needs Node.js 22+).
27
+
28
+ ## Step 1: Install or update the AX CLI and Arize skills
29
+
30
+ Check the version with `ax --version`. If it's missing or older than the version above, install or upgrade `arize-ax-cli` — prefer `pipx`, otherwise pip:
31
+
32
+ ```bash
33
+ pipx install arize-ax-cli # already installed: pipx upgrade arize-ax-cli
34
+ # without pipx:
35
+ python3 -m pip install --upgrade arize-ax-cli
36
+ ```
37
+
38
+ If npx is available, install the Arize agent skills; otherwise skip and continue (Step 6 falls back to the docs paths):
39
+
40
+ ```bash
41
+ npx skills add Arize-ai/arize-skills --skill '*' --yes
42
+ ```
43
+
44
+ This writes the skills to disk but does **not** load them into your current session — a mid-session install is not in your invocable skill list, so don't call it by name. When you need a skill (Step 6), load it by reading its `SKILL.md` directly from the install path (the command prints where it wrote them). Skill directories are named `arize-<name>`, e.g. `arize-instrumentation`.
45
+
46
+ ## Step 2: Authenticate the CLI
47
+
48
+ The CLI authenticates through a profile named `default`, and every later `ax` command — including the trace check at the end — uses that profile. A bare `ARIZE_API_KEY` in the environment does **not** authenticate the CLI on its own; a profile must exist. Get one working before continuing.
49
+
50
+ First check whether the CLI is already authenticated:
51
+
52
+ ```bash
53
+ ax spaces list --limit 1 --output json
54
+ ```
55
+
56
+ If this succeeds, a profile is already set up — skip the rest of this step.
57
+
58
+ If it fails, first check whether a `default` profile already exists from a prior run:
59
+
60
+ ```bash
61
+ ax profiles list
62
+ ```
63
+
64
+ If a `default` profile exists but the probe failed, it's signed out or expired, not missing — for an OAuth profile, refresh it with `ax auth login` (see the OAuth handling below) and re-run the probe rather than recreating it. Only create a new profile when none exists (or an existing api-key profile has an invalid key). To create one, look for an existing key first: check for `ARIZE_API_KEY` in the environment **or** the project's `.env` / `.env.local`.
65
+
66
+ - **A key is available** — the user already has an account and key, so skip the browser flow. Resolve the value (never print it): use `$ARIZE_API_KEY` if it's exported in your shell; if it's only in a dotenv file, load it from there for this one command. Then create an api-key profile and re-run the probe to confirm:
67
+
68
+ ```bash
69
+ # if the key is only in a dotenv file, load it first (nothing is printed);
70
+ # point at the file the app uses (.env or .env.local):
71
+ export ARIZE_API_KEY="$(grep -E '^ARIZE_API_KEY=' .env 2>/dev/null | tail -1 | cut -d= -f2-)"
72
+ ax profiles create default --auth-method api-key --api-key "$ARIZE_API_KEY"
73
+ ```
74
+
75
+ Reuse this key throughout — do **not** create a new one in Step 6.
76
+
77
+ - **No key anywhere** — sign up or sign in with browser OAuth:
78
+
79
+ ```bash
80
+ ax profiles create default --auth-method oauth
81
+ ```
82
+
83
+ Always pass the positional profile name `default`. Without it, the CLI prompts `profile name [default]:`, receives EOF from an agent-run command, and exits with `Goodbye!` without creating a profile.
84
+
85
+ The rest of this step applies only to the **browser OAuth** branch.
86
+
87
+ Creating an OAuth profile **is** the browser login flow. Treat it as an interactive browser handoff: it opens a browser, starts a localhost callback server such as `127.0.0.1:<port>/callback`, and waits for the browser redirect. The command must stay alive until the redirect lands and the CLI exits on its own.
88
+
89
+ While the OAuth command is waiting, do not close its stdin, send Ctrl-C, `pkill` the AX process, start a second auth command, or run an auth probe. Any of these aborts the in-progress browser flow. There is one deliberate exception — the new email/password signup case described below, where the callback never lands and the command must be restarted.
90
+
91
+ After launching the OAuth command, tell the user:
92
+
93
+ ```text
94
+ A browser window is opening for Arize AX sign-in.
95
+
96
+ - Already have an account, or signing in with Google/SSO or an existing
97
+ email/password? Just finish in the browser and I'll continue automatically.
98
+ - Creating a BRAND-NEW account with email and password? Arize emails you a
99
+ validation link. That link does NOT complete the CLI login, so this command
100
+ will hang. Click the link to finish creating your account, then tell me.
101
+
102
+ Did you just sign up for a new account with email and password?
103
+ ```
104
+
105
+ **If the user says yes (new email/password signup):** the localhost callback will never fire and the command will wait forever, so this is the one time you break the "keep it alive" rule. Once they confirm they've clicked the validation link and their account exists, terminate the waiting OAuth command (send Ctrl-C / kill that process), then re-run it:
106
+
107
+ ```bash
108
+ ax profiles create default --auth-method oauth
109
+ ```
110
+
111
+ The second run is now a plain sign-in for the validated account. Its callback lands normally, so handle it with all the standard rules below — keep it alive and wait for it to exit on its own.
112
+
113
+ **Otherwise (existing account, SSO, or existing email/password):** wait for the command to exit on its own. Treat exit code `0`, or CLI success output such as `Configuration saved to profile 'default'` or `Active profile set`, as the primary completion signal.
114
+
115
+ Only after the OAuth command completes, verify authentication with a non-secret probe:
116
+
117
+ ```bash
118
+ ax spaces list --limit 1 --output json
119
+ ```
120
+
121
+ If the probe succeeds, continue. If the default OAuth profile already existed and the probe returns an authentication error, the profile is signed out or expired — run the fallback:
122
+
123
+ ```bash
124
+ ax auth login
125
+ ```
126
+
127
+ Handle `ax auth login` with the same rules: keep its callback server alive, wait for it to exit or print a success line, then rerun the probe. Do not run `ax auth login` immediately after creating an OAuth profile; the profile creation already performed login.
128
+
129
+ Do not treat `ax profiles show` alone as proof that OAuth completed; it can show profile configuration even when the user still needs to authenticate. Use it only for troubleshooting profile configuration, and never with `--expand`.
130
+
131
+ Run no other remote `ax` command (creating keys, listing all spaces, inspecting resources) until the probe succeeds.
132
+
133
+ ## Step 3: Select the AX space
134
+
135
+ List the spaces the authenticated profile can access:
136
+
137
+ ```bash
138
+ ax spaces list --output json
139
+ ```
140
+
141
+ If `ARIZE_SPACE_ID` is already set (environment or `.env` / `.env.local`), use it **only if it appears in that list** — that confirms the active profile can reach it (the app's existing key and your CLI profile may point at different spaces). If it's set but not in the list, don't trust it; select from the list instead. Otherwise: if exactly one space is returned, use it; if multiple, ask the user which to use; if none, guide the user to create a space in the Arize AX UI (or with an organization ID if available), then re-list.
142
+
143
+ Capture the space's **ID** (not its display name) for `ARIZE_SPACE_ID`. The `arize-otel` tracing config requires the space ID; a name will silently fail to route traces.
144
+
145
+ ## Step 4: Inspect the folder and choose a path
146
+
147
+ Inspect the current folder to decide whether an app already exists. Do not change files during inspection. Look for:
148
+
149
+ - Python: `pyproject.toml`, `requirements.txt`, `setup.py`, `Pipfile`, imports.
150
+ - TypeScript/JavaScript: `package.json`, lockfiles, `src`, `app`, `pages`, provider imports.
151
+ - Go: `go.mod`. Java: `pom.xml`, `build.gradle`, `build.gradle.kts`.
152
+ - Existing observability: `opentelemetry`, `TracerProvider`, `ARIZE_*`, `OTEL_*`, `OTLP_*`, Datadog, Honeycomb, Sentry, or other tracing.
153
+ - Agent framework: identify it by its import/package — e.g. `langchain` / `langgraph`, `llama_index`, `crewai`, `autogen`, `semantic_kernel`, `pydantic_ai`, `google.adk`, `dspy`, `agent_framework`, and others. **Route on the framework, not the provider client it wraps** — an `openai` or `anthropic` import inside a framework app is not the thing to instrument; the framework almost certainly has its own integration (see Step 6).
154
+
155
+ In a monorepo, check the git root to get oriented, but only instrument apps in or below the current working directory. If the project spans more than one language, instrument each one (route each through its own integration page in Step 6).
156
+
157
+ Then branch on what you found:
158
+
159
+ ### If an app exists in the current folder
160
+
161
+ Do not offer the starter-app path. Summarize the detected stack and offer to instrument it:
162
+
163
+ ```text
164
+ I found a <language>/<framework> app in this folder. Want me to add Arize AX
165
+ tracing to it?
166
+ ```
167
+
168
+ If the user declines, stop here rather than falling back to a starter app.
169
+
170
+ ### If no app exists in the current folder
171
+
172
+ Go straight to the starter-app choice — do not ask whether to instrument the empty folder. Ask which folder to create it in, then offer these choices:
173
+
174
+ - OpenAI — Python or TypeScript (with a tool call)
175
+ - Anthropic — Python (with a tool call; official AX auto-instrumentation)
176
+ - LangChain with OpenAI — Python or TypeScript (a tool-using agent)
177
+ - Vercel AI SDK with OpenAI — TypeScript (a tool-using agent)
178
+
179
+ If the user picks an unsupported pairing, explain the supported options and ask again.
180
+
181
+ ## Step 5: Present the plan and get approval
182
+
183
+ Before creating any remote resource, writing files, or installing dependencies, present one consolidated plan and wait for approval. This is the gate the intro refers to — nothing so far has modified the app or created AX resources.
184
+
185
+ For an existing app, cover: detected language and framework, package manager, LLM provider or agent framework, any existing tracing to preserve, the env file that will be updated, the instrumentation packages and files that will change, whether a new AX user API key will be created or the existing `ARIZE_API_KEY` reused, and the project name that will be used.
186
+
187
+ For a starter app, cover: the chosen provider and language, the target folder, the packages that will be installed, and the project name.
188
+
189
+ Choose a default project name from the current folder or app name: lowercase it, replace spaces and unsupported punctuation with hyphens, and append `-arize-tracing` if it is too generic. Do not create an AX project explicitly — it is created on first trace ingestion.
190
+
191
+ ```text
192
+ Here's my plan. Shall I proceed?
193
+ ```
194
+
195
+ Do not continue until the user approves.
196
+
197
+ ## Step 6: Create the API key, write the env file, and instrument
198
+
199
+ Only after approval, execute the plan in this order.
200
+
201
+ ### Choose the env file
202
+
203
+ Pick the env file to match the app and use it for every variable below:
204
+
205
+ - Next.js, Vite, or browser-adjacent TypeScript apps: `.env.local`
206
+ - Python apps, Node scripts, backend services, or unknown type: `.env`
207
+ - If the project already has exactly one of `.env` or `.env.local`, follow the existing convention.
208
+
209
+ Do not read existing env file contents into chat. Preserve unrelated variables and never reveal their values.
210
+
211
+ Make sure the env file is git-ignored before writing the API key to it — if the repo has a `.gitignore`, confirm it covers the file (add `.env` / `.env.local` if not); for a starter app you create, add one. The API key must never be committed to version control.
212
+
213
+ ### Write the non-secret variables
214
+
215
+ Add these two lines to the env file you chose — as file contents, not shell commands. Create the file if needed; if a line already exists, update it in place rather than duplicating. They're not secret. Skip `ARIZE_SPACE_ID` if it's already set to the value you're using.
216
+
217
+ ```dotenv
218
+ ARIZE_SPACE_ID=<space-id>
219
+ ARIZE_PROJECT_NAME=<chosen-project-name>
220
+ ```
221
+
222
+ ### Create the API key
223
+
224
+ **Skip this entirely if `ARIZE_API_KEY` was already present in Step 2** — reuse it and leave its env value untouched. Only create a key when you authenticated with browser OAuth and the app has no key yet.
225
+
226
+ Create the key and write it into the env file in one step:
227
+
228
+ ```bash
229
+ ax api-keys create --name "Local Arize AX tracing" --env-file .env
230
+ ```
231
+
232
+ `--env-file` writes `ARIZE_API_KEY` atomically and **never prints it** — no temp file, no secret in your terminal or chat. Use `.env.local` if that's the app's convention; the file is created if missing, an existing `ARIZE_API_KEY` is replaced in place, and other variables are preserved.
233
+
234
+ **Create the key exactly once** — a second `ax api-keys create` just orphans a still-active key. Git-ignore the env file (see above) *before* running this so the key is never committed.
235
+
236
+ If key creation fails, have the user create one in the Arize AX UI and add it to the env file without exposing it in chat. Either way, create only one key.
237
+
238
+ Handle the LLM provider's own key (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`) in the same env file — the app can't make a call or produce traces without it:
239
+
240
+ - **Existing app:** confirm the key is already present. If it's missing, ask the user for it and add it without echoing the value.
241
+ - **New starter app:** add a placeholder line for the provider key the app needs (e.g. `OPENAI_API_KEY=` with an empty value) to the env file, so the user knows exactly what to fill in. Tell them to set it before running; if they share it now, fill it in without echoing the value.
242
+
243
+ ### Add instrumentation
244
+
245
+ **Prefer the Arize instrumentation skill.** If you installed the skills in Step 1, load it now by reading its `SKILL.md` directly (a mid-session install isn't in your invocable list, so don't call it by name): read `arize-instrumentation/SKILL.md` from your agent's skills directory — project-level (`.claude/skills/`, `.cursor/skills/`, `.codex/…`, `.windsurf/…`) or the matching `~/.<agent>/…` global path. Follow the skill as your source of truth and **skip the rest of this section**. Use the docs fallback below only if the skill file doesn't exist (e.g. npx was missing in Step 1).
246
+
247
+ **Route by the framework you detected — search the index for *its* name and follow that page.** Look up the framework you identified in Step 4 (not the provider it wraps) in the index at https://arize.com/docs/ax/integrations (machine-readable: https://arize.com/docs/llms.txt). Most agent frameworks have a dedicated page even though they aren't in the shortcuts below, so actually search the index before concluding a framework is unsupported — it lists every supported provider and framework with the exact, verified setup. Don't force a stack onto a listed framework's setup, and don't wander into unrelated Arize docs once you're on the right page.
248
+
249
+ Common shortcuts:
250
+
251
+ - OpenAI: https://arize.com/docs/ax/integrations/llm-providers/openai/openai-tracing
252
+ - Anthropic: https://arize.com/docs/ax/integrations/llm-providers/anthropic/anthropic-tracing
253
+ - LangChain Python: https://arize.com/docs/ax/integrations/python-agent-frameworks/langchain/langchain-tracing
254
+ - LangChain.js: https://arize.com/docs/ax/integrations/ts-js-agent-frameworks/langchain/langchain-js
255
+ - Vercel AI SDK v7: https://arize.com/docs/ax/integrations/ts-js-agent-frameworks/vercel/vercel-ai-sdk-v7-tracing
256
+ - Vercel AI SDK v6 and earlier: https://arize.com/docs/ax/integrations/ts-js-agent-frameworks/vercel/vercel-ai-sdk-tracing
257
+
258
+ **Only if the framework genuinely has no page in the index**, fall back in this order — never hand-roll a raw OpenTelemetry `TracerProvider` + OTLP exporter when a helper exists:
259
+
260
+ 1. Use a framework-specific OpenInference instrumentor if one exists (`openinference-instrumentation-<name>` / `@arizeai/openinference-instrumentation-<name>`), wired up with `arize-otel` per the manual-instrumentation guide; install it unpinned.
261
+ 1. Instrument the underlying provider (OpenAI, Anthropic, Bedrock, …) with its instrumentor **only if the framework calls the provider SDK directly**. Many agent frameworks instead drive the model through their own client layer and emit their own OpenTelemetry spans — a provider instrumentor captures **no traces** for those. Never reach for the provider instrumentor as a blind fallback just because you recognize an `openai`/`anthropic` client.
262
+ 1. Otherwise instrument manually via `arize-otel` (see https://arize.com/docs/ax/instrument/manual-instrumentation), or stop and ask the user if you still can't determine a setup.
263
+
264
+ For existing apps:
265
+
266
+ - Use the app's existing package manager and style.
267
+ - Initialize tracing before LLM clients or frameworks are imported or created.
268
+ - Preserve existing OpenTelemetry providers; add Arize as an additional exporter when needed.
269
+ - Do not change business logic except to enable tracing.
270
+ - If the app uses tools/function calls and the integration does not capture tool spans, add manual tool spans only after explaining that in the plan.
271
+
272
+ For starter apps:
273
+
274
+ - Every starter should make a real LLM call that invokes at least one tool (e.g. a calculator or a canned data lookup), with the model deciding to call it and the result fed back for a final answer — so the first traces show a multi-step trajectory (the LLM call plus the tool call as its own span), not one flat span.
275
+ - Agent frameworks (LangChain, Vercel AI SDK): define the tool the framework's way; the instrumentor captures the tool and agent spans automatically.
276
+ - Plain providers (OpenAI, Anthropic): use the provider's native tool/function calling, and add tool spans with the OpenInference decorators — `@tracer.tool` on the tool function and `@tracer.agent` on the top-level loop. These decorators require wrapping the tracer in `OITracer` from `openinference-instrumentation` (the raw `arize.otel.register()` tracer doesn't expose them and `@tracer.tool` will raise `AttributeError`); see https://arize.com/docs/ax/instrument/manual-instrumentation.
277
+ - Ensure short-lived scripts flush/shut down the tracer provider before exit, or spans won't export.
278
+ - Give a clear run command and note which provider key env var is needed.
279
+
280
+ ### Package guidance
281
+
282
+ Install into the app's existing environment (its virtualenv if it has one) exactly the packages the detected framework's integration page lists — instrumentor names and peer dependencies differ per framework, so follow that page rather than copying from another stack or guessing versions.
283
+
284
+ ## Step 7: Run the app and poll for the first trace
285
+
286
+ First confirm the LLM provider's API key is set in the env file (from Step 6); a missing provider key is the most common reason the run produces no traces.
287
+
288
+ If you created a starter app in this flow, offer to run it for the user:
289
+
290
+ ```text
291
+ Your starter app is ready. Want me to run it for you?
292
+ ```
293
+
294
+ If they say yes, run it yourself with the run command, then poll. If they say no — or if you instrumented their existing app rather than creating a starter — tell them the exact run command and ask them to run it:
295
+
296
+ ```text
297
+ Run your app with:
298
+
299
+ <run command>
300
+
301
+ It should make at least one LLM call. I'll poll Arize AX and let you know as
302
+ soon as your first traces arrive.
303
+ ```
304
+
305
+ Once the app has run (whether you ran it or the user did), poll for spans. Pass the actual project name and space ID as literal arguments — do not use `$ARIZE_PROJECT_NAME`/`$ARIZE_SPACE_ID`, which live in the env file and are not exported to your shell. Query every ~15 seconds for up to ~3 minutes.
306
+
307
+ Span bodies can contain prompts, completions, tool arguments, and user data, so don't dump them into chat. Pipe the export through a counter that surfaces only how many spans arrived:
308
+
309
+ ```bash
310
+ ax spans export "<project-name>" --space "<space-id>" --limit 5 --stdout \
311
+ | python3 -c 'import json,sys; d=json.load(sys.stdin); s=d if isinstance(d,list) else (d.get("spans") or d.get("data") or []); print(f"{len(s)} span(s) found")'
312
+ ```
313
+
314
+ A non-zero count confirms traces are arriving. If you need to inspect a span to debug, write the export to a file outside the repo and read only the fields you need — never paste raw span bodies into chat.
315
+
316
+ This uses the CLI profile from Step 2 (OAuth or api-key) — it works the same either way. If the export errors with an authentication failure, the profile isn't valid; re-run the Step 2 probe and re-authenticate, or fall back to having the user open the project in the Arize AX UI to confirm traces.
317
+
318
+ - When spans come back, stop polling and continue to Step 8.
319
+ - On timeout, do not fail silently. Tell the user no traces arrived yet, and give likely causes: app didn't make an LLM call, tracing initialized after the client was created, a short-lived script exited before flushing spans, or the wrong space/project/env file. Offer to re-check once they've run it again.
320
+
321
+ Do not fabricate trace results. Only report traces the export command actually returned.
322
+
323
+ ## Step 8: Report the first traces with a link
324
+
325
+ Once spans arrive, report the span count and give the user a link into Arize AX for the project. Point them at the UI to explore the trace contents rather than printing span bodies into chat.
326
+
327
+ ```text
328
+ Your first traces are in Arize AX. Open project `<ARIZE_PROJECT_NAME>` here:
329
+ https://app.arize.com/
330
+ ```
331
+
332
+ If a space- or project-specific URL is known from the CLI or docs, prefer that deep link over the app root. Do not invent a URL structure you are not sure of; fall back to `https://app.arize.com/` plus instructions to select the project.
333
+
334
+ ## Step 9: Point at docs
335
+
336
+ Finish with links so the user can go deeper:
337
+
338
+ ```text
339
+ You're set up. To go further:
340
+
341
+ - Docs index: https://arize.com/docs/ax
342
+ - Tracing integrations: https://arize.com/docs/ax/integrations
343
+ - AX CLI: https://arize.com/docs/api-clients/cli/overview
344
+ ```
345
+
346
+ ## Critical rules
347
+
348
+ - Get the user's approval (Step 5) before creating AX resources, editing files, or installing dependencies.
349
+ - Authenticate the CLI before any other `ax` call — every command, including the final trace check, uses the active profile; env vars alone don't authenticate it. On the browser OAuth branch, keep the command alive until its localhost callback completes (never close stdin, Ctrl-C, `pkill`, or probe while it waits) — sole exception: a brand-new email/password signup, whose link never calls back, so ask the user, then kill and re-run as a sign-in.
350
+ - Never print, log, or summarize secrets in chat — API keys, env-file contents/values, or span bodies (prompts, completions, tool args, user data) — and never read env files into chat. Only report traces a command actually returned.
351
+ - Create at most one AX API key: skip if `ARIZE_API_KEY` already exists (reuse it), otherwise a **single** `ax api-keys create --env-file <file>`. Git-ignore that file before creating the key; never create a second key.
352
+ - Write the space **ID** (not its name) to `ARIZE_SPACE_ID`, or traces won't route; never create an AX project explicitly (it's made on first ingestion).
353
+ - Initialize tracing before LLM clients are created, and flush/shut down the tracer before short-lived scripts exit. Vercel AI SDK v7 also needs Node.js 22+, `@ai-sdk/otel` registered, and `experimental_telemetry: { isEnabled: true }` per call.
354
+
355
+ Docs: https://arize.com/docs/llms.txt
package/package.json CHANGED
@@ -1,27 +1,35 @@
1
- {
2
- "name": "evals",
3
- "version": "2.2.8",
4
- "description": "Arize evals package",
5
- "type": "module",
6
- "main": "cli.js",
7
- "scripts": {
8
- "postinstall": "echo \"run npx evals to complete setup\" && node spawn-interactive.js",
9
- "start": "node cli.js"
10
- },
11
- "dependencies": {
12
- "@arizeai/phoenix-evals": "^0.6.5",
13
- "@arizeai/phoenix-otel": "*",
14
- "ink": "^6.0.0",
15
- "ink-gradient": "^3.0.0",
16
- "react": "^19.0.0"
17
- },
18
- "bin": {
19
- "evals": "./cli.js"
20
- },
21
- "keywords": [
22
- "arize",
23
- "evals"
24
- ],
25
- "author": "",
26
- "license": "ISC"
27
- }
1
+ {
2
+ "name": "evals",
3
+ "version": "2.3.0",
4
+ "description": "Arize AX onboarding — instrument your app with tracing via your coding agent",
5
+ "type": "module",
6
+ "main": "cli.js",
7
+ "scripts": {
8
+ "postinstall": "node -e \"console.log('Arize evals installed run: npx evals')\"",
9
+ "start": "node cli.js",
10
+ "test": "node --test"
11
+ },
12
+ "dependencies": {
13
+ "ink": "^6.0.0",
14
+ "ink-gradient": "^3.0.0",
15
+ "react": "^19.0.0"
16
+ },
17
+ "bin": {
18
+ "evals": "./cli.js"
19
+ },
20
+ "files": [
21
+ "cli.js",
22
+ "onboarding-prompt.md",
23
+ "start.sh",
24
+ "start.ps1"
25
+ ],
26
+ "keywords": [
27
+ "arize",
28
+ "evals",
29
+ "tracing",
30
+ "observability",
31
+ "llm"
32
+ ],
33
+ "author": "",
34
+ "license": "ISC"
35
+ }
package/start.ps1 ADDED
@@ -0,0 +1,128 @@
1
+ #!/usr/bin/env pwsh
2
+ #
3
+ # Arize AX onboarding launcher (Windows / PowerShell).
4
+ #
5
+ # Lets you pick an installed coding agent and launches it seeded with the
6
+ # onboarding prompt to walk you through signup -> instrument -> first trace.
7
+ # This is the no-npm path; if you have Node, `npx evals` gives the same thing
8
+ # with a nicer UI.
9
+ #
10
+ # Run it:
11
+ # irm https://cdn.jsdelivr.net/npm/evals/start.ps1 | iex
12
+ #
13
+ # Non-interactive (irm|iex can't take params, so use the env var):
14
+ # $env:ARIZE_AGENT='claude'; irm .../start.ps1 | iex
15
+ # Or via the scriptblock form, which does accept -Agent:
16
+ # & ([scriptblock]::Create((irm .../start.ps1))) -Agent claude
17
+
18
+ [CmdletBinding()]
19
+ param(
20
+ [string]$Agent = $env:ARIZE_AGENT
21
+ )
22
+
23
+ $ErrorActionPreference = 'Stop'
24
+
25
+ # The prompt ships inside the public `evals` npm package; jsDelivr serves package
26
+ # files over HTTP, so it's fetchable even though the source repo is private.
27
+ # Override with $env:ARIZE_PROMPT_URL if needed.
28
+ $PromptUrl = if ($env:ARIZE_PROMPT_URL) { $env:ARIZE_PROMPT_URL } else { 'https://cdn.jsdelivr.net/npm/evals/onboarding-prompt.md' }
29
+
30
+ # Prefer the richer, bundled-prompt `npx evals` experience when Node is present.
31
+ # This script is the no-npm fallback; if npx exists, hand off to it.
32
+ # Set $env:ARIZE_SKIP_NPX=1 to force this shell path even when npx is available.
33
+ if (-not $env:ARIZE_SKIP_NPX -and (Get-Command npx -ErrorAction SilentlyContinue)) {
34
+ npx --yes evals
35
+ exit $LASTEXITCODE
36
+ }
37
+
38
+ # Supported agents: id -> label, install URL, and whether the REPL is seeded with `-i`.
39
+ $Agents = [ordered]@{
40
+ 'claude' = @{ Label = 'Claude Code'; Install = 'https://docs.claude.com/en/docs/claude-code'; Flag = $null }
41
+ 'codex' = @{ Label = 'OpenAI Codex'; Install = 'https://developers.openai.com/codex/cli'; Flag = $null }
42
+ 'cursor-agent' = @{ Label = 'Cursor'; Install = 'https://docs.cursor.com/en/cli/overview'; Flag = $null }
43
+ 'copilot' = @{ Label = 'GitHub Copilot'; Install = 'https://github.com/features/copilot/cli'; Flag = '-i' }
44
+ 'gemini' = @{ Label = 'Gemini CLI'; Install = 'https://github.com/google-gemini/gemini-cli'; Flag = '-i' }
45
+ }
46
+
47
+ function Test-Agent([string]$id) {
48
+ return [bool](Get-Command $id -ErrorAction SilentlyContinue)
49
+ }
50
+
51
+ # Resolve which agent to launch.
52
+ function Resolve-Agent {
53
+ if ($Agent) {
54
+ if (Test-Agent $Agent) { return $Agent }
55
+ Write-Host "Requested agent '$Agent' is not on your PATH." -ForegroundColor Yellow
56
+ return $null
57
+ }
58
+
59
+ $detected = @($Agents.Keys | Where-Object { Test-Agent $_ })
60
+
61
+ if ($detected.Count -eq 0) {
62
+ Write-Host "No supported coding agent found on your PATH." -ForegroundColor Yellow
63
+ Write-Host "Install one of these, then re-run:"
64
+ foreach ($id in $Agents.Keys) {
65
+ "{0,-14} {1}" -f $Agents[$id].Label, $Agents[$id].Install | Write-Host
66
+ }
67
+ return $null
68
+ }
69
+
70
+ if ($detected.Count -eq 1) { return $detected[0] }
71
+
72
+ Write-Host "Choose your coding agent:"
73
+ for ($i = 0; $i -lt $detected.Count; $i++) {
74
+ " {0}) {1}" -f ($i + 1), $Agents[$detected[$i]].Label | Write-Host
75
+ }
76
+ while ($true) {
77
+ $choice = Read-Host "Enter a number [1-$($detected.Count)]"
78
+ if ($choice -match '^\d+$' -and [int]$choice -ge 1 -and [int]$choice -le $detected.Count) {
79
+ return $detected[[int]$choice - 1]
80
+ }
81
+ Write-Host "Invalid choice."
82
+ }
83
+ }
84
+
85
+ # --- Welcome ---
86
+ Write-Host ""
87
+ Write-Host "Arize AX" -ForegroundColor Magenta -NoNewline
88
+ Write-Host " - Evals & Observability for Agentic AI" -ForegroundColor DarkGray
89
+ Write-Host ""
90
+ Write-Host "Let's get you tracing. I'll launch your coding agent with a guided prompt that"
91
+ Write-Host "walks you through signup, instrumenting your app, and seeing your first traces."
92
+ Write-Host ""
93
+
94
+ $chosen = Resolve-Agent
95
+ if (-not $chosen) { exit 1 }
96
+
97
+ # Download the prompt to a temp file (rename the .tmp to .md rather than
98
+ # leaving both behind).
99
+ $tmp = New-TemporaryFile
100
+ $promptFile = [System.IO.Path]::ChangeExtension($tmp.FullName, 'md')
101
+ Rename-Item -Path $tmp.FullName -NewName (Split-Path $promptFile -Leaf)
102
+ try {
103
+ Write-Host "Fetching the onboarding prompt..."
104
+ try {
105
+ Invoke-RestMethod -Uri $PromptUrl -OutFile $promptFile
106
+ } catch {
107
+ Write-Host "Failed to download the onboarding prompt from $PromptUrl" -ForegroundColor Red
108
+ Write-Host "Check your connection and try again."
109
+ exit 1
110
+ }
111
+
112
+ $seed = "Read the file $promptFile and follow it to set up Arize AX tracing in this project, walking me through each step and asking me questions as needed."
113
+
114
+ Write-Host ("Launching {0}..." -f $Agents[$chosen].Label)
115
+ Write-Host ""
116
+
117
+ # Launch interactive + seeded. No skip-permissions — the agent's approval
118
+ # model and the prompt's own approval gate must stay intact. External commands
119
+ # attach to the console, so the agent gets a real terminal.
120
+ $flag = $Agents[$chosen].Flag
121
+ if ($flag) {
122
+ & $chosen $flag $seed
123
+ } else {
124
+ & $chosen $seed
125
+ }
126
+ } finally {
127
+ Remove-Item $promptFile -ErrorAction SilentlyContinue
128
+ }