higherdata 0.2.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.
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright HigherOps Inc. You may install and use this software with a HigherData account. You may not redistribute modified copies.
package/README.md ADDED
@@ -0,0 +1,224 @@
1
+ # HigherData CLI
2
+
3
+ Requires Node 24 or newer. Build from the repository root with `npm run build`, or build
4
+ only this workspace with `npm run build --workspace higherdata`.
5
+
6
+ ```
7
+ node packages/cli/dist/index.js --version
8
+ node packages/cli/dist/index.js --help
9
+ ```
10
+
11
+ The package provides `higherdata` and `hd`. After the first approved npm release,
12
+ install with `npm install --global higherdata`, or run `npx higherdata --version`.
13
+ Global flags are `--json`, `--jsonl` and `--api-url <url>`.
14
+ `--help` and `--version` work without credentials or a config file.
15
+
16
+ Config lives at `~/.config/higherdata/config.json`. The config helpers write it
17
+ atomically with mode 0600 and tighten an existing file to 0600 when read.
18
+ No config is created just by reading defaults. The format supports multiple
19
+ profiles:
20
+
21
+ ```json
22
+ {
23
+ "activeProfile": "staging",
24
+ "profiles": {
25
+ "production": { "apiUrl": "https://higherdata.io" },
26
+ "staging": { "apiUrl": "https://staging.higherdata.io", "space": "default" }
27
+ }
28
+ }
29
+ ```
30
+
31
+ Each profile may also hold `apiKey`. URL precedence is `--api-url`,
32
+ `HIGHERDATA_API_URL`, the active profile, then `https://higherdata.io`.
33
+ `HIGHERDATA_API_KEY` overrides the profile key.
34
+ API URLs require HTTPS. HTTP is allowed only on `localhost`, `127.0.0.1`,
35
+ and `[::1]` for local development. Embedded URL credentials are refused.
36
+
37
+ Exit codes: 0 success, 2 usage or configuration, 3 authentication, 4 limit,
38
+ 5 suppressed-only result, 6 needs approval.
39
+
40
+ ## Interactive app
41
+
42
+ Run `higherdata` (or `hd`) in a terminal to open the keyboard app. The yellow
43
+ wordmark and three bars form in under 1.5 seconds; any key skips it.
44
+ `--no-banner` opens the menu immediately. Piped output, `--json`, `--jsonl`
45
+ and `CI` never animate. `NO_COLOR` disables accent colors. Supports 80 columns
46
+ and wider, and responds to terminal resizing.
47
+
48
+ Use arrows and Enter to choose a section, tool, field or record. Search filters
49
+ are editable fields: enter comma separated values for multi-value filters,
50
+ and blank a field to clear it. Advanced structured fields accept JSON.
51
+ N loads the next results page; Enter opens a record. Company records show
52
+ contacts and Insights tabs (the server applies the plan gate and suppression).
53
+ A adds the record to a saved list, F finds its work email, V verifies it.
54
+
55
+ Irreversible actions and email verification requests show a preview; scroll it with arrows and press
56
+ Y to confirm or N to cancel. CRM writes use the server's change-set approval
57
+ flow. Active enrichment jobs refresh at the server's interval while that
58
+ screen is open. D streams a completed job or list export to a new private file.
59
+ Escape goes back, Ctrl+C exits. A failed stream can leave a partial file.
60
+
61
+ Ask HigherData has private conversations per API key and space, separate from
62
+ browser members. Enter a request, confirm verification or a CRM step with Y or cancel
63
+ with N. Ctrl+B adjusts the conversation step limit; Ctrl+N starts a conversation. Model
64
+ plans cannot approve or apply CRM changes.
65
+
66
+ Every registered tool is also available under `tools` with schema-derived flags
67
+ and `--input` for advanced JSON. Searches, lookups and reversible local changes execute normally; irreversible actions and
68
+ email requests preview by default and need `--execute --yes` to execute.
69
+ The API validates inputs, authorization and suppression. Existing commands
70
+ below preserve their behavior and output.
71
+
72
+ ```sh
73
+ higherdata tools search.companies --country-codes CA,US --employee-count-min 50 --json
74
+ higherdata tools lookup.company --id hdo_EXAMPLE --json
75
+ higherdata tools email.verify --email avery@cedar.example --json
76
+ higherdata tools email.verify --email avery@cedar.example --execute --yes --json
77
+ higherdata tools changes.apply --id CHANGE_SET_ID --execute --yes --json
78
+ higherdata tools agent.run --action message --message "Find Canadian companies" --execute --yes --json
79
+ ```
80
+
81
+ The `tools` commands and interactive app share the SDK transport. Each action
82
+ gets a fresh idempotency key and has no automatic retries. For scripts, supply
83
+ `--idempotency-key` to retry the same action; omit it in the interactive app,
84
+ where multiple actions need different keys.
85
+
86
+ ## Commands
87
+
88
+ ```sh
89
+ higherdata login --api-url https://staging.higherdata.io
90
+ higherdata whoami --json
91
+ higherdata use client-space
92
+ higherdata search companies --country-code CA --limit 25 --json
93
+ higherdata search people --country-code CA --title-keyword Operations --all --jsonl
94
+ higherdata search companies --where "Canadian companies" --employee-count-min 50
95
+ higherdata count --country-code CA --json
96
+ higherdata lookup company cedar.example --json
97
+ higherdata lookup person avery@cedar.example --json
98
+ higherdata lists create "Canadian companies" --country-code CA --recurring --json
99
+ higherdata lists add <list-id> <opaque-id> --dry-run --json
100
+ higherdata lists run <list-id> --dry-run --json
101
+ higherdata lists export <list-id> --format csv --all > companies.csv
102
+ higherdata logout
103
+ ```
104
+
105
+ Login prints the device code and approval URL to stderr, opens the browser when
106
+ available, and polls at the server's interval until approval, denial or expiry.
107
+ Use `--no-browser` for a remote terminal. Approval stores the issued key and API
108
+ URL in the active profile with mode 0600. Login clears an older space selection;
109
+ the issued key's space applies until `use` selects another authorized space.
110
+ Logout removes the active profile's saved key. An environment key still applies.
111
+
112
+ Commands use only `/api/v1`. Versioned device routes reuse the original device
113
+ handlers. Requests time out after 30 seconds, refuse redirects and cap response
114
+ bodies at 8 MiB. The CLI reports safe errors without printing credentials or
115
+ provider error bodies. Production's alias can use the canonical approval URL.
116
+
117
+ Repeat array flags, such as `--country-code CA --country-code US`, to add values.
118
+ For advanced filters, use `--filters '{"requiredKeywordGroups":[["operations","logistics"]]}'`.
119
+ The API validates filter fields and resolves tenant, space and scope. `--where`
120
+ calls `search.filters_from_text`; explicit filter JSON and flags override its
121
+ proposed values before the search. People searches need a selective country or
122
+ industry, as enforced by the API.
123
+
124
+ `--limit` is the page size, from 1 to 50. `--cursor` resumes an opaque cursor and
125
+ `--all` walks the remaining pages. Repeated cursors stop with an error. JSON
126
+ search output retains `items`, `nextCursor` and `zeroResults`; with `--all`, the
127
+ items are combined and the final cursor is null. JSONL prints one record per
128
+ line. Human output uses tables. Choose one of `--json` and `--jsonl`.
129
+
130
+ List writes support `--dry-run`, which sends `execute=false` to the tool. List
131
+ export emits the tool's CSV or JSONL content; `--all` combines pages with a
132
+ single CSV header. Use `--json` to retain the export response envelope. Until
133
+ background jobs are configured, executing `lists run` reports that jobs are
134
+ unavailable; creating lists, adding items and exporting still work.
135
+
136
+ ### Bulk enrichment
137
+
138
+ Upload CSV or JSONL with explicit `--map target=column` options. Each upload
139
+ request carries at most 500 rows. The server enforces the workspace's row and
140
+ file limits and retains private files for seven days.
141
+
142
+ ```sh
143
+ higherdata enrich companies.csv --operation enrich.company --map domain=Website --wait --output enriched.csv
144
+ higherdata enrich people.jsonl --operation email.verify --map email=work_email --wait --output verified.jsonl
145
+ higherdata jobs list --json
146
+ higherdata jobs get JOB_ID --json
147
+ higherdata jobs wait JOB_ID --json
148
+ higherdata jobs download JOB_ID --format csv --output results.csv
149
+ higherdata jobs cancel JOB_ID --dry-run --json
150
+ ```
151
+
152
+ `--dry-run` uploads the input and checks its row count and mapping without enriching records.
153
+ Output files must not already exist. Uploads, downloads, and `lists export --all`
154
+ and `suppress export --all` stream bounded pages instead of buffering the full
155
+ file. A failed stream can leave a partial destination; retry to a new file.
156
+ `jobs wait` times out after one hour and prints the job id for continuation.
157
+ Cancellation requires admin scope and settles only already completed work.
158
+
159
+ The `enrich.bulk` tool also accepts a saved list source and an optional tenant
160
+ completion webhook. An admin configures the HTTPS URL and secret in the start
161
+ request. The receiver verifies `x-higherdata-signature` (the `sha256=` prefix
162
+ followed by the HMAC-SHA256 hex digest of `timestamp + "." + rawBody`) with the
163
+ shared secret, checks `x-higherdata-timestamp` freshness, and deduplicates by job
164
+ id. Delivery is retried from the durable outbox at most five times. Payloads
165
+ contain job status and counts, not result records.
166
+
167
+ When background jobs are dormant, `jobs wait` advances bounded slices. With
168
+ background jobs active, the same command observes progress. Downloads reapply
169
+ current suppression and may omit records that were allowed when the job ran.
170
+
171
+ ## Agent installation
172
+
173
+ Open Account in the interactive app and choose Install MCP or Install skills.
174
+ Select the agent and scope, then review the destination before confirming.
175
+ The same operations work as commands:
176
+
177
+ ```sh
178
+ higherdata --json mcp install claude
179
+ higherdata --json mcp install codex --profile full
180
+ higherdata --json mcp install cursor --scope project
181
+ higherdata --json mcp install codex --print
182
+ higherdata --json skills install claude
183
+ higherdata --json skills install codex --scope project
184
+ ```
185
+
186
+ MCP uses the selected API origin's `/mcp` endpoint, selected space and either
187
+ the default tool profile or `?profile=full`. User installs use the saved CLI
188
+ key in a private file unless `HIGHERDATA_API_KEY` is set, in which case the
189
+ configuration references that environment variable. Project installs always
190
+ use an environment reference. Set that variable in the environment that
191
+ launches the agent. `--print` never shows a stored credential or edits files.
192
+
193
+ Claude Code uses its `claude mcp add --transport http` command when available,
194
+ or prints a safe command to run manually. Codex uses `~/.codex/config.toml`
195
+ (project: `.codex/config.toml`). Cursor uses `~/.cursor/mcp.json` (project:
196
+ `.cursor/mcp.json`). Existing server entries are preserved, changed files are
197
+ backed up privately, and identical installations are unchanged. An existing
198
+ `higherdata` entry with different settings is left unchanged; remove it in
199
+ the agent before reinstalling. Restart your agent after changing MCP.
200
+
201
+ The package includes five skills: building an ICP starter list, enriching a
202
+ CSV safely, finding work emails, respecting suppression, and checking usage.
203
+ Claude Code skills go to `~/.claude/skills` or project `.claude/skills`; current
204
+ Codex skills go to `~/.agents/skills` or project `.agents/skills`. Customized
205
+ installed skills are preserved. Move a customized skill aside before updating
206
+ it from this bundle. Installs do not call HigherData.
207
+
208
+ Formats follow the current [Claude Code MCP](https://code.claude.com/docs/en/mcp),
209
+ [Codex MCP](https://learn.chatgpt.com/docs/extend/mcp?surface=cli),
210
+ [Cursor MCP](https://cursor.com/docs/mcp), and
211
+ [Codex skills](https://learn.chatgpt.com/docs/build-skills) documentation.
212
+
213
+ ## Compatibility
214
+
215
+ The CLI reads public `/api/v1/meta` once per day per API origin and caches the
216
+ policy beside its config file. Updates are announced on stderr so JSON output
217
+ stays machine-readable. Versions below the server's minimum refuse commands
218
+ with `npm install --global higherdata@latest` as the upgrade command. `login`,
219
+ `--help` and `--version` remain available without a compatibility check.
220
+
221
+ The metadata request times out after three seconds. On network failure the CLI
222
+ uses its last known policy; with no cached policy it allows the command. Failed
223
+ checks are cached for a day too. A read-only cache directory allows commands but
224
+ cannot persist the daily check, so subsequent invocations may check again.