@replaystage/cli 2.1.0 → 2.1.2

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.
@@ -1,10 +1,28 @@
1
1
  import { readFile, stat } from 'node:fs/promises';
2
2
  import path from 'node:path';
3
- import { DEFAULT_PORTAL_ORIGIN, findPlatformWorkspaceRoot, requireAuthToken, resolveApiBase, } from '../config.js';
3
+ import { DEFAULT_PORTAL_ORIGIN, findPlatformWorkspaceRoot, requireAuthToken, resolveApiBase, resolveAuthToken, } from '../config.js';
4
4
  import { apiRequestJson } from '../http.js';
5
5
  import { SLUG_RE, VALID_ADMIN_VISIBILITIES } from '../manifest.js';
6
6
  import { CliError, assertNoUnknownFlags, emitSuccess, extractBoolFlag, extractFlag, } from '../output.js';
7
7
  const DATE_KEY_RE = /^\d{4}-\d{2}-\d{2}$/;
8
+ function parseStrictInt(raw, flagName, min, max) {
9
+ if (!/^-?\d+$/.test(raw.trim())) {
10
+ throw new CliError('INVALID_ARGUMENTS', `Invalid ${flagName} "${raw}". Expected an integer between ${min} and ${max}.`);
11
+ }
12
+ const n = Number(raw.trim());
13
+ if (!Number.isSafeInteger(n) || n < min || n > max) {
14
+ throw new CliError('INVALID_ARGUMENTS', `Invalid ${flagName} "${raw}". Expected an integer between ${min} and ${max}.`);
15
+ }
16
+ return n;
17
+ }
18
+ function parseStrictBool(raw, flagName) {
19
+ const lower = raw.trim().toLowerCase();
20
+ if (lower === 'true' || lower === '1')
21
+ return true;
22
+ if (lower === 'false' || lower === '0')
23
+ return false;
24
+ throw new CliError('INVALID_ARGUMENTS', `Invalid ${flagName} "${raw}". Expected true or false.`);
25
+ }
8
26
  async function exists(targetPath) {
9
27
  try {
10
28
  await stat(targetPath);
@@ -66,10 +84,12 @@ export async function cmdCatalog(args, opts) {
66
84
  }
67
85
  body.visibility = visFlag.value;
68
86
  }
69
- if (orderFlag.value !== undefined)
70
- body.featuredOrder = Number(orderFlag.value);
71
- if (dailyFlag.value !== undefined)
72
- body.dailyEligible = dailyFlag.value === 'true' || dailyFlag.value === '1';
87
+ if (orderFlag.value !== undefined) {
88
+ body.featuredOrder = parseStrictInt(orderFlag.value, '--order', 0, 100_000);
89
+ }
90
+ if (dailyFlag.value !== undefined) {
91
+ body.dailyEligible = parseStrictBool(dailyFlag.value, '--daily');
92
+ }
73
93
  if (noteFlag.value !== undefined)
74
94
  body.moderationNote = noteFlag.value;
75
95
  if (manifestFlag.value) {
@@ -117,7 +137,33 @@ export async function cmdDaily(args, opts) {
117
137
  if (sub === 'show' || !sub) {
118
138
  assertNoUnknownFlags(rest);
119
139
  const apiBase = await resolveApiBase(opts.apiBase);
120
- const data = await apiRequestJson({ apiBase, method: 'GET', path: '/v1/catalog' });
140
+ const token = await resolveAuthToken({
141
+ flagToken: opts.token,
142
+ allowAdminEnvFallback: true,
143
+ cwd: opts.cwd,
144
+ });
145
+ let data;
146
+ if (token) {
147
+ try {
148
+ data = await apiRequestJson({
149
+ apiBase,
150
+ method: 'GET',
151
+ path: '/v1/admin/daily',
152
+ token,
153
+ });
154
+ }
155
+ catch (err) {
156
+ if (err instanceof CliError && (err.status === 401 || err.status === 403)) {
157
+ data = await apiRequestJson({ apiBase, method: 'GET', path: '/v1/catalog' });
158
+ }
159
+ else {
160
+ throw err;
161
+ }
162
+ }
163
+ }
164
+ else {
165
+ data = await apiRequestJson({ apiBase, method: 'GET', path: '/v1/catalog' });
166
+ }
121
167
  emitSuccess(opts, data, () => [
122
168
  `ReplayStage Daily Stage Schedule (UTC today: ${data.utcDate})`,
123
169
  ...(data.upcoming ?? []).map(entry => {
@@ -199,10 +245,12 @@ export async function cmdAdmin(args, opts) {
199
245
  const daysFlag = extractFlag(rem, ['--days']);
200
246
  rem = daysFlag.rest;
201
247
  assertNoUnknownFlags(rem);
248
+ const maxUses = usesFlag.value !== undefined ? parseStrictInt(usesFlag.value, '--max-uses', 1, 1000) : 1;
249
+ const expiresInDays = daysFlag.value !== undefined ? parseStrictInt(daysFlag.value, '--days', 1, 365) : 30;
202
250
  const res = await adminApi(opts, 'POST', '/v1/admin/invites', {
203
251
  note: noteFlag.value || '',
204
- maxUses: usesFlag.value ? Number(usesFlag.value) : 1,
205
- expiresInDays: daysFlag.value ? Number(daysFlag.value) : 30,
252
+ maxUses,
253
+ expiresInDays,
206
254
  });
207
255
  emitSuccess(opts, res, () => [
208
256
  `Created invite code: ${res.invite.code} (id=${res.invite.id}, uses=${res.invite.maxUses})`,
@@ -391,7 +439,7 @@ export async function cmdAudit(args, opts) {
391
439
  if (liveFlag.present) {
392
440
  let liveGames = [];
393
441
  try {
394
- const catRes = await fetch(`${apiBase}/v1/catalog`);
442
+ const catRes = await fetch(`${apiBase}/v1/catalog`, { signal: AbortSignal.timeout(12_000) });
395
443
  if (catRes.ok) {
396
444
  const catData = (await catRes.json());
397
445
  liveGames = catData.games ?? [];
@@ -433,9 +481,15 @@ export async function cmdAudit(args, opts) {
433
481
  extra: unknownProbe.status === 404 ? '' : `expected HTTP 404, got ${unknownProbe.status}`,
434
482
  });
435
483
  }
436
- const failures = checks.filter(c => !c.ok).length + probes.filter(p => !p.ok).length;
484
+ const failedChecks = checks.filter(c => !c.ok);
485
+ const failedProbes = probes.filter(p => !p.ok);
486
+ const failures = failedChecks.length + failedProbes.length;
437
487
  if (failures > 0) {
438
- throw new CliError('AUDIT_FAILED', `ReplayStage audit failed with ${failures} issue(s).`, { details: { checks, probes, failures } });
488
+ const errors = [
489
+ ...failedChecks.map(c => `[${c.name}] ${c.detail}`),
490
+ ...failedProbes.map(p => `[${p.label}] ${p.url} -> HTTP ${p.status} (${p.ms}ms)${p.extra ? ` ${p.extra}` : ''}`),
491
+ ];
492
+ throw new CliError('AUDIT_FAILED', `ReplayStage audit failed with ${failures} issue(s).`, { details: { checks, probes, failures, errors } });
439
493
  }
440
494
  emitSuccess(opts, { checks, probes, failures: 0 }, () => [
441
495
  'ReplayStage Platform Audit',
@@ -0,0 +1,5 @@
1
+ import { type GlobalOptions } from '../output.js';
2
+ export declare function cmdValidate(args: string[], opts: GlobalOptions): Promise<void>;
3
+ export declare function cmdPublish(args: string[], opts: GlobalOptions): Promise<void>;
4
+ export declare function cmdReleases(args: string[], opts: GlobalOptions): Promise<void>;
5
+ export declare function cmdRollback(args: string[], opts: GlobalOptions): Promise<void>;
@@ -0,0 +1,352 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { DEFAULT_PORTAL_ORIGIN, DEFAULT_STUDIO_ORIGIN, requireAuthToken, resolveApiBase, } from '../config.js';
3
+ import { apiRequestJson } from '../http.js';
4
+ import { SLUG_RE, VALID_CREATOR_VISIBILITIES } from '../manifest.js';
5
+ import { CliError, assertNoUnknownFlags, emitSuccess, extractBoolFlag, extractFlag, } from '../output.js';
6
+ import { validateProjectBundle } from '../validate.js';
7
+ import { formatBytes } from './creator-scaffold.js';
8
+ async function runPool(items, concurrency, worker) {
9
+ let cursor = 0;
10
+ const workers = Array.from({ length: Math.min(concurrency, items.length) }, async () => {
11
+ while (cursor < items.length) {
12
+ const idx = cursor;
13
+ cursor += 1;
14
+ const item = items[idx];
15
+ if (item !== undefined) {
16
+ await worker(item);
17
+ }
18
+ }
19
+ });
20
+ await Promise.all(workers);
21
+ }
22
+ export async function cmdValidate(args, opts) {
23
+ let rest = args;
24
+ const manifestFlag = extractFlag(rest, ['--manifest', '-m']);
25
+ rest = manifestFlag.rest;
26
+ const versionFlag = extractFlag(rest, ['--version']);
27
+ rest = versionFlag.rest;
28
+ const strictFlag = extractBoolFlag(rest, ['--strict']);
29
+ rest = strictFlag.rest;
30
+ assertNoUnknownFlags(rest);
31
+ const distDir = rest[0] || 'dist';
32
+ const report = await validateProjectBundle({
33
+ cwd: opts.cwd,
34
+ distDir,
35
+ manifestPath: manifestFlag.value,
36
+ versionOverride: versionFlag.value,
37
+ });
38
+ if (strictFlag.present && report.warnings.length > 0) {
39
+ throw new CliError('VALIDATION_WARNINGS', `Strict validation failed with ${report.warnings.length} warning(s). Resolve all warnings or omit --strict.`, {
40
+ details: {
41
+ slug: report.slug,
42
+ version: report.version,
43
+ warnings: report.warnings,
44
+ errors: report.warnings,
45
+ },
46
+ });
47
+ }
48
+ emitSuccess(opts, {
49
+ slug: report.slug,
50
+ version: report.version,
51
+ manifestPath: report.manifestPath,
52
+ distDir: report.distDir,
53
+ entryPath: report.entryPath,
54
+ fileCount: report.fileCount,
55
+ totalBytes: report.totalBytes,
56
+ media: report.media.map(m => ({ slot: m.slot, filename: m.filename, bytes: m.bytes })),
57
+ warnings: report.warnings,
58
+ }, () => {
59
+ const lines = [
60
+ `Valid ReplayStage bundle: ${report.slug} v${report.version}`,
61
+ ` Manifest: ${report.manifestPath}`,
62
+ ` Dist: ${report.distDir} (${report.fileCount} files, ${formatBytes(report.totalBytes)}, entry ${report.entryPath})`,
63
+ ];
64
+ if (report.media.length > 0) {
65
+ lines.push(` Media: ${report.media.map(m => `${m.slot}=${m.filename}`).join(', ')}`);
66
+ }
67
+ for (const w of report.warnings) {
68
+ lines.push(` [WARN] ${w}`);
69
+ }
70
+ return lines;
71
+ });
72
+ }
73
+ export async function cmdPublish(args, opts) {
74
+ let rest = args;
75
+ const manifestFlag = extractFlag(rest, ['--manifest', '-m']);
76
+ rest = manifestFlag.rest;
77
+ const versionFlag = extractFlag(rest, ['--version']);
78
+ rest = versionFlag.rest;
79
+ const visFlag = extractFlag(rest, ['--visibility']);
80
+ rest = visFlag.rest;
81
+ const unlistedFlag = extractBoolFlag(rest, ['--unlisted']);
82
+ rest = unlistedFlag.rest;
83
+ const liveFlag = extractBoolFlag(rest, ['--live']);
84
+ rest = liveFlag.rest;
85
+ const betaFlag = extractBoolFlag(rest, ['--beta']);
86
+ rest = betaFlag.rest;
87
+ const hiddenFlag = extractBoolFlag(rest, ['--hidden']);
88
+ rest = hiddenFlag.rest;
89
+ const skipHealthFlag = extractBoolFlag(rest, ['--skip-health']);
90
+ rest = skipHealthFlag.rest;
91
+ const dryRunFlag = extractBoolFlag(rest, ['--dry-run']);
92
+ rest = dryRunFlag.rest;
93
+ assertNoUnknownFlags(rest);
94
+ const selectedVisFlags = [
95
+ visFlag.value,
96
+ unlistedFlag.present ? 'unlisted' : undefined,
97
+ liveFlag.present ? 'live' : undefined,
98
+ betaFlag.present ? 'beta' : undefined,
99
+ hiddenFlag.present ? 'hidden' : undefined,
100
+ ].filter((v) => Boolean(v));
101
+ if (selectedVisFlags.length > 1) {
102
+ throw new CliError('INVALID_ARGUMENTS', 'Specify at most one visibility flag (--unlisted, --live, --beta, --hidden, or --visibility).');
103
+ }
104
+ const explicitVisibility = selectedVisFlags[0];
105
+ if (explicitVisibility &&
106
+ !VALID_CREATOR_VISIBILITIES.includes(explicitVisibility)) {
107
+ throw new CliError('INVALID_ARGUMENTS', `Invalid visibility "${explicitVisibility}". Allowed: ${VALID_CREATOR_VISIBILITIES.join(', ')}.`);
108
+ }
109
+ const distDir = rest[0] || 'dist';
110
+ // 1. Offline preflight validation (fail fast before touching network!)
111
+ const report = await validateProjectBundle({
112
+ cwd: opts.cwd,
113
+ distDir,
114
+ manifestPath: manifestFlag.value,
115
+ versionOverride: versionFlag.value,
116
+ });
117
+ // 1b. Fail fast if a non-canonical local artwork reference (neither https:// nor /media/<slug>/) is missing on disk
118
+ for (const slot of ['icon', 'cover', 'poster']) {
119
+ const ref = report.manifest.artwork[slot];
120
+ if (!ref)
121
+ continue;
122
+ const isExternal = ref.startsWith('https://') || ref.startsWith('http://');
123
+ const isCanonical = ref.startsWith(`/media/${report.slug}/`);
124
+ const wasDiscovered = report.media.some(m => m.slot === slot);
125
+ if (!isExternal && !isCanonical && !wasDiscovered) {
126
+ throw new CliError('ARTWORK_MISSING', `Local artwork.${slot} ("${ref}") was not found on disk. Place the file in your repo or reference /media/${report.slug}/${slot}.png.`, { details: { slot, ref } });
127
+ }
128
+ }
129
+ if (dryRunFlag.present) {
130
+ emitSuccess(opts, {
131
+ dryRun: true,
132
+ slug: report.slug,
133
+ version: report.version,
134
+ visibility: explicitVisibility ?? 'unlisted (new) / preserve (existing)',
135
+ entryPath: report.entryPath,
136
+ bundle: { fileCount: report.fileCount, totalBytes: report.totalBytes },
137
+ media: report.media.map(m => ({ slot: m.slot, filename: m.filename, bytes: m.bytes })),
138
+ warnings: report.warnings,
139
+ }, () => {
140
+ const lines = [
141
+ `[DRY RUN] Would publish ${report.slug} v${report.version}`,
142
+ ` Dist: ${report.distDir} (${report.fileCount} files, ${formatBytes(report.totalBytes)}, entry ${report.entryPath})`,
143
+ ` Media: ${report.media.length > 0 ? report.media.map(m => `${m.slot}=${m.filename}`).join(', ') : '(none discovered)'}`,
144
+ ` Visibility: ${explicitVisibility ?? 'unlisted (new) / preserve (existing)'}`,
145
+ ];
146
+ for (const w of report.warnings) {
147
+ lines.push(` [WARN] ${w}`);
148
+ }
149
+ return lines;
150
+ });
151
+ return;
152
+ }
153
+ const apiBase = await resolveApiBase(opts.apiBase);
154
+ const token = await requireAuthToken({
155
+ flagToken: opts.token,
156
+ allowPublishEnvFallback: true,
157
+ cwd: opts.cwd,
158
+ });
159
+ const slug = report.slug;
160
+ const version = report.version;
161
+ let createdSlot = false;
162
+ // 2. If using an account key (RSKEY_ / RSSESS_), auto-register the game slot when new
163
+ if (token.startsWith('RSKEY_') || token.startsWith('RSSESS_')) {
164
+ const owned = await apiRequestJson({
165
+ apiBase,
166
+ method: 'GET',
167
+ path: '/v1/creator/games',
168
+ token,
169
+ });
170
+ const existsInAccount = (owned.games ?? []).some(g => g.slug === slug);
171
+ if (!existsInAccount) {
172
+ try {
173
+ await apiRequestJson({
174
+ apiBase,
175
+ method: 'POST',
176
+ path: '/v1/creator/games',
177
+ token,
178
+ body: {
179
+ slug,
180
+ titleEn: report.manifest.locales.en.title,
181
+ titleZh: report.manifest.locales['zh-Hans'].title,
182
+ genre: report.manifest.genre,
183
+ accentColor: report.manifest.accentColor,
184
+ },
185
+ });
186
+ createdSlot = true;
187
+ }
188
+ catch (err) {
189
+ // Admins may legitimately publish releases for games owned by another creator.
190
+ if (err instanceof CliError && err.status === 409) {
191
+ let existsInAdminCatalog = false;
192
+ try {
193
+ const allGames = await apiRequestJson({
194
+ apiBase,
195
+ method: 'GET',
196
+ path: '/v1/admin/games',
197
+ token,
198
+ });
199
+ existsInAdminCatalog = (allGames.games ?? []).some(g => g.slug === slug);
200
+ }
201
+ catch {
202
+ existsInAdminCatalog = false;
203
+ }
204
+ if (!existsInAdminCatalog)
205
+ throw err;
206
+ }
207
+ else {
208
+ throw err;
209
+ }
210
+ }
211
+ }
212
+ }
213
+ // 3. Upload immutable bundle files concurrently
214
+ await runPool(report.files, 8, async (file) => {
215
+ const bytes = await readFile(file.absPath);
216
+ const encodedRel = file.relPath.split('/').map(encodeURIComponent).join('/');
217
+ await apiRequestJson({
218
+ apiBase,
219
+ method: 'PUT',
220
+ path: `/v1/publish/${encodeURIComponent(slug)}/files/${encodeURIComponent(version)}/${encodedRel}`,
221
+ token,
222
+ rawBody: bytes,
223
+ contentType: file.contentType,
224
+ });
225
+ });
226
+ // 4. Upload discovered local artwork (<= 2 MB each) and rewrite local refs to canonical /media/<slug>/<file>
227
+ const mediaUploaded = [];
228
+ const releaseManifest = {
229
+ ...report.manifest,
230
+ artwork: { ...report.manifest.artwork },
231
+ };
232
+ for (const media of report.media) {
233
+ const bytes = await readFile(media.absPath);
234
+ const uploaded = await apiRequestJson({
235
+ apiBase,
236
+ method: 'PUT',
237
+ path: `/v1/publish/${encodeURIComponent(slug)}/media/${encodeURIComponent(media.filename)}`,
238
+ token,
239
+ rawBody: bytes,
240
+ contentType: media.contentType,
241
+ });
242
+ const canonicalUrl = uploaded.url || `/media/${slug}/${media.filename}`;
243
+ releaseManifest.artwork[media.slot] = canonicalUrl;
244
+ mediaUploaded.push(canonicalUrl);
245
+ }
246
+ // 5. Finalize atomic pointer release
247
+ const releaseRes = await apiRequestJson({
248
+ apiBase,
249
+ method: 'POST',
250
+ path: `/v1/publish/${encodeURIComponent(slug)}/release`,
251
+ token,
252
+ body: {
253
+ version,
254
+ manifest: releaseManifest,
255
+ fileCount: report.fileCount,
256
+ totalBytes: report.totalBytes,
257
+ ...(explicitVisibility ? { visibility: explicitVisibility } : {}),
258
+ },
259
+ });
260
+ // 6. Verify live edge health unless skipped
261
+ let health = null;
262
+ if (!skipHealthFlag.present && releaseRes.origin) {
263
+ const controller = new AbortController();
264
+ const timer = setTimeout(() => controller.abort(), 10_000);
265
+ try {
266
+ const probe = await fetch(`${releaseRes.origin}/_rs/health`, { signal: controller.signal });
267
+ health = { ok: probe.ok, status: probe.status };
268
+ }
269
+ catch {
270
+ health = { ok: false, status: 0 };
271
+ }
272
+ finally {
273
+ clearTimeout(timer);
274
+ }
275
+ }
276
+ const playUrl = releaseRes.playUrl || `${DEFAULT_PORTAL_ORIGIN}/play/${slug}`;
277
+ const studioUrl = `${DEFAULT_STUDIO_ORIGIN}/games/${slug}`;
278
+ const emulatorUrl = `${DEFAULT_STUDIO_ORIGIN}/emulator?game=${encodeURIComponent(slug)}`;
279
+ emitSuccess(opts, {
280
+ slug,
281
+ version,
282
+ releaseId: releaseRes.releaseId,
283
+ visibility: releaseRes.visibility,
284
+ createdSlot,
285
+ playUrl,
286
+ origin: releaseRes.origin,
287
+ studioUrl,
288
+ emulatorUrl,
289
+ bundle: releaseRes.bundle ?? { fileCount: report.fileCount, totalBytes: report.totalBytes },
290
+ mediaUploaded,
291
+ health,
292
+ warnings: report.warnings,
293
+ }, () => {
294
+ const lines = [
295
+ `Published ${slug} v${version} (${releaseRes.visibility})`,
296
+ ` Play URL: ${playUrl}`,
297
+ ` Game Origin: ${releaseRes.origin}`,
298
+ ` Emulator: ${emulatorUrl}`,
299
+ ` Bundle: ${report.fileCount} files (${formatBytes(report.totalBytes)})`,
300
+ ` Media: ${mediaUploaded.length > 0 ? mediaUploaded.join(', ') : '(none uploaded)'}`,
301
+ ];
302
+ if (releaseRes.visibility === 'unlisted') {
303
+ lines.push(` Preview: Unlisted (noindex, direct-link playable). Promote when ready with: replaystage visibility ${slug} live`);
304
+ }
305
+ for (const w of report.warnings) {
306
+ lines.push(` [WARN] ${w}`);
307
+ }
308
+ return lines;
309
+ });
310
+ }
311
+ export async function cmdReleases(args, opts) {
312
+ assertNoUnknownFlags(args);
313
+ const slug = args[0]?.trim().toLowerCase();
314
+ if (!slug || !SLUG_RE.test(slug)) {
315
+ throw new CliError('INVALID_ARGUMENTS', 'Usage: replaystage releases <slug> [--json]');
316
+ }
317
+ const apiBase = await resolveApiBase(opts.apiBase);
318
+ const token = await requireAuthToken({ flagToken: opts.token, cwd: opts.cwd });
319
+ const data = await apiRequestJson({
320
+ apiBase,
321
+ method: 'GET',
322
+ path: `/v1/creator/games/${encodeURIComponent(slug)}/releases`,
323
+ token,
324
+ });
325
+ emitSuccess(opts, { slug, releases: data.releases }, () => [
326
+ `Releases for ${slug}:`,
327
+ ...(data.releases.length === 0
328
+ ? [' (no releases published yet)']
329
+ : data.releases.map(r => ` v${r.version.padEnd(14)} ${r.status.padEnd(10)} ${String(r.fileCount).padStart(4)} files ${formatBytes(r.totalBytes).padEnd(10)} ${r.createdAt}`)),
330
+ ]);
331
+ }
332
+ export async function cmdRollback(args, opts) {
333
+ assertNoUnknownFlags(args);
334
+ const [slugRaw, versionRaw] = args;
335
+ const slug = slugRaw?.trim().toLowerCase();
336
+ const version = versionRaw?.trim();
337
+ if (!slug || !SLUG_RE.test(slug) || !version) {
338
+ throw new CliError('INVALID_ARGUMENTS', 'Usage: replaystage rollback <slug> <version> [--json]');
339
+ }
340
+ const apiBase = await resolveApiBase(opts.apiBase);
341
+ const token = await requireAuthToken({ flagToken: opts.token, cwd: opts.cwd });
342
+ const res = await apiRequestJson({
343
+ apiBase,
344
+ method: 'POST',
345
+ path: `/v1/creator/games/${encodeURIComponent(slug)}/rollback`,
346
+ token,
347
+ body: { version },
348
+ });
349
+ emitSuccess(opts, { slug, version, ...res }, () => [
350
+ `Rolled back ${slug} to v${version}.`,
351
+ ]);
352
+ }
@@ -0,0 +1,5 @@
1
+ import { type GlobalOptions } from '../output.js';
2
+ export declare function formatBytes(bytes: number): string;
3
+ export declare function cmdInit(args: string[], opts: GlobalOptions): Promise<void>;
4
+ export declare function cmdCreateGame(args: string[], opts: GlobalOptions): Promise<void>;
5
+ export declare function cmdSdk(args: string[], opts: GlobalOptions): Promise<void>;