@zeko-labs/faucet-cli 0.0.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/README.md ADDED
@@ -0,0 +1,168 @@
1
+ # Faucet CLI
2
+
3
+ > **Public mirror** — This repository is automatically synced from a private monorepo. Development happens in the monorepo; this repo is a read-only source mirror. See [zeko-labs/faucet-cli](https://github.com/zeko-labs/faucet-cli) for issues and releases.
4
+
5
+ Command-line client for the Zeko testnet faucet. Claim testnet tokens and verify your GitHub authentication from the terminal.
6
+
7
+ Written in Rust for fast startup and single-binary distribution. Distributed via npm with platform-specific packages.
8
+
9
+ ## Installation
10
+
11
+ Install globally:
12
+
13
+ ```bash
14
+ npm install -g @zeko-labs/faucet-cli
15
+ ```
16
+
17
+ Or run without installing via `npx`:
18
+
19
+ ```bash
20
+ npx @zeko-labs/faucet-cli whoami
21
+ ```
22
+
23
+ ### Supported platforms
24
+
25
+ | Platform | Package |
26
+ | ------------- | ------------------------------------ |
27
+ | macOS arm64 | `@zeko-labs/faucet-cli-darwin-arm64` |
28
+ | macOS x64 | `@zeko-labs/faucet-cli-darwin-x64` |
29
+ | Linux x64 | `@zeko-labs/faucet-cli-linux-x64` |
30
+ | Linux arm64 | `@zeko-labs/faucet-cli-linux-arm64` |
31
+ | Windows x64 | `@zeko-labs/faucet-cli-win32-x64` |
32
+ | Windows arm64 | `@zeko-labs/faucet-cli-win32-arm64` |
33
+
34
+ The correct platform package is installed automatically via `optionalDependencies`.
35
+
36
+ ## Authentication
37
+
38
+ Every command requires a **GitHub personal access token** (classic or fine-grained).
39
+ The CLI resolves the token in this order:
40
+
41
+ 1. `--token <value>` flag (highest priority)
42
+ 2. `GITHUB_TOKEN` environment variable
43
+
44
+ ```bash
45
+ # Using the flag
46
+ zeko-faucet whoami --token ghp_xxx
47
+
48
+ # Using the environment variable
49
+ export GITHUB_TOKEN=ghp_xxx
50
+ zeko-faucet whoami
51
+ ```
52
+
53
+ ## Commands
54
+
55
+ ### `whoami`
56
+
57
+ Verify your GitHub token and display the associated account.
58
+
59
+ ```bash
60
+ zeko-faucet whoami
61
+ zeko-faucet whoami --token ghp_xxx
62
+ zeko-faucet whoami --json
63
+ ```
64
+
65
+ **Example output:**
66
+
67
+ ```
68
+ Authenticated as octocat (#1).
69
+ Name: The Octocat
70
+ Profile: https://github.com/octocat
71
+ Created: 2011-01-25T18:44:36Z
72
+ Token source: env
73
+ ```
74
+
75
+ ### `claim <address>`
76
+
77
+ Submit a faucet claim for the given Mina address on the `zeko-testnet` chain.
78
+
79
+ ```bash
80
+ zeko-faucet claim B62qexample
81
+ zeko-faucet claim B62qexample --token ghp_xxx
82
+ zeko-faucet claim B62qexample --json
83
+ ```
84
+
85
+ **Example output:**
86
+
87
+ ```
88
+ Claim submitted for B62qexample.
89
+ Chain: zeko-testnet
90
+ Amount: 100
91
+ Transaction: 5Jtxxx
92
+ Explorer: https://zekoscan.io/devnet/tx/5Jtxxx
93
+ ```
94
+
95
+ ## Global Flags
96
+
97
+ | Flag | Description |
98
+ | --------- | ------------------------------------------------------- |
99
+ | `--token` | GitHub personal access token (overrides `GITHUB_TOKEN`) |
100
+ | `--json` | Emit machine-readable JSON instead of human text |
101
+
102
+ ## Exit Codes
103
+
104
+ | Code | Meaning |
105
+ | ---- | -------------------- |
106
+ | `0` | Success |
107
+ | `1` | General error |
108
+ | `2` | Authentication error |
109
+ | `3` | Rate limited |
110
+ | `4` | Invalid address |
111
+
112
+ Scripts and CI pipelines can use exit codes to branch on specific failure types:
113
+
114
+ ```bash
115
+ zeko-faucet claim B62qexample
116
+ case $? in
117
+ 0) echo "Claim succeeded" ;;
118
+ 2) echo "Bad token — check GITHUB_TOKEN" ;;
119
+ 3) echo "Rate limited — try again later" ;;
120
+ 4) echo "Invalid Mina address" ;;
121
+ *) echo "Something went wrong" ;;
122
+ esac
123
+ ```
124
+
125
+ ## JSON Mode
126
+
127
+ Pass `--json` to any command for machine-readable output suitable for piping into `jq` or other tools.
128
+
129
+ **Success:**
130
+
131
+ ```json
132
+ {
133
+ "success": true,
134
+ "address": "B62qexample",
135
+ "chain": "zeko-testnet",
136
+ "amount": "100",
137
+ "hash": "5Jtxxx",
138
+ "explorer_url": "https://zekoscan.io/devnet/tx/5Jtxxx"
139
+ }
140
+ ```
141
+
142
+ **Error:**
143
+
144
+ ```json
145
+ {
146
+ "success": false,
147
+ "code": "rate_limited",
148
+ "message": "You have already claimed tokens recently."
149
+ }
150
+ ```
151
+
152
+ ## Development
153
+
154
+ Requires [Rust](https://rustup.rs/) and [pnpm](https://pnpm.io/).
155
+
156
+ ```bash
157
+ # Build
158
+ moon faucet-cli:build
159
+
160
+ # Run integration tests
161
+ moon faucet-cli:test
162
+
163
+ # Lint
164
+ moon faucet-cli:lint
165
+
166
+ # Check (fast compile check)
167
+ moon faucet-cli:check
168
+ ```
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from "node:child_process"
4
+ import { createRequire } from "node:module"
5
+
6
+ const require = createRequire(import.meta.url)
7
+ const platformKey = `${process.platform}-${process.arch}`
8
+ const ext = process.platform === "win32" ? ".exe" : ""
9
+
10
+ let binPath
11
+ try {
12
+ binPath = require.resolve(`@zeko-labs/faucet-cli-${platformKey}/bin/zeko-faucet${ext}`)
13
+ } catch {
14
+ console.error(
15
+ `@zeko-labs/faucet-cli does not support ${process.platform}-${process.arch}. ` +
16
+ "Please open an issue at https://github.com/nicekind/zeko-ui/issues"
17
+ )
18
+ process.exit(1)
19
+ }
20
+
21
+ try {
22
+ execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" })
23
+ } catch (e) {
24
+ process.exit(e.status ?? 1)
25
+ }
@@ -0,0 +1,3 @@
1
+ # @zeko-labs/faucet-cli-darwin-arm64
2
+
3
+ ## 0.1.1
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli-darwin-arm64",
3
+ "version": "0.0.0",
4
+ "description": "Darwin arm64 binary for @zeko-labs/faucet-cli",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "os": [
10
+ "darwin"
11
+ ],
12
+ "cpu": [
13
+ "arm64"
14
+ ],
15
+ "files": [
16
+ "bin"
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ # @zeko-labs/faucet-cli-darwin-x64
2
+
3
+ ## 0.1.1
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli-darwin-x64",
3
+ "version": "0.0.0",
4
+ "description": "Darwin x64 binary for @zeko-labs/faucet-cli",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "os": [
10
+ "darwin"
11
+ ],
12
+ "cpu": [
13
+ "x64"
14
+ ],
15
+ "files": [
16
+ "bin"
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ # @zeko-labs/faucet-cli-linux-arm64
2
+
3
+ ## 0.1.1
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli-linux-arm64",
3
+ "version": "0.0.0",
4
+ "description": "Linux arm64 binary for @zeko-labs/faucet-cli",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "os": [
10
+ "linux"
11
+ ],
12
+ "cpu": [
13
+ "arm64"
14
+ ],
15
+ "files": [
16
+ "bin"
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ # @zeko-labs/faucet-cli-linux-x64
2
+
3
+ ## 0.1.1
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli-linux-x64",
3
+ "version": "0.0.0",
4
+ "description": "Linux x64 binary for @zeko-labs/faucet-cli",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "os": [
10
+ "linux"
11
+ ],
12
+ "cpu": [
13
+ "x64"
14
+ ],
15
+ "files": [
16
+ "bin"
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ # @zeko-labs/faucet-cli-win32-arm64
2
+
3
+ ## 0.1.1
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli-win32-arm64",
3
+ "version": "0.0.0",
4
+ "description": "Windows arm64 binary for @zeko-labs/faucet-cli",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "os": [
10
+ "win32"
11
+ ],
12
+ "cpu": [
13
+ "arm64"
14
+ ],
15
+ "files": [
16
+ "bin"
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ # @zeko-labs/faucet-cli-win32-x64
2
+
3
+ ## 0.1.1
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli-win32-x64",
3
+ "version": "0.0.0",
4
+ "description": "Windows x64 binary for @zeko-labs/faucet-cli",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "os": [
10
+ "win32"
11
+ ],
12
+ "cpu": [
13
+ "x64"
14
+ ],
15
+ "files": [
16
+ "bin"
17
+ ]
18
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@zeko-labs/faucet-cli",
3
+ "version": "0.0.0",
4
+ "description": "Public CLI for claiming Zeko testnet faucet funds and verifying GitHub authentication.",
5
+ "type": "module",
6
+ "keywords": [
7
+ "zeko",
8
+ "faucet",
9
+ "cli",
10
+ "rust"
11
+ ],
12
+ "license": "MIT",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "files": [
17
+ "bin",
18
+ "npm"
19
+ ],
20
+ "bin": {
21
+ "zeko-faucet": "./bin/zeko-faucet.js"
22
+ },
23
+ "optionalDependencies": {
24
+ "@zeko-labs/faucet-cli-linux-x64": "0.0.0",
25
+ "@zeko-labs/faucet-cli-linux-arm64": "0.0.0",
26
+ "@zeko-labs/faucet-cli-darwin-arm64": "0.0.0",
27
+ "@zeko-labs/faucet-cli-win32-x64": "0.0.0",
28
+ "@zeko-labs/faucet-cli-darwin-x64": "0.0.0",
29
+ "@zeko-labs/faucet-cli-win32-arm64": "0.0.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^20.8.10",
33
+ "vitest": "3.2.4"
34
+ }
35
+ }