@emit-vision/cli 0.2.6 → 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.
Files changed (3) hide show
  1. package/README.md +33 -1
  2. package/dist/index.js +865 -155
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -29,6 +29,37 @@ Point at a self-hosted instance with `--api-url`:
29
29
  emit-vision login --token <pat> --api-url https://api.your-host.com
30
30
  ```
31
31
 
32
+ ## Multiple accounts
33
+
34
+ Each login is stored as a named profile, so one machine can talk to several accounts or instances.
35
+
36
+ ```bash
37
+ emit-vision login --profile work --token <pat> # save a token under "work"
38
+ emit-vision profile list # * marks the profile in use here
39
+ emit-vision profile use work # set the current profile
40
+ emit-vision status --profile personal # --profile works on any command
41
+ emit-vision logout --profile work # remove one profile
42
+ emit-vision logout --all # remove every profile
43
+ ```
44
+
45
+ A repo can pin its own account and default project with a `.emit-vision.json` at the repo root:
46
+
47
+ ```json
48
+ { "profile": "work", "projectId": "proj_abc123" }
49
+ ```
50
+
51
+ This file is safe to commit. Never put a token in it; the CLI refuses to read it if it contains `pat`, `token`, or `apiKey`. With `projectId` set, commands that take a single `[projectId]` argument (`overview`, `events recent`, `errors recent|grouped`, `logs`, `key get|rotate`, `users list`, `audience export|sync`, `flags list|evaluate`, and `pulse --project`) can omit it. An explicit ID always wins. `flags` mutations and `project env create` still require an explicit project ID.
52
+
53
+ The account is chosen in this order, first match wins:
54
+
55
+ 1. `--profile <name>`
56
+ 2. `EMIT_VISION_PAT` (use this token directly)
57
+ 3. `EMIT_VISION_PROFILE`
58
+ 4. `.emit-vision.json` `profile`
59
+ 5. the current profile (`profile use`)
60
+
61
+ `EMIT_VISION_API_URL` sets the API URL when using `EMIT_VISION_PAT`, and `EMIT_VISION_CONFIG_DIR` changes the config directory (default `~/.emit-vision`).
62
+
32
63
  ## Feature flags
33
64
 
34
65
  ```bash
@@ -54,11 +85,12 @@ cat flag.json | emit-vision flags create <projectId> --from-json -
54
85
  ```bash
55
86
  emit-vision overview <projectId>
56
87
  emit-vision events recent <projectId> --limit 20
88
+ emit-vision events recent <projectId> --system
57
89
  emit-vision errors grouped <projectId> --environment production
58
90
  emit-vision logs <projectId> --severity error
59
91
  ```
60
92
 
61
- Most commands accept `--from`/`--to` (ISO timestamps), `--environment`, `--limit`, and `--json`.
93
+ Most commands accept `--from`/`--to` (ISO timestamps), `--environment`, `--limit`, and `--json`. `events recent` also accepts `--system` to show system/heartbeat traffic instead of regular events.
62
94
 
63
95
  ## Projects and keys
64
96