creatorverse-cli 0.0.0-stage → 1.0.3
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 +97 -2
- package/bin/creatorverse +7 -0
- package/bin/creatorverse-admin +7 -0
- package/bin/creatorverse-admin.cmd +16 -0
- package/bin/creatorverse-admin.ps1 +8 -0
- package/bin/creatorverse.cmd +16 -0
- package/bin/creatorverse.ps1 +8 -0
- package/dist/creatorverse-admin.d.ts +63 -0
- package/dist/creatorverse-admin.d.ts.map +1 -0
- package/dist/creatorverse-admin.js +684 -0
- package/dist/creatorverse-admin.js.map +1 -0
- package/dist/creatorverse.d.ts +41 -0
- package/dist/creatorverse.d.ts.map +1 -0
- package/dist/creatorverse.js +464 -0
- package/dist/creatorverse.js.map +1 -0
- package/dist/credentialManager.d.ts +12 -0
- package/dist/credentialManager.d.ts.map +1 -0
- package/dist/credentialManager.js +96 -0
- package/dist/credentialManager.js.map +1 -0
- package/dist/loopbackListener.d.ts +17 -0
- package/dist/loopbackListener.d.ts.map +1 -0
- package/dist/loopbackListener.js +161 -0
- package/dist/loopbackListener.js.map +1 -0
- package/package.json +29 -4
package/README.md
CHANGED
|
@@ -1,3 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CreatorVerse Network CLI (`creatorverse-cli`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official Command-Line Interface for the **CreatorVerse Network**.
|
|
4
|
+
|
|
5
|
+
This package provides two dedicated CLI executables:
|
|
6
|
+
1. `creatorverse` — Registered User CLI for browsing channels, verifying identity, and accessing creator tools.
|
|
7
|
+
2. `creatorverse-admin` — Administrative CLI with strictly enforced Multi-Factor Authentication (TOTP), role-based privilege checks, device binding, and encrypted credential storage.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. System Requirements
|
|
12
|
+
|
|
13
|
+
- **Node.js**: `>= 18.0.0`
|
|
14
|
+
- **Supported Operating Systems**:
|
|
15
|
+
- Windows 10/11 (CMD & PowerShell)
|
|
16
|
+
- macOS 12+ (Terminal / zsh / bash)
|
|
17
|
+
- Linux (Ubuntu, Debian, Fedora, Arch, CentOS)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. Installation & Setup
|
|
22
|
+
|
|
23
|
+
### Local / Staging Installation (Recommended for Development)
|
|
24
|
+
```bash
|
|
25
|
+
# Build the distributable artifacts
|
|
26
|
+
cd cli
|
|
27
|
+
npm run build
|
|
28
|
+
|
|
29
|
+
# Install globally from the local archive
|
|
30
|
+
npm pack
|
|
31
|
+
npm install -g ./creatorverse-cli-1.0.0.tgz
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Verification
|
|
35
|
+
```bash
|
|
36
|
+
creatorverse --version
|
|
37
|
+
creatorverse-admin --version
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Upgrading
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g ./creatorverse-cli-1.0.1.tgz
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Removal
|
|
46
|
+
```bash
|
|
47
|
+
npm uninstall -g creatorverse-cli
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 3. User CLI (`creatorverse`) Commands
|
|
53
|
+
|
|
54
|
+
### Interactive Browser Login (PKCE)
|
|
55
|
+
```bash
|
|
56
|
+
creatorverse login --browser --api-url https://api.creatorverse.network
|
|
57
|
+
```
|
|
58
|
+
1. Initiates an ephemeral loopback listener on `127.0.0.1:<random-port>`.
|
|
59
|
+
2. Directs your browser to complete Firebase Authentication.
|
|
60
|
+
3. Automatically exchanges the single-use ticket via SHA-256 PKCE.
|
|
61
|
+
4. Stores encrypted credentials in `~/.creatorverse/auth-secure.enc`.
|
|
62
|
+
|
|
63
|
+
### Offline Sandbox Mode
|
|
64
|
+
```bash
|
|
65
|
+
creatorverse login --offline
|
|
66
|
+
creatorverse whoami
|
|
67
|
+
creatorverse channels
|
|
68
|
+
creatorverse logout
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 4. Admin CLI (`creatorverse-admin`) Commands
|
|
74
|
+
|
|
75
|
+
### Interactive Administrator Login (Browser + TOTP MFA)
|
|
76
|
+
```bash
|
|
77
|
+
creatorverse-admin login --browser --api-url https://api.creatorverse.network --device-id my-workstation-01
|
|
78
|
+
```
|
|
79
|
+
1. Directs to the secure administrator verification portal.
|
|
80
|
+
2. Validates Platform Owner claims and requests mandatory 6-digit TOTP MFA.
|
|
81
|
+
3. Issues a 30-minute administrative session backed by server-authoritative Firestore records.
|
|
82
|
+
|
|
83
|
+
### Inspect Server Identity & RBAC Matrix
|
|
84
|
+
```bash
|
|
85
|
+
creatorverse-admin whoami
|
|
86
|
+
creatorverse-admin permissions
|
|
87
|
+
creatorverse-admin audit-logs
|
|
88
|
+
creatorverse-admin logout
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 5. Security & Vault Architecture
|
|
94
|
+
|
|
95
|
+
- **Credential Encryption**: All session tokens and credentials are encrypted using **AES-256-GCM** with an HKDF-derived key bound to workstation-specific entropy.
|
|
96
|
+
- **POSIX Permissions**: Vault files are created with strict `0o600` permissions (user read/write only) within `~/.creatorverse/`.
|
|
97
|
+
- **Zero Token Leakage**: Tokens, secrets, and passwords are automatically redacted (`[REDACTED]`) from terminal outputs and error traces.
|
|
98
|
+
- **Fail-Closed Networking**: AbortController enforcement guarantees immediate fail-closed termination upon network timeout (5000ms default) or unreachable services.
|
package/bin/creatorverse
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@ECHO off
|
|
2
|
+
GOTO start
|
|
3
|
+
:find_dp0
|
|
4
|
+
SET dp0=%~dp0
|
|
5
|
+
EXIT /b
|
|
6
|
+
:start
|
|
7
|
+
SETLOCAL
|
|
8
|
+
CALL :find_dp0
|
|
9
|
+
|
|
10
|
+
IF EXIST "%dp0%..\dist\creatorverse-admin.js" (
|
|
11
|
+
SET "_prog=%dp0%..\dist\creatorverse-admin.js"
|
|
12
|
+
) ELSE (
|
|
13
|
+
SET "_prog=%dp0%creatorverse-admin.js"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
endLocal & node "%_prog%" %*
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
3
|
+
$distPath = Join-Path $scriptDir "..\dist\creatorverse-admin.js"
|
|
4
|
+
if (-Not (Test-Path $distPath)) {
|
|
5
|
+
$distPath = Join-Path $scriptDir "creatorverse-admin.js"
|
|
6
|
+
}
|
|
7
|
+
& node "$distPath" $args
|
|
8
|
+
exit $LASTEXITCODE
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@ECHO off
|
|
2
|
+
GOTO start
|
|
3
|
+
:find_dp0
|
|
4
|
+
SET dp0=%~dp0
|
|
5
|
+
EXIT /b
|
|
6
|
+
:start
|
|
7
|
+
SETLOCAL
|
|
8
|
+
CALL :find_dp0
|
|
9
|
+
|
|
10
|
+
IF EXIST "%dp0%..\dist\creatorverse.js" (
|
|
11
|
+
SET "_prog=%dp0%..\dist\creatorverse.js"
|
|
12
|
+
) ELSE (
|
|
13
|
+
SET "_prog=%dp0%creatorverse.js"
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
endLocal & node "%_prog%" %*
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
3
|
+
$distPath = Join-Path $scriptDir "..\dist\creatorverse.js"
|
|
4
|
+
if (-Not (Test-Path $distPath)) {
|
|
5
|
+
$distPath = Join-Path $scriptDir "creatorverse.js"
|
|
6
|
+
}
|
|
7
|
+
& node "$distPath" $args
|
|
8
|
+
exit $LASTEXITCODE
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CreatorVerse Admin CLI — Stage E1.2 & E1.3 Controlled Admin CLI Integration
|
|
4
|
+
*
|
|
5
|
+
* Secure Administrative Command-Line Interface connecting to:
|
|
6
|
+
* - /api/admin/cli-session (POST)
|
|
7
|
+
* - /api/admin/cli-session/verify (GET)
|
|
8
|
+
* - /api/admin/cli-session/revoke (POST)
|
|
9
|
+
* - /api/admin/cli-session/audit-logs (GET)
|
|
10
|
+
* - /api/cli/auth/exchange (POST)
|
|
11
|
+
*
|
|
12
|
+
* Security Guardrails:
|
|
13
|
+
* 1. ADMIN_CLI_PRODUCTION_ENABLED = false: Disables live production execution pending verified browser auth.
|
|
14
|
+
* 2. Mandatory MFA interactive masking / Browser MFA: TOTP codes are entered privately without exposure in shell history, argv, or process listings.
|
|
15
|
+
* 3. Server-authoritative privilege checks: Local tokens/roles/permissions are never trusted; backend enforces RBAC, device binding, and revocation.
|
|
16
|
+
* 4. AES-256-GCM encrypted credential vault with strict 0o600 file / 0o700 directory permissions.
|
|
17
|
+
* 5. Safe network timeouts (5000ms AbortController) and fail-closed handling on network or authentication failure.
|
|
18
|
+
* 6. Total isolation between production and offline test mode (retaining 100% backward compatibility for existing suites).
|
|
19
|
+
*/
|
|
20
|
+
export declare const VERSION = "1.0.3";
|
|
21
|
+
export declare const CONFIG_DIR: string;
|
|
22
|
+
export declare const ADMIN_CONFIG_FILE: string;
|
|
23
|
+
export declare const ADMIN_CLI_PRODUCTION_ENABLED = false;
|
|
24
|
+
export interface AdminSession {
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
token: string;
|
|
27
|
+
sessionToken?: string;
|
|
28
|
+
uid: string;
|
|
29
|
+
email: string;
|
|
30
|
+
role: 'admin' | 'platform-owner' | 'approved-developer';
|
|
31
|
+
permissions?: string[];
|
|
32
|
+
mfaVerified: boolean;
|
|
33
|
+
deviceId: string;
|
|
34
|
+
expiresAt: number;
|
|
35
|
+
apiUrl?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AdminCliOptions {
|
|
38
|
+
apiUrl?: string;
|
|
39
|
+
isRemote?: boolean;
|
|
40
|
+
isOffline?: boolean;
|
|
41
|
+
isBrowser?: boolean;
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
token?: string;
|
|
44
|
+
email?: string;
|
|
45
|
+
role?: AdminSession['role'];
|
|
46
|
+
mfaCode?: string;
|
|
47
|
+
deviceId?: string;
|
|
48
|
+
deviceName?: string;
|
|
49
|
+
isTestMode?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare function getStoredAdminSession(): AdminSession | null;
|
|
52
|
+
export declare function fetchWithTimeout(url: string, options: RequestInit, timeoutMs?: number): Promise<Response>;
|
|
53
|
+
export declare function promptMfaInteractive(providedCode?: string, isTestMode?: boolean): Promise<string>;
|
|
54
|
+
export declare function validateEnvironmentSecurity(options: AdminCliOptions): void;
|
|
55
|
+
export declare function executeAdminLogin(options: AdminCliOptions): Promise<any>;
|
|
56
|
+
export declare function executeAdminLogout(options?: AdminCliOptions): Promise<any>;
|
|
57
|
+
export declare function executeAdminWhoami(options?: AdminCliOptions): Promise<any>;
|
|
58
|
+
export declare function executeAdminPermissions(options?: AdminCliOptions): Promise<any>;
|
|
59
|
+
export declare function executeAdminSessionStatus(options?: AdminCliOptions): Promise<any>;
|
|
60
|
+
export declare function executeAdminAuditLogs(options?: AdminCliOptions): Promise<any>;
|
|
61
|
+
export declare function printHelp(): void;
|
|
62
|
+
export declare function main(): Promise<void>;
|
|
63
|
+
//# sourceMappingURL=creatorverse-admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creatorverse-admin.d.ts","sourceRoot":"","sources":["../src/creatorverse-admin.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;GAiBG;AAQH,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,UAAU,QAA2C,CA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