@ghx-dev/core 0.4.2 → 0.4.4
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/.claude-plugin/plugin.json +1 -1
- package/.cursor-plugin/hooks/hooks.json +9 -0
- package/.cursor-plugin/plugin.json +25 -0
- package/.cursor-plugin/rules/ghx-batching.mdc +16 -0
- package/.cursor-plugin/rules/ghx-capabilities.mdc +12 -0
- package/.cursor-plugin/rules/prefer-ghx.mdc +14 -0
- package/README.md +25 -6
- package/dist/{chunk-EJZDHUZK.js → chunk-XZRNTOTE.js} +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/hooks/hooks.json +2 -1
- package/package.json +2 -1
- package/scripts/plugin/setup-env.sh +0 -6
- /package/dist/{chunk-EJZDHUZK.js.map → chunk-XZRNTOTE.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ghx",
|
|
3
3
|
"description": "Route GitHub operations through deterministic adapters instead of fragile shell scraping. 70+ capabilities covering issues, PRs, repos, releases, and projects — each with validated input, normalized output, and automatic fallback routing.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Arye Kogan"
|
|
7
7
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ghx",
|
|
3
|
+
"description": "Route GitHub operations through deterministic adapters instead of fragile shell scraping. 70+ capabilities covering issues, PRs, repos, releases, and projects — each with validated input, normalized output, and automatic fallback routing.",
|
|
4
|
+
"version": "0.4.4",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Arye Kogan"
|
|
7
|
+
},
|
|
8
|
+
"category": "development",
|
|
9
|
+
"repository": "https://github.com/aryeko/ghx",
|
|
10
|
+
"homepage": "https://github.com/aryeko/ghx",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"github",
|
|
14
|
+
"github-api",
|
|
15
|
+
"ai-agents",
|
|
16
|
+
"agentic",
|
|
17
|
+
"cli",
|
|
18
|
+
"graphql",
|
|
19
|
+
"automation",
|
|
20
|
+
"typescript"
|
|
21
|
+
],
|
|
22
|
+
"logo": "https://raw.githubusercontent.com/aryeko/ghx/main/assets/branding/logos/ghx-logo-icon.svg",
|
|
23
|
+
"skills": "../skills/",
|
|
24
|
+
"rules": "rules/"
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use ghx chain to batch multiple GitHub operations into a single API call
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
When performing 2+ GitHub operations, use `ghx chain` with a JSON array of steps instead of sequential `ghx run` calls. This batches operations into fewer API round-trips.
|
|
7
|
+
|
|
8
|
+
Example:
|
|
9
|
+
```bash
|
|
10
|
+
ghx chain --steps - <<'EOF'
|
|
11
|
+
[
|
|
12
|
+
{"task":"pr.view","input":{"owner":"org","name":"repo","number":123}},
|
|
13
|
+
{"task":"pr.reviews.list","input":{"owner":"org","name":"repo","number":123}}
|
|
14
|
+
]
|
|
15
|
+
EOF
|
|
16
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Check ghx capabilities before attempting raw GitHub API calls
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Before writing custom `gh api` or curl commands, run `ghx capabilities list` or `ghx capabilities explain <id>` to check if ghx already supports the operation. ghx covers 70+ capabilities across issues, PRs, repos, releases, workflows, and projects.
|
|
7
|
+
|
|
8
|
+
Example:
|
|
9
|
+
```bash
|
|
10
|
+
ghx capabilities list --domain pr
|
|
11
|
+
ghx capabilities explain pr.merge
|
|
12
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Prefer ghx CLI over raw gh, gh api, or curl for GitHub operations
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
When performing any GitHub operation (PRs, issues, reviews, CI checks, releases, labels, comments), use `ghx run` instead of `gh`, `gh api`, or `curl`. ghx provides validated input, structured JSON output, and automatic fallback routing. Always pass `--input` via stdin heredoc to avoid shell quoting issues.
|
|
7
|
+
|
|
8
|
+
Example:
|
|
9
|
+
```bash
|
|
10
|
+
# Instead of: gh pr view 123 --json title,state
|
|
11
|
+
ghx run pr.view --input - <<'EOF'
|
|
12
|
+
{"owner":"org","name":"repo","number":123}
|
|
13
|
+
EOF
|
|
14
|
+
```
|
package/README.md
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
When AI agents use the `gh` CLI directly, they waste thousands of tokens on research, trial-and-error formatting, and guessing JSON parsing paths. **ghx eliminates this waste** by providing a stable, structured execution layer.
|
|
20
20
|
|
|
21
21
|
> **100% success rate, 73% fewer tool calls, 18% fewer active tokens, 54% lower latency** compared to raw CLI usage ([measured across 30 runs](https://github.com/aryeko/ghx/blob/main/docs/eval-report.md) on standard PR workflows with Codex 5.3).
|
|
22
|
+
>
|
|
23
|
+
> Read the full motivation: [AI Agents Shouldn't Relearn GitHub on Every Run](https://plainenglish.io/artificial-intelligence/ai-agents-shouldn-t-relearn-github-on-every-run)
|
|
22
24
|
|
|
23
25
|
```mermaid
|
|
24
26
|
sequenceDiagram
|
|
@@ -59,12 +61,22 @@ Comprehensive documentation is available in the [`docs/`](./docs/) directory:
|
|
|
59
61
|
- **[Architecture](./docs/architecture/README.md)** — System design, execution pipeline, formatters, and GraphQL layer.
|
|
60
62
|
- **[Reference](./docs/reference/README.md)** — API exports, error codes, and a complete table of all 70+ capabilities.
|
|
61
63
|
|
|
62
|
-
##
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm i -g @ghx-dev/core
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This makes the `ghx` CLI available in your PATH. Then wire it into your agent (see [Agent Integration](#agent-integration) below).
|
|
71
|
+
|
|
72
|
+
For library usage (TypeScript imports), install as a project dependency instead:
|
|
63
73
|
|
|
64
74
|
```bash
|
|
65
75
|
npm install @ghx-dev/core
|
|
66
76
|
```
|
|
67
77
|
|
|
78
|
+
## Quick Start (Library)
|
|
79
|
+
|
|
68
80
|
```ts
|
|
69
81
|
import { createGithubClientFromToken, executeTask } from "@ghx-dev/core"
|
|
70
82
|
|
|
@@ -92,10 +104,10 @@ Use ghx directly from your terminal or add it as an agent skill.
|
|
|
92
104
|
|
|
93
105
|
```bash
|
|
94
106
|
# List all 70+ capabilities
|
|
95
|
-
|
|
107
|
+
ghx capabilities list
|
|
96
108
|
|
|
97
109
|
# Run a capability
|
|
98
|
-
|
|
110
|
+
ghx run pr.view --input '{"owner":"aryeko","name":"ghx","prNumber":42}'
|
|
99
111
|
|
|
100
112
|
# Output is a standard ResultEnvelope:
|
|
101
113
|
# {
|
|
@@ -107,13 +119,20 @@ npx @ghx-dev/core run pr.view --input '{"owner":"aryeko","name":"ghx","number":4
|
|
|
107
119
|
|
|
108
120
|
## Agent Integration
|
|
109
121
|
|
|
110
|
-
|
|
122
|
+
**Claude Code** -- install from the plugin marketplace:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
/plugin marketplace add aryeko/ghx
|
|
126
|
+
/plugin install ghx@ghx-dev
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Cursor, Windsurf, Codex, other agents** -- install the skill:
|
|
111
130
|
|
|
112
131
|
```bash
|
|
113
|
-
|
|
132
|
+
ghx setup --scope user --yes
|
|
114
133
|
```
|
|
115
134
|
|
|
116
|
-
This
|
|
135
|
+
This writes `SKILL.md` to `~/.agents/skills/using-ghx/` which teaches your agent how to use `ghx` for reliable GitHub interactions. See [Agent Setup](./docs/getting-started/agent-setup.md) for platform-specific wiring.
|
|
117
136
|
|
|
118
137
|
## License
|
|
119
138
|
|
|
@@ -833,7 +833,7 @@ function createLogger(config) {
|
|
|
833
833
|
}
|
|
834
834
|
function write(level, msg, ctx) {
|
|
835
835
|
if (levelIndex(level) < minIndex) return;
|
|
836
|
-
const version = true ? "0.4.
|
|
836
|
+
const version = true ? "0.4.4" : "unknown";
|
|
837
837
|
const entry = {
|
|
838
838
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
839
839
|
pid: config.pid,
|
|
@@ -6219,4 +6219,4 @@ export {
|
|
|
6219
6219
|
createGithubClientFromToken,
|
|
6220
6220
|
createGithubClient
|
|
6221
6221
|
};
|
|
6222
|
-
//# sourceMappingURL=chunk-
|
|
6222
|
+
//# sourceMappingURL=chunk-XZRNTOTE.js.map
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/hooks/hooks.json
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
"hooks": {
|
|
3
3
|
"SessionStart": [
|
|
4
4
|
{
|
|
5
|
+
"matcher": "startup",
|
|
5
6
|
"hooks": [
|
|
6
7
|
{
|
|
7
8
|
"type": "command",
|
|
8
|
-
"command": "
|
|
9
|
+
"command": "command -v ghx >/dev/null 2>&1 || printf '{\"systemMessage\": \"Warning: ghx CLI is not installed — ghx plugin capabilities disabled. Run: npm install -g @ghx-dev/core\"}'"
|
|
9
10
|
}
|
|
10
11
|
]
|
|
11
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghx-dev/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Route GitHub operations through deterministic adapters instead of fragile shell scraping. 70+ capabilities covering issues, PRs, repos, releases, and projects — each with validated input, normalized output, and automatic fallback routing.",
|
|
5
5
|
"author": "Arye Kogan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"hooks",
|
|
48
48
|
"scripts/plugin",
|
|
49
49
|
".claude-plugin",
|
|
50
|
+
".cursor-plugin",
|
|
50
51
|
"skills",
|
|
51
52
|
"LICENSE",
|
|
52
53
|
"README.md"
|
|
File without changes
|