@emit-vision/cli 0.2.7 → 0.4.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 +41 -1
  2. package/dist/index.js +20151 -684
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -29,6 +29,45 @@ 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. `emit-vision link` writes (or merges into) `.emit-vision.json` for you, at the git root, or in the existing file if one is already found below it:
46
+
47
+ ```bash
48
+ emit-vision link --profile work --project proj_abc123
49
+ emit-vision link --profile work # keeps any existing projectId
50
+ emit-vision link # in a terminal, pick from your projects
51
+ ```
52
+
53
+ It never writes a token and keeps any other keys already in the file. This is what it writes:
54
+
55
+ ```json
56
+ { "profile": "work", "projectId": "proj_abc123" }
57
+ ```
58
+
59
+ 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.
60
+
61
+ The account is chosen in this order, first match wins:
62
+
63
+ 1. `--profile <name>`
64
+ 2. `EMIT_VISION_PAT` (use this token directly)
65
+ 3. `EMIT_VISION_PROFILE`
66
+ 4. `.emit-vision.json` `profile`
67
+ 5. the current profile (`profile use`)
68
+
69
+ `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`).
70
+
32
71
  ## Feature flags
33
72
 
34
73
  ```bash
@@ -54,11 +93,12 @@ cat flag.json | emit-vision flags create <projectId> --from-json -
54
93
  ```bash
55
94
  emit-vision overview <projectId>
56
95
  emit-vision events recent <projectId> --limit 20
96
+ emit-vision events recent <projectId> --system
57
97
  emit-vision errors grouped <projectId> --environment production
58
98
  emit-vision logs <projectId> --severity error
59
99
  ```
60
100
 
61
- Most commands accept `--from`/`--to` (ISO timestamps), `--environment`, `--limit`, and `--json`.
101
+ 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
102
 
63
103
  ## Projects and keys
64
104