Skip to content

Commit 7559136

Browse files
committed
feat: inngest CLI — complete rewrite from Xero to Inngest
- Full CLI for Inngest Cloud and local dev server - Commands: auth, functions, runs, events, env, dev, health, metrics, backlog, config, version - GraphQL + REST API client with signing key and event key auth - JSON/text/table output formats - Module: github.com/Coastal-Programs/inggest-cli - 2 dependencies (cobra, pflag), stdlib for everything else - Tests across all packages
1 parent 77d559c commit 7559136

94 files changed

Lines changed: 13213 additions & 4905 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/test.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ go test -race -v ./... 2>&1
1414
If all tests pass, report success and stop.
1515

1616
If there are failures, parse the output and group by package:
17-
- `internal/auth` — OAuth flow, PKCE, proxy logic
18-
- `internal/xero` — API client, pagination, rate limiting
17+
- `internal/inngest` — API client, GraphQL, REST, dev server
1918
- `internal/cli/commands` — command behaviour
2019
- `internal/common/config` — config load/save/resolve
2120
- `pkg/output` — formatter output

.claude/commands/update-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Fix all errors before continuing.
3838

3939
```bash
4040
make build
41-
./build/xero version
41+
./build/inngest version
4242
```
4343

4444
Confirm the binary builds and runs cleanly with zero warnings.

.claude/rules/go.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ paths:
1111

1212
## HTTP
1313
- Always set an explicit timeout — never use `http.DefaultClient` bare
14-
- Auth layer uses `authHTTPClient` (15s timeout) — don't create new clients in auth code
15-
- Xero API layer uses the shared transport in `internal/xero/client.go`
14+
- Inngest API layer uses the shared transport in `internal/inngest/client.go`
1615

1716
## URLs
1817
- Query params: always `url.Values{}` and `.Encode()` — never string concatenation
@@ -23,13 +22,14 @@ paths:
2322
- Errors always go to stderr via `output.PrintError(msg, err)`
2423
- Respect the `--output` flag — never hard-code a format inside a command
2524

26-
## Xero API
27-
- Xero pagination is 1-indexed — never pass `page=0` to the API
28-
- `page=0` in CLI flags means auto-paginate: loop until a batch returns < 100 records
29-
- 429 rate limit handling lives in `client.go` — don't add retry logic elsewhere
25+
## Inngest API
26+
- GraphQL API at `api.inngest.com/gql` — used for functions, runs, environments, metrics
27+
- REST API at `api.inngest.com/v1/` — used for sending events
28+
- Dev server at `localhost:8288` — no auth required
29+
- Three auth modes: signing key (GraphQL/REST), event key (events), no auth (dev server)
3030

3131
## Adding a New Command
32-
1. `internal/xero/<resource>.go` — API client methods
32+
1. `internal/inngest/<resource>.go` — API client methods (or add to `client.go`)
3333
2. `internal/cli/commands/<resource>.go` — Cobra command(s)
3434
3. Register in `internal/cli/root.go`
3535
4. Add to Commands section of `README.md`

.claude/rules/release.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ Example:
5454
This release adds budget reporting commands and improves error messages across all commands.
5555

5656
### Added
57-
- `xero reports budget-summary`compare actuals vs budget by org
58-
- `xero reports budget-variance`line-by-line variance report
57+
- `inngest runs replay`replay a function run
58+
- `inngest backlog`show queued and running runs per function
5959

6060
### Fixed
61-
- Auth refresh no longer silently fails when instance_token is missing
61+
- GraphQL cursor pagination no longer skips the last page
6262
```
6363

6464
### Steps
@@ -70,3 +70,5 @@ This release adds budget reporting commands and improves error messages across a
7070
GitHub Actions extracts the CHANGELOG entry and uses it as the release description, then builds 5 platform binaries automatically.
7171

7272
> Never push a tag without a well-written CHANGELOG entry first.
73+
ry first.
74+
try first.

.claude/rules/security.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# Security Rules
22

3-
## Tokens and Secrets
4-
- Never log or print raw tokens — use `config.Redacted()` or the `redact()` helper
5-
- `client_secret` must NEVER appear in the CLI binary, config file, or logs
6-
- It lives exclusively in the Cloudflare Worker as a Cloudflare secret
3+
## Keys and Secrets
4+
- Never log or print raw signing keys or event keys — use redaction helpers
5+
- Signing key (`INNGEST_SIGNING_KEY`) and event key (`INNGEST_EVENT_KEY`) can come from env vars or config file
6+
- Env vars take precedence over config file values
77

88
## Config File
99
- Always written with `0600` permissions — do not change this
10-
- `XERO_CONFIG` env var is validated: must be absolute path, end in `.json`, no `..` — do not relax this validation
11-
12-
## Auth Proxy
13-
- `/init-session` is protected by `ZEUS_ADMIN_SECRET` — only the Zeus Electron app holds this
14-
- `instance_token` must be validated on every `/refresh` call — proves the CLI was authorised through Zeus
15-
- Session tokens are single-use — consumed (deleted from KV) on first use
16-
- Admin secret comparison uses `crypto.subtle.timingSafeEqual` — never use `===` for secret comparison
10+
- `INNGEST_CLI_CONFIG` env var overrides the default path
1711

1812
## HTTP
1913
- All HTTP clients must have explicit timeouts — no bare `http.DefaultClient`
20-
- Error response bodies are truncated to 300 chars before logging — never log full upstream error bodies
14+
- Error response bodies are truncated before logging — never log full upstream error bodies

.claude/rules/worker.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A clear description of what went wrong.
99

1010
**Command run**
1111
```
12-
xero <command> <flags>
12+
inngest <command> <flags>
1313
```
1414

1515
**Expected behaviour**
@@ -22,5 +22,5 @@ paste output here
2222

2323
**Environment**
2424
- OS:
25-
- `xero version`:
25+
- `inngest version`:
2626
- Go version (if built from source):

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ What problem does this solve?
1212

1313
**Example command**
1414
```bash
15-
xero <proposed command>
15+
inngest <proposed command>
1616
```

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ jobs:
3232
echo "EOF" >> $GITHUB_OUTPUT
3333
3434
- name: Build release binaries
35-
env:
36-
CLIENT_ID: ${{ secrets.XERO_CLIENT_ID }}
37-
PROXY_URL: ${{ secrets.PROXY_URL }}
3835
run: |
3936
chmod +x scripts/release.sh
4037
./scripts/release.sh ${{ github.ref_name }}

.gitignore

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Build artifacts
22
/build/
33
/dist/
4-
/xero
5-
/xero.exe
4+
/inngest
5+
/inngest.exe
66
*.exe
77
*.dll
88
*.so
99
*.dylib
1010

1111
# Test artifacts
1212
*.test
13+
cover.out
1314
coverage.out
1415
coverage.html
1516

@@ -18,13 +19,8 @@ go.work
1819
go.work.sum
1920
vendor/
2021

21-
# Worker
22-
worker/node_modules/
23-
worker/package-lock.json
24-
25-
# Config files (may contain OAuth tokens and client secrets)
22+
# Config files
2623
config.json
27-
.xero.json
2824
*.local.json
2925

3026
# IDE

0 commit comments

Comments
 (0)