@freeaiforall/kiro-reg 1.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,98 @@
1
+ # kiro-reg
2
+
3
+ Automated AWS Builder ID (Kiro) registration tool with anti-fingerprinting.
4
+
5
+ > **Platform support: macOS Apple Silicon (arm64) only.**
6
+ > Intel Mac and Windows are not supported in this release.
7
+
8
+ ---
9
+
10
+ ## Requirements
11
+
12
+ - macOS on Apple Silicon (M1/M2/M3/M4)
13
+ - Node.js >= 16
14
+ - A local HTTP proxy (e.g. Clash, Surge) running on your machine
15
+
16
+ ---
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install -g @freeaiforall/kiro-reg
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Quick Start
27
+
28
+ ### 1. Initialize config files
29
+
30
+ Run `init` in the directory where you want to store your config:
31
+
32
+ ```bash
33
+ cd ~/my-kiro-workspace
34
+ kiro-reg init
35
+ ```
36
+
37
+ This generates two files if they don't already exist:
38
+
39
+ - `config.toml` — proxy and password settings
40
+ - `emails.txt` — list of emails to register
41
+
42
+ ### 2. Edit `config.toml`
43
+
44
+ ```toml
45
+ # Local HTTP proxy (required — used for WebView and OIDC requests)
46
+ proxy_host = "127.0.0.1"
47
+ proxy_port = "2080"
48
+
49
+ # Password used for all registered accounts
50
+ password = "YourPassword123!"
51
+ ```
52
+
53
+ | Field | Description | Default |
54
+ |--------------|------------------------------|---------------|
55
+ | `proxy_host` | Local HTTP proxy address | `127.0.0.1` |
56
+ | `proxy_port` | Local HTTP proxy port | `2080` |
57
+ | `password` | Password for all accounts | _(empty)_ |
58
+
59
+ > Make sure your proxy is running before launching kiro-reg.
60
+
61
+ ### 3. Edit `emails.txt`
62
+
63
+ One email per line. Lines starting with `#` are ignored.
64
+
65
+ ```
66
+ # emails to register
67
+ user1@example.com
68
+ user2@example.com
69
+ ```
70
+
71
+ ### 4. Run
72
+
73
+ ```bash
74
+ kiro-reg
75
+ ```
76
+
77
+ The tool will:
78
+ 1. Pre-fill the first email from `emails.txt` into the input window
79
+ 2. Auto-fill name and email on the registration page
80
+ 3. Pause at the CAPTCHA step — complete it manually
81
+ 4. Auto-fill the password fields — click "Continue" manually to finish
82
+
83
+ ---
84
+
85
+ ## How it works
86
+
87
+ - Opens a WKWebView window with a fresh browser state (cookies/cache/localStorage cleared on every run)
88
+ - Injects anti-fingerprinting JS to avoid automation detection
89
+ - Uses AWS OIDC device flow to obtain the registration URL
90
+ - Routes through your local HTTP proxy for all network requests
91
+
92
+ ---
93
+
94
+ ## Notes
95
+
96
+ - Always run `kiro-reg` from the directory containing your `config.toml` and `emails.txt`
97
+ - Step 4 (password) requires a manual click to continue — this is intentional
98
+ - Each run registers one account; edit `emails.txt` and re-run for the next one
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * kiro-reg CLI 入口
4
+ * 检测当前平台,找到对应预编译二进制并执行
5
+ */
6
+
7
+ const { execFileSync } = require('child_process');
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+
11
+ const PLATFORMS = {
12
+ 'darwin-arm64': '@freeaiforall/kiro-reg-darwin-arm64',
13
+ 'darwin-x64': '@freeaiforall/kiro-reg-darwin-x64',
14
+ 'win32-x64': '@freeaiforall/kiro-reg-win32-x64',
15
+ };
16
+
17
+ function getBinaryPath() {
18
+ const platform = process.platform; // darwin / win32 / linux
19
+ const arch = process.arch; // arm64 / x64
20
+ const key = `${platform}-${arch}`;
21
+ const pkgName = PLATFORMS[key];
22
+
23
+ if (!pkgName) {
24
+ console.error(`[kiro-reg] 不支持的平台: ${key}`);
25
+ console.error('支持的平台: macOS arm64, macOS x64, Windows x64');
26
+ process.exit(1);
27
+ }
28
+
29
+ // 尝试从 optionalDependencies 子包里找二进制
30
+ try {
31
+ const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
32
+ const binName = platform === 'win32' ? 'kiro-reg.exe' : 'kiro-reg';
33
+ const binPath = path.join(pkgDir, 'bin', binName);
34
+ if (fs.existsSync(binPath)) return binPath;
35
+ } catch (e) {
36
+ // 子包未安装,继续尝试本地路径
37
+ }
38
+
39
+ console.error(`[kiro-reg] 找不到平台二进制 (${key}),请重新安装: npm install -g kiro-reg`);
40
+ process.exit(1);
41
+ }
42
+
43
+ const bin = getBinaryPath();
44
+
45
+ // 把所有 CLI 参数透传给原生二进制
46
+ try {
47
+ execFileSync(bin, process.argv.slice(2), {
48
+ stdio: 'inherit',
49
+ cwd: process.cwd(),
50
+ });
51
+ } catch (e) {
52
+ process.exit(e.status || 1);
53
+ }
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@freeaiforall/kiro-reg",
3
+ "version": "1.0.0",
4
+ "description": "Automated AWS Builder ID (Kiro) registration tool - macOS Apple Silicon (arm64) only",
5
+ "bin": {
6
+ "kiro-reg": "./bin/kiro-reg.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node scripts/postinstall.js"
10
+ },
11
+ "optionalDependencies": {
12
+ "@freeaiforall/kiro-reg-darwin-arm64": "1.0.0"
13
+ },
14
+ "keywords": ["kiro", "aws", "builder-id", "registration", "automation", "cli", "macos"],
15
+ "author": "cn3588",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://gitee.com/llm_xinhai/awsregistool"
20
+ },
21
+ "engines": {
22
+ "node": ">=16"
23
+ }
24
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@freeaiforall/kiro-reg-darwin-arm64",
3
+ "version": "1.0.0",
4
+ "description": "kiro-reg binary for macOS Apple Silicon (arm64)",
5
+ "os": ["darwin"],
6
+ "cpu": ["arm64"],
7
+ "main": "bin/kiro-reg",
8
+ "author": "cn3588",
9
+ "license": "MIT"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@freeaiforall/kiro-reg-darwin-x64",
3
+ "version": "1.0.0",
4
+ "description": "kiro-reg binary for macOS Intel (x64)",
5
+ "os": ["darwin"],
6
+ "cpu": ["x64"],
7
+ "main": "bin/kiro-reg",
8
+ "author": "cn3588",
9
+ "license": "MIT"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@freeaiforall/kiro-reg-win32-x64",
3
+ "version": "1.0.0",
4
+ "description": "kiro-reg binary for Windows x64",
5
+ "os": ["win32"],
6
+ "cpu": ["x64"],
7
+ "main": "bin/kiro-reg.exe",
8
+ "author": "cn3588",
9
+ "license": "MIT"
10
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * postinstall.js
3
+ * npm install 完成后自动验证平台二进制是否可用
4
+ */
5
+
6
+ const path = require('path');
7
+ const fs = require('fs');
8
+
9
+ const PLATFORMS = {
10
+ 'darwin-arm64': '@freeaiforall/kiro-reg-darwin-arm64',
11
+ 'darwin-x64': '@freeaiforall/kiro-reg-darwin-x64',
12
+ 'win32-x64': '@freeaiforall/kiro-reg-win32-x64',
13
+ };
14
+
15
+ const platform = process.platform;
16
+ const arch = process.arch;
17
+ const key = `${platform}-${arch}`;
18
+ const pkgName = PLATFORMS[key];
19
+
20
+ if (!pkgName) {
21
+ console.warn(`[kiro-reg] 警告:不支持的平台 ${key},跳过二进制检查`);
22
+ process.exit(0);
23
+ }
24
+
25
+ try {
26
+ const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
27
+ const binName = platform === 'win32' ? 'kiro-reg.exe' : 'kiro-reg';
28
+ const binPath = path.join(pkgDir, 'bin', binName);
29
+
30
+ if (!fs.existsSync(binPath)) {
31
+ console.error(`[kiro-reg] 二进制文件不存在: ${binPath}`);
32
+ process.exit(1);
33
+ }
34
+
35
+ // macOS/Linux 确保可执行权限
36
+ if (platform !== 'win32') {
37
+ fs.chmodSync(binPath, 0o755);
38
+ }
39
+
40
+ console.log(`[kiro-reg] ✓ 安装成功 (${key})`);
41
+ console.log(`[kiro-reg] 运行 'kiro-reg' 开始使用`);
42
+ } catch (e) {
43
+ console.warn(`[kiro-reg] 警告:平台子包 ${pkgName} 未找到,可能不支持当前平台`);
44
+ }