@4ge/cli 0.2.0 → 0.2.1

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/dist/base.js CHANGED
@@ -117,7 +117,7 @@ export class BaseCommand extends Command {
117
117
  options?.onStatusChange?.('refreshing-token');
118
118
  const credential = await ensureFreshToken();
119
119
  if (!credential) {
120
- const message = 'Not authenticated. Run `4ge auth login --token <api_key>` first.';
120
+ const message = 'Not authenticated. Run `4ge auth:login --token <api_key>` first.';
121
121
  if (this.isJsonMode) {
122
122
  this.outputErrorAndExit({ message, code: 'NO_CREDENTIALS' });
123
123
  }
@@ -12,7 +12,7 @@ export default class AuthStatus extends BaseCommand {
12
12
  this.outputErrorAndExit({ message: 'Not authenticated', code: 'NO_CREDENTIALS' });
13
13
  }
14
14
  else {
15
- this.log('Not authenticated. Run `4ge auth login --token <api_key>` to authenticate.');
15
+ this.log('Not authenticated. Run `4ge auth:login --token <api_key>` to authenticate.');
16
16
  }
17
17
  return;
18
18
  }
@@ -37,7 +37,7 @@ export default class AuthStatus extends BaseCommand {
37
37
  this.outputErrorAndExit({
38
38
  message,
39
39
  code,
40
- hint: refreshError.message || "Run '4ge auth login' to re-authenticate."
40
+ hint: refreshError.message || "Run '4ge auth:login' to re-authenticate."
41
41
  });
42
42
  }
43
43
  else {
@@ -47,7 +47,7 @@ export default class AuthStatus extends BaseCommand {
47
47
  else {
48
48
  this.log('⚠ Session expired — token refresh failed.');
49
49
  }
50
- this.log(` ${refreshError.message || "Run '4ge auth login' to re-authenticate."}`);
50
+ this.log(` ${refreshError.message || "Run '4ge auth:login' to re-authenticate."}`);
51
51
  }
52
52
  return;
53
53
  }
@@ -65,7 +65,7 @@ export default class AuthStatus extends BaseCommand {
65
65
  this.outputErrorAndExit({
66
66
  message: 'API validation failed for 4GE_API_KEY',
67
67
  code: 'ENV_CREDENTIAL_OVERRIDE',
68
- hint: 'The 4GE_API_KEY environment variable is overriding stored credentials but is invalid. Unset it to use credentials from "4ge auth login".'
68
+ hint: 'The 4GE_API_KEY environment variable is overriding stored credentials but is invalid. Unset it to use credentials from "4ge auth:login".'
69
69
  });
70
70
  }
71
71
  else {
@@ -77,7 +77,7 @@ export default class AuthStatus extends BaseCommand {
77
77
  this.log('⚠ Using API key from 4GE_API_KEY environment variable, but server validation failed.');
78
78
  this.log('');
79
79
  this.log('The 4GE_API_KEY environment variable takes priority over stored credentials.');
80
- this.log('FIX: Unset 4GE_API_KEY (e.g., `unset 4GE_API_KEY`) to use credentials from `4ge auth login`.');
80
+ this.log('FIX: Unset 4GE_API_KEY (e.g., `unset 4GE_API_KEY`) to use credentials from `4ge auth:login`.');
81
81
  }
82
82
  else {
83
83
  this.log(`Authenticated via ${activeCredential.source}${activeCredential.profile ? ` (profile: ${activeCredential.profile})` : ''}, but API validation failed.`);
@@ -3,7 +3,7 @@ export default class ConfigIndex extends Command {
3
3
  static description = 'Manage CLI configuration';
4
4
  static hidden = true;
5
5
  async run() {
6
- this.log('Use `4ge config manage` for interactive configuration.');
7
- this.log('Use `4ge config show`, `4ge config get`, or `4ge config set` for direct access.');
6
+ this.log('Use `4ge config:manage` for interactive configuration.');
7
+ this.log('Use `4ge config:show`, `4ge config:get`, or `4ge config:set` for direct access.');
8
8
  }
9
9
  }
@@ -26,8 +26,8 @@ export default class ConfigShow extends BaseCommand {
26
26
  ] }));
27
27
  if (this.isInteractiveMode) {
28
28
  await this.handleActionHints([
29
- { label: 'Set config', command: '4ge config set <key> <value>' },
30
- { label: 'Get config', command: '4ge config get <key>' },
29
+ { label: 'Set config', command: '4ge config:set <key> <value>' },
30
+ { label: 'Get config', command: '4ge config:get <key>' },
31
31
  ]);
32
32
  }
33
33
  }
@@ -75,7 +75,7 @@ export default class EpicList extends BaseCommand {
75
75
  const selectedId = await this.selectOption('Select an epic for details:', options, { headerVariant: 'compact' });
76
76
  if (selectedId) {
77
77
  const { default: chalk } = await import('chalk');
78
- this.log(`\n 🚀 Run: ${chalk.cyan(`4ge epic show ${selectedId}`)}\n`);
78
+ this.log(`\n 🚀 Run: ${chalk.cyan(`4ge epic:show ${selectedId}`)}\n`);
79
79
  }
80
80
  }
81
81
  if (metadata?.action_hints) {
@@ -77,7 +77,7 @@ export default class FeatureList extends BaseCommand {
77
77
  const selectedId = await this.selectOption('Select a feature for details:', options, { headerVariant: 'compact' });
78
78
  if (selectedId) {
79
79
  const { default: chalk } = await import('chalk');
80
- this.log(`\n 🚀 Run: ${chalk.cyan(`4ge feature show ${selectedId}`)}\n`);
80
+ this.log(`\n 🚀 Run: ${chalk.cyan(`4ge feature:show ${selectedId}`)}\n`);
81
81
  }
82
82
  }
83
83
  if (metadata?.action_hints) {
@@ -69,7 +69,7 @@ export default class FlowList extends BaseCommand {
69
69
  const selectedId = await this.selectOption('Select a flow for details:', options, { headerVariant: 'compact' });
70
70
  if (selectedId) {
71
71
  const { default: chalk } = await import('chalk');
72
- this.log(`\n 🚀 Run: ${chalk.cyan(`4ge flow show ${selectedId}`)}\n`);
72
+ this.log(`\n 🚀 Run: ${chalk.cyan(`4ge flow:show ${selectedId}`)}\n`);
73
73
  }
74
74
  }
75
75
  if (metadata?.action_hints) {
@@ -74,8 +74,8 @@ export default class IdeaGraduate extends BaseCommand {
74
74
  if (this.isInteractiveMode) {
75
75
  const { default: chalk } = await import('chalk');
76
76
  this.log(`\n 🚀 Next steps:`);
77
- this.log(` - Project info: ${chalk.cyan(`4ge project info --id ${result.id}`)}`);
78
- this.log(` - Pull plan: ${chalk.cyan(`4ge plan pull --project ${result.id}`)}`);
77
+ this.log(` - Project info: ${chalk.cyan(`4ge project:info --id ${result.id}`)}`);
78
+ this.log(` - Pull plan: ${chalk.cyan(`4ge plan:pull --project ${result.id}`)}`);
79
79
  if (metadata?.action_hints) {
80
80
  await this.handleActionHints(metadata.action_hints);
81
81
  }
@@ -326,7 +326,7 @@ export default class Init extends BaseCommand {
326
326
  this.log(`Skill installed at: ${skillPath}`);
327
327
  this.log(chalk.dim('Reload your AI agent to pick up the new skill.'));
328
328
  }
329
- this.log(chalk.dim('\nConfigure additional settings with: 4ge config manage'));
329
+ this.log(chalk.dim('\nConfigure additional settings with: 4ge config:manage'));
330
330
  this.log(chalk.dim('Available: default mode, hierarchy settings, pull settings\n'));
331
331
  }
332
332
  }
@@ -1,5 +1,5 @@
1
1
  import AuthLogin from './auth/login.js';
2
2
  export default class Login extends AuthLogin {
3
- static description = 'Alias for `4ge auth login`';
3
+ static description = 'Alias for `4ge auth:login`';
4
4
  static hidden = false;
5
5
  }
@@ -4,6 +4,6 @@ export default class Project extends BaseCommand {
4
4
  static hidden = true;
5
5
  async run() {
6
6
  await this.renderHeader('ready', 'compact');
7
- this.log('Use `4ge project list` to list projects.');
7
+ this.log('Use `4ge project:list` to list projects.');
8
8
  }
9
9
  }
@@ -62,7 +62,7 @@ export default class ProjectList extends BaseCommand {
62
62
  const selectedId = await this.selectOption('Select a project for details:', options, { headerVariant: 'compact' });
63
63
  if (selectedId) {
64
64
  const { default: chalk } = await import('chalk');
65
- this.log(`\n 🚀 Run: ${chalk.cyan(`4ge project show ${selectedId}`)}\n`);
65
+ this.log(`\n 🚀 Run: ${chalk.cyan(`4ge project:show ${selectedId}`)}\n`);
66
66
  }
67
67
  }
68
68
  if (metadata?.action_hints) {
@@ -65,7 +65,7 @@ export default class StoryList extends BaseCommand {
65
65
  const selectedId = await this.selectOption('Select a story for details:', options, { headerVariant: 'compact' });
66
66
  if (selectedId) {
67
67
  const { default: chalk } = await import('chalk');
68
- this.log(`\n 🚀 Run: ${chalk.cyan(`4ge story show ${selectedId}`)}\n`);
68
+ this.log(`\n 🚀 Run: ${chalk.cyan(`4ge story:show ${selectedId}`)}\n`);
69
69
  }
70
70
  }
71
71
  if (metadata?.action_hints) {
@@ -66,7 +66,7 @@ export default class TemplateList extends BaseCommand {
66
66
  const selectedId = await this.selectOption('Select a template for details:', options, { headerVariant: 'compact' });
67
67
  if (selectedId) {
68
68
  const { default: chalk } = await import('chalk');
69
- this.log(`\n 🚀 Run: ${chalk.cyan(`4ge template info --id ${selectedId}`)}\n`);
69
+ this.log(`\n 🚀 Run: ${chalk.cyan(`4ge template:info --id ${selectedId}`)}\n`);
70
70
  }
71
71
  }
72
72
  if (metadata?.action_hints) {
@@ -87,8 +87,8 @@ export default class TemplatePull extends BaseCommand {
87
87
  }
88
88
  if (this.isInteractiveMode) {
89
89
  await this.handleActionHints([
90
- { label: 'List template features', command: `4ge template feature list ${templateId}` },
91
- { label: 'Project info', command: '4ge project info' },
90
+ { label: 'List template features', command: `4ge template:feature:list ${templateId}` },
91
+ { label: 'Project info', command: '4ge project:info' },
92
92
  ]);
93
93
  }
94
94
  }
@@ -1,5 +1,5 @@
1
1
  import AuthStatus from './auth/status.js';
2
2
  export default class Whoami extends AuthStatus {
3
- static description = 'Alias for `4ge auth status`';
3
+ static description = 'Alias for `4ge auth:status`';
4
4
  static hidden = false;
5
5
  }
@@ -16,7 +16,7 @@ export function isAuthError(error) {
16
16
  */
17
17
  export function getAuthErrorHint(error) {
18
18
  if (error?.code === 'TOKEN_EXPIRED') {
19
- return "Run '4ge auth login' to re-authenticate";
19
+ return "Run '4ge auth:login' to re-authenticate";
20
20
  }
21
21
  if (error?.code === 'INVALID_API_KEY') {
22
22
  return 'Check your 4GE_API_KEY environment variable';
@@ -146,7 +146,7 @@ export function createApiClient(opts) {
146
146
  code: isPatAuth ? 'INVALID_API_KEY' : 'TOKEN_EXPIRED',
147
147
  hint: isPatAuth
148
148
  ? 'Check your 4GE_API_KEY environment variable'
149
- : "Run '4ge auth login' to re-authenticate",
149
+ : "Run '4ge auth:login' to re-authenticate",
150
150
  };
151
151
  return authError;
152
152
  }
@@ -66,7 +66,7 @@ export async function ensureFreshToken() {
66
66
  }
67
67
  if (result.error || !result.data) {
68
68
  // Server is reachable and explicitly rejected the refresh token.
69
- throw new Error(`Session expired. Please re-authenticate: run '4ge auth login'\n` +
69
+ throw new Error(`Session expired. Please re-authenticate: run '4ge auth:login'\n` +
70
70
  `Details: ${result.error?.message || 'Refresh token is invalid or expired'}`);
71
71
  }
72
72
  try {
@@ -33,5 +33,5 @@ export function generateReadmeMd(project, filesGenerated) {
33
33
  ${fileLinks}
34
34
 
35
35
  ---
36
- *Generated by \`4ge project pull\` on ${date}*`;
36
+ *Generated by \`4ge project:pull\` on ${date}*`;
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4ge/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "4ge Service Architecture Bridge & CLI",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/skills/4ge-cli.md CHANGED
@@ -13,15 +13,30 @@ Before using this CLI, the user **MUST** have completed:
13
13
  The CLI is already installed and configured in this project.
14
14
 
15
15
  ## ⌨️ Command Syntax
16
- All interactions follow this structure:
16
+
17
+ **Convention (hard rule):** commands are `4ge <namespace>:<command> [--params]` —
18
+ a colon between namespace and command, **never a space**.
19
+
20
+ | Correct | Wrong |
21
+ |---|---|
22
+ | `4ge epic:list` | ~~`4ge epic list`~~ |
23
+ | `4ge project:pull --json` | ~~`4ge project pull --json`~~ |
24
+ | `4ge flow:show --id <id>` | ~~`4ge flow show --id <id>`~~ |
25
+ | `4ge auth:status` | ~~`4ge auth status`~~ |
26
+
27
+ Nested commands chain with more colons: `4ge template:feature:list`.
28
+ A few root commands take no colon (`4ge init`, `4ge whoami`, `4ge login`) —
29
+ single words with no nested command.
30
+
31
+ Full form:
17
32
 
18
33
  ```bash
19
34
  4ge <namespace>:<command> [options] --json
20
35
  ```
21
36
 
22
- - **Namespace:Command**: Colon-separated (e.g. `epic:list`, `story:show`, `auth:status`).
23
- - **Required flag**: `--json` is **mandatory** in agent mode for machine-readable output.
24
- - **Positional arguments**: A few commands take a direct arg without a flag (e.g. `idea:show <ID>`).
37
+ - **`--json` is mandatory** in agent mode for machine-readable output.
38
+ - **Positional arguments**: a few commands take a direct arg without a flag
39
+ (e.g. `4ge idea:show <ID>`).
25
40
 
26
41
  ## 🛠 Usage Guidelines
27
42