@remogram/cli 0.1.0-beta.5 → 0.1.0-beta.8

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/index.js CHANGED
@@ -1,34 +1,19 @@
1
1
  import {
2
2
  loadConfig,
3
- findConfigPath,
4
3
  assertForgeReady,
5
- gitRemoteUrl,
6
- parseRemoteUrl,
7
- trustedBaseUrl,
8
- assertConfigMatchesRemote,
9
4
  forgeContext,
10
- forgePacket,
11
- forgeErrorPacket,
12
- unknownForgeContext,
13
- PACKET_TYPES,
14
5
  ERROR_CODES,
15
6
  forgeError,
16
- sanitizeField,
17
- assertGitRef,
18
- assertGitRemote,
19
- getEffectiveIngestMaxBytes,
20
- FORGE_INGEST_MAX_BYTES_ENV,
21
- throwIfStaleHeadByNumber,
22
- FACT_INVENTORY_PACKET_TYPES,
23
- forgeFactInventoryPacket,
24
- assertWriteCommandConfigured,
25
- parseSinceObservedAt,
26
7
  } from '@remogram/core';
27
8
  import { provider as giteaApi } from '@remogram/provider-gitea-api';
28
9
  import { provider as githubApi } from '@remogram/provider-github-api';
29
10
  import { provider as gitlabApi } from '@remogram/provider-gitlab-api';
30
11
  import { provider as giteaTea } from '@remogram/provider-gitea-tea';
31
12
  import { provider as githubGh } from '@remogram/provider-github-gh';
13
+ import { output, handleError } from './cli-io.js';
14
+ import { parseCliArgv } from './cli-argv.js';
15
+ import { buildDoctorPacket } from './cli-doctor.js';
16
+ import { dispatchForgeCommand } from './cli-dispatch.js';
32
17
 
33
18
  const PROVIDERS = {
34
19
  'gitea-api': giteaApi,
@@ -38,280 +23,10 @@ const PROVIDERS = {
38
23
  'github-gh': githubGh,
39
24
  };
40
25
 
41
- const REPEATABLE_FLAGS = new Set(['allowed_path']);
42
-
43
- function parseAllowedPathFlags(flags) {
44
- if (flags.allowed_path == null) return undefined;
45
- return Array.isArray(flags.allowed_path) ? flags.allowed_path : [flags.allowed_path];
46
- }
47
-
48
- function parsePositiveInt(value, name) {
49
- if (value == null) return undefined;
50
- const n = Number(value);
51
- if (!Number.isInteger(n) || n <= 0) {
52
- throw Object.assign(new Error(`Invalid ${name}`), {
53
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, `${name} must be a positive integer`),
54
- });
55
- }
56
- return n;
57
- }
58
-
59
- function output(packet, asJson) {
60
- console.log(JSON.stringify(packet, null, asJson ? 2 : 0));
61
- }
62
-
63
- function handleError(err, ctx, asJson) {
64
- const fe = err.forgeError || {
65
- code: ERROR_CODES.API_ERROR,
66
- message: err.message,
67
- status: err.status,
68
- };
69
- const baseCtx = ctx || {
70
- providerId: 'unknown',
71
- remoteName: 'origin',
72
- repoId: 'unknown/unknown',
73
- };
74
- if (err.staleHeadPacket) {
75
- output(forgePacket(err.staleHeadPacket.type, baseCtx, err.staleHeadPacket.body, fe), asJson);
76
- process.exitCode = 1;
77
- return;
78
- }
79
- output(forgeErrorPacket(baseCtx, fe), asJson);
80
- process.exitCode = 1;
81
- }
82
-
83
- function doctorCheck(name, status, message, details = null) {
84
- return {
85
- name,
86
- status,
87
- message: sanitizeField(message),
88
- ...(details ? { details } : {}),
89
- };
90
- }
91
-
92
- function doctorSummary(checks) {
93
- if (checks.some((check) => check.status === 'fail')) return 'fail';
94
- if (checks.some((check) => check.status === 'warn')) return 'warn';
95
- return 'pass';
96
- }
97
-
98
- function contextFromConfig(config, cwd, parsed = null) {
99
- return {
100
- providerId: config.provider,
101
- remoteName: config.remote,
102
- repoId: parsed ? `${parsed.owner}/${parsed.repo}` : `${config.owner}/${config.repo}`,
103
- config,
104
- cwd,
105
- parsed,
106
- };
107
- }
108
-
109
- function finalizeDoctorPacket(ctx, checks, providerCapabilities) {
110
- const summary = doctorSummary(checks);
111
- const error =
112
- summary === 'fail'
113
- ? forgeError(ERROR_CODES.CONFIG_INVALID, 'Doctor checks failed')
114
- : null;
115
- return forgePacket(
116
- PACKET_TYPES.PROVIDER_DOCTOR,
117
- ctx,
118
- {
119
- summary,
120
- checks,
121
- provider_capabilities: providerCapabilities,
122
- },
123
- error,
124
- );
125
- }
126
-
127
- async function buildDoctorPacket(cwd, providers) {
128
- const checks = [];
129
- const configPath = findConfigPath(cwd);
130
- let loaded = null;
131
- let config = null;
132
- let parsed = null;
133
- let ctx = unknownForgeContext();
134
- let providerCapabilities = null;
135
-
136
- if (!configPath) {
137
- checks.push(doctorCheck('config', 'fail', 'No .remogram.json found'));
138
- return finalizeDoctorPacket(ctx, checks, null);
139
- }
140
-
141
- try {
142
- loaded = loadConfig(cwd);
143
- config = loaded.config;
144
- ctx = contextFromConfig(config, loaded.cwd);
145
- checks.push(doctorCheck('config', 'pass', '.remogram.json is present and valid'));
146
- } catch (err) {
147
- checks.push(doctorCheck('config', 'fail', err.forgeError?.message || err.message));
148
- return finalizeDoctorPacket(ctx, checks, null);
149
- }
150
-
151
- const provider = providers[config.provider];
152
- if (!provider) {
153
- checks.push(doctorCheck('provider', 'fail', `Unsupported provider: ${config.provider}`));
154
- } else {
155
- if (typeof provider.providerCapabilities === 'function') {
156
- providerCapabilities = await provider.providerCapabilities(ctx);
157
- const stubProvider =
158
- providerCapabilities.commands?.length > 0
159
- && providerCapabilities.commands.every((command) => command.implemented === false);
160
- checks.push(
161
- doctorCheck(
162
- 'provider',
163
- stubProvider ? 'warn' : 'pass',
164
- stubProvider
165
- ? `${config.provider} is not fully supported in v1; use an *-api provider`
166
- : `${config.provider} is registered`,
167
- ),
168
- );
169
- checks.push(doctorCheck('capabilities', 'pass', 'Provider capabilities are available'));
170
- } else {
171
- checks.push(doctorCheck('provider', 'pass', `${config.provider} is registered`));
172
- checks.push(doctorCheck('capabilities', 'fail', 'Provider capabilities are not implemented'));
173
- }
174
- }
175
-
176
- let remoteUrl = null;
177
- try {
178
- assertGitRemote(config.remote, 'config.remote');
179
- remoteUrl = gitRemoteUrl(loaded.cwd, config.remote);
180
- parsed = parseRemoteUrl(remoteUrl);
181
- if (!parsed) {
182
- checks.push(doctorCheck('remote', 'fail', 'Could not parse git remote URL'));
183
- } else {
184
- ctx = contextFromConfig(config, loaded.cwd, parsed);
185
- checks.push(doctorCheck('remote', 'pass', 'Git remote URL parses successfully', {
186
- host: sanitizeField(parsed.host),
187
- owner: sanitizeField(parsed.owner),
188
- repo: sanitizeField(parsed.repo),
189
- }));
190
- }
191
- } catch (err) {
192
- checks.push(doctorCheck('remote', 'fail', err.forgeError?.message || err.message));
193
- }
194
-
195
- if (parsed) {
196
- try {
197
- assertConfigMatchesRemote(config, parsed);
198
- checks.push(doctorCheck('repo_match', 'pass', 'Config owner/repo matches git remote'));
199
- } catch (err) {
200
- checks.push(doctorCheck('repo_match', 'fail', err.forgeError?.message || err.message));
201
- }
202
-
203
- if (config.baseUrl && !trustedBaseUrl(config, parsed.host)) {
204
- checks.push(
205
- doctorCheck('host_binding', 'fail', `baseUrl host does not match remote host ${parsed.host}`),
206
- );
207
- } else {
208
- checks.push(doctorCheck('host_binding', 'pass', 'Configured host binding is trusted'));
209
- }
210
- }
211
-
212
- if (providerCapabilities) {
213
- const envNames = providerCapabilities.auth_envs || [];
214
- const presentEnv = envNames.find((name) => Boolean(process.env[name])) || null;
215
- checks.push(
216
- doctorCheck(
217
- 'auth',
218
- presentEnv ? 'pass' : 'warn',
219
- presentEnv ? `${presentEnv} is present` : 'No provider auth environment variable is set',
220
- { env_names: envNames, present_env: presentEnv },
221
- ),
222
- );
223
-
224
- if (providerCapabilities.write_support) {
225
- const providerWrites = (providerCapabilities.write_commands || []).filter(Boolean);
226
- const configuredWrites = Array.isArray(config?.write_commands) ? config.write_commands : [];
227
- const missing = providerWrites.filter((name) => !configuredWrites.includes(name));
228
- checks.push(
229
- doctorCheck(
230
- 'write_config',
231
- missing.length ? 'warn' : 'pass',
232
- missing.length
233
- ? `Provider supports write commands but .remogram.json write_commands omits: ${missing.join(', ')}. Add ids for Remogram CLI/MCP writes, or use forge/CI tooling for those actions outside Remogram.`
234
- : 'Consumer write_commands matches provider write surface',
235
- { provider_write_commands: providerWrites, configured_write_commands: configuredWrites },
236
- ),
237
- );
238
- }
239
-
240
- if (!providerCapabilities.check_sources?.length) {
241
- checks.push(doctorCheck('checks', 'warn', 'Provider does not report forge check sources'));
242
- } else {
243
- checks.push(doctorCheck('checks', 'pass', 'Provider reports forge check sources', {
244
- sources: providerCapabilities.check_sources,
245
- }));
246
- }
247
- }
248
-
249
- const { bytes: ingestCapBytes, envOverride: ingestEnvOverride, invalidEnv: ingestInvalidEnv } =
250
- getEffectiveIngestMaxBytes();
251
- if (ingestInvalidEnv) {
252
- checks.push(
253
- doctorCheck(
254
- 'forge_ingest_cap',
255
- 'warn',
256
- `${FORGE_INGEST_MAX_BYTES_ENV} is invalid; using default 8192 bytes`,
257
- { effective_bytes: ingestCapBytes, env_override: false },
258
- ),
259
- );
260
- } else if (ingestEnvOverride) {
261
- checks.push(
262
- doctorCheck(
263
- 'forge_ingest_cap',
264
- 'warn',
265
- `${FORGE_INGEST_MAX_BYTES_ENV} overrides default ingest cap; agent-safe guarantee is weakened`,
266
- { effective_bytes: ingestCapBytes, env_override: true },
267
- ),
268
- );
269
- } else {
270
- checks.push(
271
- doctorCheck(
272
- 'forge_ingest_cap',
273
- 'pass',
274
- 'Forge HTTP ingest cap is default 8192 bytes',
275
- { effective_bytes: ingestCapBytes, env_override: false },
276
- ),
277
- );
278
- }
279
-
280
- checks.push(doctorCheck('api_reachability', 'skipped', 'Live API reachability is not checked by default'));
281
-
282
- return finalizeDoctorPacket(ctx, checks, providerCapabilities);
283
- }
284
-
285
26
  export async function runCli(argv, options = {}) {
286
27
  const cwd = options.cwd ?? process.env.REMOGRAM_CWD ?? process.cwd();
287
28
  const providers = options.providers ?? PROVIDERS;
288
- const positional = [];
289
- let asJson = false;
290
- const flags = {};
291
-
292
- for (let i = 0; i < argv.length; i += 1) {
293
- const arg = argv[i];
294
- if (arg === '--json') asJson = true;
295
- else if (arg.startsWith('--')) {
296
- const key = arg.slice(2).replace(/-/g, '_');
297
- const next = argv[i + 1];
298
- if (REPEATABLE_FLAGS.has(key)) {
299
- if (!flags[key]) flags[key] = [];
300
- if (next != null && !next.startsWith('--')) {
301
- flags[key].push(next);
302
- i += 1;
303
- }
304
- } else if (next != null && !next.startsWith('--')) {
305
- flags[key] = next;
306
- i += 1;
307
- } else {
308
- flags[key] = true;
309
- }
310
- } else {
311
- positional.push(arg);
312
- }
313
- }
314
-
29
+ const { positional, asJson, flags } = parseCliArgv(argv);
315
30
  const [group, sub] = positional;
316
31
 
317
32
  if (group === 'doctor' && sub == null) {
@@ -347,292 +62,9 @@ export async function runCli(argv, options = {}) {
347
62
  }
348
63
 
349
64
  try {
350
- let packet;
351
- if (group === 'provider' && sub === 'capabilities') {
352
- packet = forgePacket(
353
- PACKET_TYPES.PROVIDER_CAPABILITIES,
354
- ctx,
355
- await provider.providerCapabilities(ctx),
356
- );
357
- } else if (group === 'repo' && sub === 'status') {
358
- packet = forgePacket(PACKET_TYPES.REPO_STATUS, ctx, await provider.repoStatus(ctx));
359
- } else if (group === 'refs' && sub === 'compare') {
360
- if (!flags.base || !flags.head) {
361
- throw Object.assign(new Error('--base and --head required'), {
362
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, '--base and --head required'),
363
- });
364
- }
365
- assertGitRef(flags.base, '--base');
366
- assertGitRef(flags.head, '--head');
367
- packet = forgePacket(
368
- PACKET_TYPES.REF_COMPARE,
369
- ctx,
370
- await provider.refsCompare(ctx, flags.base, flags.head),
371
- );
372
- } else if (group === 'refs' && sub === 'inventory') {
373
- if (typeof provider.refsInventory !== 'function') {
374
- throw Object.assign(new Error('refs inventory not implemented for provider'), {
375
- forgeError: forgeError(
376
- ERROR_CODES.PROVIDER_UNSUPPORTED,
377
- 'refs inventory not implemented for provider',
378
- ),
379
- });
380
- }
381
- packet = forgeFactInventoryPacket(
382
- FACT_INVENTORY_PACKET_TYPES.REF_INVENTORY,
383
- ctx,
384
- await provider.refsInventory(ctx),
385
- );
386
- } else if (group === 'cr' && sub === 'inventory') {
387
- if (typeof provider.crInventory !== 'function') {
388
- throw Object.assign(new Error('cr inventory not implemented for provider'), {
389
- forgeError: forgeError(
390
- ERROR_CODES.PROVIDER_UNSUPPORTED,
391
- 'cr inventory not implemented for provider',
392
- ),
393
- });
394
- }
395
- const inventoryBody = await provider.crInventory(ctx, {
396
- slice_ref: flags.slice_ref,
397
- limit: parsePositiveInt(flags.limit, '--limit'),
398
- sort: flags.sort,
399
- });
400
- if (inventoryBody.list_truncated === true) {
401
- throw Object.assign(new Error('Open CR list incomplete'), {
402
- forgeError: forgeError(
403
- ERROR_CODES.INVENTORY_LIST_INCOMPLETE,
404
- 'Open change request list could not be proved complete within pagination bounds',
405
- null,
406
- {
407
- inventory_list: {
408
- entry_count: inventoryBody.entry_count,
409
- },
410
- },
411
- ),
412
- });
413
- }
414
- packet = forgeFactInventoryPacket(
415
- FACT_INVENTORY_PACKET_TYPES.CR_INVENTORY_SLICE,
416
- ctx,
417
- inventoryBody,
418
- );
419
- } else if (group === 'cr' && sub === 'files') {
420
- const number = parsePositiveInt(flags.number, '--number');
421
- if (number == null) {
422
- throw Object.assign(new Error('--number required'), {
423
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, '--number required for cr files'),
424
- });
425
- }
426
- if (typeof provider.crFiles !== 'function') {
427
- throw Object.assign(new Error('cr files not implemented for provider'), {
428
- forgeError: forgeError(
429
- ERROR_CODES.PROVIDER_UNSUPPORTED,
430
- 'cr files not implemented for provider',
431
- ),
432
- });
433
- }
434
- packet = forgePacket(
435
- PACKET_TYPES.CR_FILES,
436
- ctx,
437
- await provider.crFiles(ctx, { number }),
438
- );
439
- } else if (group === 'cr' && sub === 'comments') {
440
- const number = parsePositiveInt(flags.number, '--number');
441
- if (number == null) {
442
- throw Object.assign(new Error('--number required'), {
443
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, '--number required for cr comments'),
444
- });
445
- }
446
- if (typeof provider.crComments !== 'function') {
447
- throw Object.assign(new Error('cr comments not implemented for provider'), {
448
- forgeError: forgeError(
449
- ERROR_CODES.PROVIDER_UNSUPPORTED,
450
- 'cr comments not implemented for provider',
451
- ),
452
- });
453
- }
454
- packet = forgePacket(
455
- PACKET_TYPES.CR_COMMENTS,
456
- ctx,
457
- await provider.crComments(ctx, { number }),
458
- );
459
- } else if (group === 'forge' && sub === 'changes') {
460
- let sinceIso;
461
- try {
462
- sinceIso = parseSinceObservedAt(flags.since);
463
- } catch (err) {
464
- throw err;
465
- }
466
- if (typeof provider.forgeChanges !== 'function') {
467
- throw Object.assign(new Error('forge changes not implemented for provider'), {
468
- forgeError: forgeError(
469
- ERROR_CODES.PROVIDER_UNSUPPORTED,
470
- 'forge changes not implemented for provider',
471
- ),
472
- });
473
- }
474
- packet = forgePacket(
475
- PACKET_TYPES.FORGE_CHANGES,
476
- ctx,
477
- await provider.forgeChanges(ctx, { since: sinceIso }),
478
- );
479
- } else if (group === 'cr' && sub === 'open') {
480
- if (typeof provider.crOpen !== 'function') {
481
- throw Object.assign(new Error('cr open not implemented for provider'), {
482
- forgeError: forgeError(
483
- ERROR_CODES.PROVIDER_UNSUPPORTED,
484
- 'cr open not implemented for provider',
485
- ),
486
- });
487
- }
488
- if (!flags.head || !flags.base || !flags.title) {
489
- throw Object.assign(new Error('--head, --base, and --title required'), {
490
- forgeError: forgeError(
491
- ERROR_CODES.INVALID_ARGS,
492
- '--head, --base, and --title required for cr open',
493
- ),
494
- });
495
- }
496
- assertGitRef(flags.head, '--head');
497
- assertGitRef(flags.base, '--base');
498
- assertWriteCommandConfigured(ctx.config, 'cr_open');
499
- packet = forgePacket(
500
- PACKET_TYPES.CHANGE_REQUEST_OPENED,
501
- ctx,
502
- await provider.crOpen(ctx, {
503
- head: flags.head,
504
- base: flags.base,
505
- title: flags.title,
506
- body: flags.body,
507
- }),
508
- );
509
- } else if (group === 'status' && sub === 'set') {
510
- if (typeof provider.statusSet !== 'function') {
511
- throw Object.assign(new Error('status set not implemented for provider'), {
512
- forgeError: forgeError(
513
- ERROR_CODES.PROVIDER_UNSUPPORTED,
514
- 'status set not implemented for provider',
515
- ),
516
- });
517
- }
518
- assertWriteCommandConfigured(ctx.config, 'status_set');
519
- packet = forgePacket(
520
- PACKET_TYPES.COMMIT_STATUS_SET,
521
- ctx,
522
- await provider.statusSet(ctx, {
523
- sha: flags.sha,
524
- context: flags.context,
525
- state: flags.state,
526
- target_url: flags.target_url,
527
- description: flags.description,
528
- }),
529
- );
530
- } else if (group === 'pr' && sub === 'view') {
531
- const number = parsePositiveInt(flags.number, '--number');
532
- if (number == null) {
533
- throw Object.assign(new Error('--number required'), {
534
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, '--number required for pr view'),
535
- });
536
- }
537
- const body = await provider.prView(ctx, { number });
538
- throwIfStaleHeadByNumber(
539
- ctx,
540
- PACKET_TYPES.PR_STATUS,
541
- body,
542
- body.head_ref,
543
- body.head_sha,
544
- );
545
- packet = forgePacket(PACKET_TYPES.PR_STATUS, ctx, body);
546
- } else if (group === 'pr' && sub === 'checks') {
547
- const number = parsePositiveInt(flags.number, '--number');
548
- if (number == null && !flags.ref) {
549
- throw Object.assign(new Error('--number or --ref required'), {
550
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, '--number or --ref required for pr checks'),
551
- });
552
- }
553
- if (flags.ref) assertGitRef(flags.ref, '--ref');
554
- if (number != null && !flags.ref) {
555
- const view = await provider.prView(ctx, { number });
556
- throwIfStaleHeadByNumber(
557
- ctx,
558
- PACKET_TYPES.PR_CHECKS,
559
- { head_sha: view.head_sha },
560
- view.head_ref,
561
- view.head_sha,
562
- );
563
- }
564
- packet = forgePacket(
565
- PACKET_TYPES.PR_CHECKS,
566
- ctx,
567
- await provider.prChecks(ctx, { number, ref: flags.ref }),
568
- );
569
- } else if (group === 'merge' && sub === 'plan') {
570
- const number = parsePositiveInt(flags.number, '--number');
571
- if (number == null) {
572
- throw Object.assign(new Error('--number required'), {
573
- forgeError: forgeError(ERROR_CODES.INVALID_ARGS, '--number required for merge plan'),
574
- });
575
- }
576
- const allowedPaths = parseAllowedPathFlags(flags);
577
- packet = forgePacket(
578
- PACKET_TYPES.MERGE_PLAN,
579
- ctx,
580
- await provider.mergePlan(ctx, {
581
- number,
582
- ...(allowedPaths ? { allowed_paths: allowedPaths } : {}),
583
- }),
584
- );
585
- } else if (group === 'branch' && sub === 'protection') {
586
- const branchRef = flags.branch_ref;
587
- if (!branchRef) {
588
- throw Object.assign(new Error('--branch-ref required'), {
589
- forgeError: forgeError(
590
- ERROR_CODES.INVALID_ARGS,
591
- '--branch-ref required for branch protection',
592
- ),
593
- });
594
- }
595
- assertGitRef(branchRef, '--branch-ref');
596
- if (typeof provider.branchProtection !== 'function') {
597
- throw Object.assign(new Error('branch protection not implemented for provider'), {
598
- forgeError: forgeError(
599
- ERROR_CODES.PROVIDER_UNSUPPORTED,
600
- 'branch protection not implemented for provider',
601
- ),
602
- });
603
- }
604
- packet = forgePacket(
605
- PACKET_TYPES.BRANCH_PROTECTION,
606
- ctx,
607
- await provider.branchProtection(ctx, { branchRef }),
608
- );
609
- } else if (group === 'whoami' && sub == null) {
610
- if (typeof provider.whoami !== 'function') {
611
- throw Object.assign(new Error('whoami not implemented for provider'), {
612
- forgeError: forgeError(
613
- ERROR_CODES.PROVIDER_UNSUPPORTED,
614
- 'whoami not implemented for provider',
615
- ),
616
- });
617
- }
618
- packet = forgePacket(PACKET_TYPES.PROVIDER_IDENTITY, ctx, await provider.whoami(ctx));
619
- } else if (group === 'sync' && sub === 'plan') {
620
- const remote = flags.remote || ctx.config.remote;
621
- assertGitRemote(remote, '--remote');
622
- packet = forgePacket(
623
- PACKET_TYPES.SYNC_PLAN,
624
- ctx,
625
- await provider.syncPlan(ctx, remote),
626
- );
627
- } else {
628
- throw Object.assign(new Error(`Unknown command: ${positional.join(' ')}`), {
629
- forgeError: forgeError(
630
- ERROR_CODES.INVALID_ARGS,
631
- 'Unknown command. Try: provider capabilities, repo status, refs compare, refs inventory, cr inventory, cr files, cr comments, cr open, status set, forge changes, pr view, pr checks, merge plan, sync plan, whoami, branch protection',
632
- ),
633
- });
634
- }
65
+ const packet = await dispatchForgeCommand({ group, sub, flags, positional, ctx, provider });
635
66
  output(packet, asJson);
67
+ if (!packet.ok) process.exitCode = 1;
636
68
  } catch (err) {
637
69
  handleError(err, ctx, asJson);
638
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remogram/cli",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.8",
4
4
  "description": "Remogram forge boundary CLI",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,11 +27,11 @@
27
27
  "node": ">=20"
28
28
  },
29
29
  "dependencies": {
30
- "@remogram/core": "0.1.0-beta.5",
31
- "@remogram/provider-gitea-api": "0.1.0-beta.5",
32
- "@remogram/provider-github-api": "0.1.0-beta.5",
33
- "@remogram/provider-gitlab-api": "0.1.0-beta.5",
34
- "@remogram/provider-gitea-tea": "0.1.0-beta.5",
35
- "@remogram/provider-github-gh": "0.1.0-beta.5"
30
+ "@remogram/core": "0.1.0-beta.8",
31
+ "@remogram/provider-gitea-api": "0.1.0-beta.8",
32
+ "@remogram/provider-github-api": "0.1.0-beta.8",
33
+ "@remogram/provider-gitlab-api": "0.1.0-beta.8",
34
+ "@remogram/provider-gitea-tea": "0.1.0-beta.8",
35
+ "@remogram/provider-github-gh": "0.1.0-beta.8"
36
36
  }
37
37
  }