@hginsights/hgi 0.0.0 → 0.1.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HG Insights
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # @hginsights/hgi
1
+ # hgi
2
2
 
3
- Placeholder. The real package is published from https://github.com/HGInsights/hgi-cli
3
+ `hgi` is a command-line client for the HG Insights MCP server. It is built first for AI coding agents (Claude Code and similar) and second for developers and GTM engineers who want company, contact, technology, intent and spend data in a terminal or a script.
4
+
5
+ It is a thin client: it signs you in through your browser, then lists and runs the tools the server offers you. It never hard-codes the tool list.
6
+
7
+ > **Status:** pre-release. The repository is private until the open-source release is approved.
8
+
9
+ ## Install
10
+
11
+ macOS and Linux only. Windows is not supported (`npm` refuses the install). Pick one route:
12
+
13
+ ```bash
14
+ brew install hginsights/tap/hgi # macOS and Linux, no Node.js needed
15
+ npm install -g @hginsights/hgi # needs Node.js 22.19 or newer
16
+ # or download hgi-vX.Y.Z-<os>-<arch>.tar.gz from the GitHub release, unpack, and put `hgi` on your PATH
17
+ hgi --version
18
+ ```
19
+
20
+ The prebuilt binaries (macOS arm64 and x64, Linux x64 and arm64) bundle their own Node.js, so they are large (about 110-130 MB). On Linux they need glibc 2.28 or newer; on Alpine use the npm route. The macOS binaries are not Developer ID signed or notarized, so install them with Homebrew (or npm). If you download a macOS tarball through a browser, macOS will block it until you run `xattr -d com.apple.quarantine hgi` once; `curl`, Homebrew and npm downloads are not affected.
21
+
22
+ ### Verify what you installed
23
+
24
+ ```bash
25
+ sha256sum -c SHA256SUMS --ignore-missing # shasum -a 256 -c on macOS
26
+ gh attestation verify hgi-vX.Y.Z-<os>-<arch>.tar.gz --repo HGInsights/hgi-cli
27
+ # npm route: run `npm audit signatures` in a project that depends on @hginsights/hgi
28
+ npm view @hginsights/hgi dist.attestations # provenance attestation for the package
29
+ ```
30
+
31
+ Each release also attaches a CycloneDX SBOM. See [SECURITY.md](SECURITY.md) and [docs/releasing.md](docs/releasing.md).
32
+
33
+ ### Troubleshooting
34
+
35
+ - The binary and the npm install both honor `NODE_OPTIONS`. If your shell exports `--require` or `--import` hooks (for example a tracer), `hgi` can fail to start: run `env -u NODE_OPTIONS hgi ...`.
36
+
37
+ ## Quick start
38
+
39
+ ```bash
40
+ hgi auth login # opens your browser; sign in and approve
41
+ hgi auth whoami # who you are and which organization is billed
42
+ hgi tools list # what the server offers you, each marked call or run
43
+ hgi call company_enrich --input '{"domain":"acme.com"}'
44
+ ```
45
+
46
+ `hgi call` runs read-only tools (lookups). `hgi run` runs tools that change state or start work, and tools that do not declare themselves read-only. Using the wrong verb fails and tells you the right one. There is no `--yes` flag: that is deliberate, so an agent permission rule on `hgi call *` approves only lookups.
47
+
48
+ On a machine without a browser:
49
+
50
+ ```bash
51
+ hgi auth login --no-browser # prints a URL; open it anywhere, then paste back the URL it redirects to
52
+ ```
53
+
54
+ ## Commands
55
+
56
+ | Command | What it does |
57
+ |---|---|
58
+ | `hgi auth login [--no-browser]` | sign in with OAuth (authorization code + PKCE) |
59
+ | `hgi auth whoami` | show the signed-in user and organization (asks the server) |
60
+ | `hgi auth logout [--force]` | revoke the session on the server and delete the local credentials |
61
+ | `hgi tools list [--refresh] [--json]` | the tools the server offers you, with `call`/`run`, required fields, schemas and the MCP version |
62
+ | `hgi call <tool> --input '<json>'` | run a read-only tool |
63
+ | `hgi run <tool> --input '<json>'` | run a state-changing tool |
64
+ | `hgi skill install` | copy the agent skill to `~/.claude/skills/hgi` |
65
+
66
+ Options for `call`, `run` and `tools list`:
67
+
68
+ - `--input <json>`: a JSON object. `@file.json` reads a file, `-` reads stdin.
69
+ - `-f, --format json|jsonl|csv|yaml|table`: JSON when piped, a table on a terminal. See [output formats](docs/output-formats.md).
70
+ - `--select a,b.c`: keep only those fields.
71
+ - `--out <file>`: write the complete result to a new file.
72
+ - `--meta`: print `{result, credit_cost, mcp_version}`.
73
+ - `--timeout <seconds>`: per-request timeout (default 120).
74
+
75
+ Global: `--base-url`, `--debug` (tokens are always masked), `--json-errors`.
76
+
77
+ The credit cost of each call is printed on stderr after it runs (`credit_cost: 3`). There is no price before the call.
78
+
79
+ ## Using it from an AI coding agent
80
+
81
+ This repository ships a Claude Code skill: [`skills/hgi/SKILL.md`](skills/hgi/SKILL.md), also reachable at `.claude/skills/hgi/` inside this repo. To use it from any project:
82
+
83
+ ```bash
84
+ hgi skill install
85
+ ```
86
+
87
+ Recommended Claude Code permissions: allow lookups, ask for everything else. Put them in your user settings (`~/.claude/settings.json`) or a trusted project's `.claude/settings.json`.
88
+
89
+ ```json
90
+ {
91
+ "permissions": {
92
+ "allow": ["Bash(hgi call *)", "Bash(hgi tools list *)", "Bash(hgi auth whoami)"],
93
+ "ask": ["Bash(hgi run *)"]
94
+ }
95
+ }
96
+ ```
97
+
98
+ **Read [the security notes](docs/security.md) before giving an agent shell access.** A 30-day refresh token is stored in a `0600` file that any program running as you can read. That is an accepted, documented risk.
99
+
100
+ ## Scripts and errors
101
+
102
+ Failures have distinct exit codes and a stable JSON error on stderr; see [exit codes](docs/exit-codes.md).
103
+
104
+ ```bash
105
+ hgi call company_enrich --input '{"domain":"acme.com"}' --select name,employees | jq .
106
+ hgi call search_companies --input '{"query":"saas"}' -f csv --out saas.csv
107
+ ```
108
+
109
+ ## Configuration
110
+
111
+ | Variable | Meaning |
112
+ |---|---|
113
+ | `HGI_BASE_URL` | server origin (default `https://phoenix.hginsights.com`). Credentials are kept per server, so staging and production do not mix |
114
+ | `HGI_DEBUG=1` | same as `--debug` |
115
+ | `BROWSER` | command used to open the sign-in page |
116
+ | `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` | proxy settings |
117
+ | `NODE_EXTRA_CA_CERTS` | extra CA bundle for corporate TLS inspection |
118
+ | `XDG_CONFIG_HOME`, `XDG_CACHE_HOME` | move `~/.config/hgi` and `~/.cache/hgi` |
119
+ | `HGI_CONFIG_DIR`, `HGI_CACHE_DIR` | explicit directories (must not be inside a git working tree) |
120
+
121
+ `hgi` sends the User-Agent `hgi/<version>` and has no telemetry: it talks only to the server you configure, and sends nothing to HG Insights or anyone else about how you use it.
122
+
123
+ ## Compatibility
124
+
125
+ `hgi` builds its command surface from the server's tool list at run time, so server tool changes do not need an `hgi` release. See [docs/compatibility.md](docs/compatibility.md) for the supported MCP protocol versions and what happens when the server drops a tool or capability.
126
+
127
+ ## Development
128
+
129
+ ```bash
130
+ npm ci
131
+ npm run build && npm run check # typecheck, lint, unit + end-to-end tests (e2e needs dist/)
132
+ npm run test:e2e # builds, then runs only the end-to-end suite against a fake server
133
+ bash scripts/verify-allowlist.sh # headless Claude Code: `hgi call *` runs, `hgi run *` is held back
134
+ ```
135
+
136
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
137
+
138
+ ## License
139
+
140
+ MIT. See [LICENSE](LICENSE).