@elaraai/e3-cli 0.0.2-beta.9 → 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.
Files changed (135) hide show
  1. package/LICENSE.md +4 -0
  2. package/README.md +169 -46
  3. package/dist/src/cli.js +197 -73
  4. package/dist/src/cli.js.map +1 -1
  5. package/dist/src/commands/auth.d.ts +23 -0
  6. package/dist/src/commands/auth.d.ts.map +1 -0
  7. package/dist/src/commands/auth.js +200 -0
  8. package/dist/src/commands/auth.js.map +1 -0
  9. package/dist/src/commands/complete.d.ts +14 -0
  10. package/dist/src/commands/complete.d.ts.map +1 -0
  11. package/dist/src/commands/complete.js +166 -0
  12. package/dist/src/commands/complete.js.map +1 -0
  13. package/dist/src/commands/complete.spec.d.ts +6 -0
  14. package/dist/src/commands/complete.spec.d.ts.map +1 -0
  15. package/dist/src/commands/complete.spec.js +63 -0
  16. package/dist/src/commands/complete.spec.js.map +1 -0
  17. package/dist/src/commands/completion-install.d.ts +47 -0
  18. package/dist/src/commands/completion-install.d.ts.map +1 -0
  19. package/dist/src/commands/completion-install.js +141 -0
  20. package/dist/src/commands/completion-install.js.map +1 -0
  21. package/dist/src/commands/completion-install.spec.d.ts +6 -0
  22. package/dist/src/commands/completion-install.spec.d.ts.map +1 -0
  23. package/dist/src/commands/completion-install.spec.js +136 -0
  24. package/dist/src/commands/completion-install.spec.js.map +1 -0
  25. package/dist/src/commands/completion.d.ts +12 -0
  26. package/dist/src/commands/completion.d.ts.map +1 -0
  27. package/dist/src/commands/completion.js +75 -0
  28. package/dist/src/commands/completion.js.map +1 -0
  29. package/dist/src/commands/completion.spec.d.ts +6 -0
  30. package/dist/src/commands/completion.spec.d.ts.map +1 -0
  31. package/dist/src/commands/completion.spec.js +48 -0
  32. package/dist/src/commands/completion.spec.js.map +1 -0
  33. package/dist/src/commands/convert.impl.spec.d.ts +6 -0
  34. package/dist/src/commands/convert.impl.spec.d.ts.map +1 -0
  35. package/dist/src/commands/convert.impl.spec.js +245 -0
  36. package/dist/src/commands/convert.impl.spec.js.map +1 -0
  37. package/dist/src/commands/dataset-status.d.ts +9 -0
  38. package/dist/src/commands/dataset-status.d.ts.map +1 -0
  39. package/dist/src/commands/dataset-status.js +77 -0
  40. package/dist/src/commands/dataset-status.js.map +1 -0
  41. package/dist/src/commands/find.d.ts +17 -0
  42. package/dist/src/commands/find.d.ts.map +1 -0
  43. package/dist/src/commands/find.js +59 -0
  44. package/dist/src/commands/find.js.map +1 -0
  45. package/dist/src/commands/find.spec.d.ts +6 -0
  46. package/dist/src/commands/find.spec.d.ts.map +1 -0
  47. package/dist/src/commands/find.spec.js +43 -0
  48. package/dist/src/commands/find.spec.js.map +1 -0
  49. package/dist/src/commands/get.d.ts +3 -0
  50. package/dist/src/commands/get.d.ts.map +1 -1
  51. package/dist/src/commands/get.js +43 -20
  52. package/dist/src/commands/get.js.map +1 -1
  53. package/dist/src/commands/get.spec.d.ts +6 -0
  54. package/dist/src/commands/get.spec.d.ts.map +1 -0
  55. package/dist/src/commands/get.spec.js +28 -0
  56. package/dist/src/commands/get.spec.js.map +1 -0
  57. package/dist/src/commands/list.d.ts +6 -2
  58. package/dist/src/commands/list.d.ts.map +1 -1
  59. package/dist/src/commands/list.js +189 -30
  60. package/dist/src/commands/list.js.map +1 -1
  61. package/dist/src/commands/logs.d.ts.map +1 -1
  62. package/dist/src/commands/logs.js +96 -70
  63. package/dist/src/commands/logs.js.map +1 -1
  64. package/dist/src/commands/package.d.ts.map +1 -1
  65. package/dist/src/commands/package.js +78 -18
  66. package/dist/src/commands/package.js.map +1 -1
  67. package/dist/src/commands/repo.d.ts +44 -0
  68. package/dist/src/commands/repo.d.ts.map +1 -0
  69. package/dist/src/commands/repo.js +278 -0
  70. package/dist/src/commands/repo.js.map +1 -0
  71. package/dist/src/commands/run.d.ts +12 -0
  72. package/dist/src/commands/run.d.ts.map +1 -1
  73. package/dist/src/commands/run.js +21 -13
  74. package/dist/src/commands/run.js.map +1 -1
  75. package/dist/src/commands/run.spec.d.ts +6 -0
  76. package/dist/src/commands/run.spec.d.ts.map +1 -0
  77. package/dist/src/commands/run.spec.js +39 -0
  78. package/dist/src/commands/run.spec.js.map +1 -0
  79. package/dist/src/commands/set.d.ts +1 -0
  80. package/dist/src/commands/set.d.ts.map +1 -1
  81. package/dist/src/commands/set.js +33 -32
  82. package/dist/src/commands/set.js.map +1 -1
  83. package/dist/src/commands/start.d.ts.map +1 -1
  84. package/dist/src/commands/start.js +270 -52
  85. package/dist/src/commands/start.js.map +1 -1
  86. package/dist/src/commands/watch.d.ts +5 -2
  87. package/dist/src/commands/watch.d.ts.map +1 -1
  88. package/dist/src/commands/watch.js +32 -26
  89. package/dist/src/commands/watch.js.map +1 -1
  90. package/dist/src/commands/workspace.d.ts +12 -1
  91. package/dist/src/commands/workspace.d.ts.map +1 -1
  92. package/dist/src/commands/workspace.js +332 -38
  93. package/dist/src/commands/workspace.js.map +1 -1
  94. package/dist/src/credentials.d.ts +123 -0
  95. package/dist/src/credentials.d.ts.map +1 -0
  96. package/dist/src/credentials.js +213 -0
  97. package/dist/src/credentials.js.map +1 -0
  98. package/dist/src/format.d.ts +18 -0
  99. package/dist/src/format.d.ts.map +1 -0
  100. package/dist/src/format.js +43 -0
  101. package/dist/src/format.js.map +1 -0
  102. package/dist/src/path-resolver.d.ts +86 -0
  103. package/dist/src/path-resolver.d.ts.map +1 -0
  104. package/dist/src/path-resolver.js +241 -0
  105. package/dist/src/path-resolver.js.map +1 -0
  106. package/dist/src/path-resolver.spec.d.ts +6 -0
  107. package/dist/src/path-resolver.spec.d.ts.map +1 -0
  108. package/dist/src/path-resolver.spec.js +247 -0
  109. package/dist/src/path-resolver.spec.js.map +1 -0
  110. package/dist/src/utils.d.ts +76 -1
  111. package/dist/src/utils.d.ts.map +1 -1
  112. package/dist/src/utils.js +104 -1
  113. package/dist/src/utils.js.map +1 -1
  114. package/dist/src/utils.spec.d.ts +6 -0
  115. package/dist/src/utils.spec.d.ts.map +1 -0
  116. package/dist/src/utils.spec.js +199 -0
  117. package/dist/src/utils.spec.js.map +1 -0
  118. package/package.json +22 -18
  119. package/scripts/postinstall.cjs +26 -0
  120. package/dist/src/commands/gc.d.ts +0 -12
  121. package/dist/src/commands/gc.d.ts.map +0 -1
  122. package/dist/src/commands/gc.js +0 -44
  123. package/dist/src/commands/gc.js.map +0 -1
  124. package/dist/src/commands/init.d.ts +0 -9
  125. package/dist/src/commands/init.d.ts.map +0 -1
  126. package/dist/src/commands/init.js +0 -33
  127. package/dist/src/commands/init.js.map +0 -1
  128. package/dist/src/commands/status.d.ts +0 -9
  129. package/dist/src/commands/status.d.ts.map +0 -1
  130. package/dist/src/commands/status.js +0 -157
  131. package/dist/src/commands/status.js.map +0 -1
  132. package/dist/src/commands/tree.d.ts +0 -14
  133. package/dist/src/commands/tree.d.ts.map +0 -1
  134. package/dist/src/commands/tree.js +0 -77
  135. package/dist/src/commands/tree.js.map +0 -1
package/dist/src/cli.js CHANGED
@@ -6,157 +6,281 @@
6
6
  /**
7
7
  * e3 CLI - East Execution Engine command-line interface
8
8
  *
9
- * All commands take a repository path as the first argument (`.` for current directory).
9
+ * Top-level command tree:
10
+ *
11
+ * repo create | remove | status | gc | list
12
+ * package import | export | list | remove
13
+ * workspace create | remove | list | status | deploy | export
14
+ * dataset get | set | list | status | find
15
+ * task logs | list
16
+ * dataflow run
17
+ * auth login | logout | status | token | whoami
18
+ * run <pkg.task> <inputs...> -o <out> (ad-hoc)
19
+ * watch <source> [<ws>]
20
+ * convert <input> [...]
21
+ *
22
+ * Every command that takes <repo> accepts a local path or http(s) URL — the
23
+ * transport is detected from the argument.
10
24
  */
11
25
  import { createRequire } from 'node:module';
12
26
  import { Command } from 'commander';
13
- import { initCommand } from './commands/init.js';
14
27
  const require = createRequire(import.meta.url);
15
28
  const packageJson = require('../../package.json');
29
+ import { repoCommand } from './commands/repo.js';
16
30
  import { packageCommand } from './commands/package.js';
17
31
  import { workspaceCommand } from './commands/workspace.js';
18
32
  import { listCommand } from './commands/list.js';
19
- import { treeCommand } from './commands/tree.js';
20
33
  import { getCommand } from './commands/get.js';
21
34
  import { setCommand } from './commands/set.js';
22
35
  import { startCommand } from './commands/start.js';
23
36
  import { runCommand } from './commands/run.js';
24
37
  import { logsCommand } from './commands/logs.js';
25
- import { statusCommand } from './commands/status.js';
26
- import { gcCommand } from './commands/gc.js';
38
+ import { datasetStatusCommand } from './commands/dataset-status.js';
39
+ import { findCommand } from './commands/find.js';
27
40
  import { convertCommand } from './commands/convert.js';
28
41
  import { watchCommand } from './commands/watch.js';
42
+ import { createAuthCommand } from './commands/auth.js';
43
+ import { completionCommand } from './commands/completion.js';
44
+ import { installCommand as completionInstall, uninstallCommand as completionUninstall } from './commands/completion-install.js';
45
+ import { completeCommand } from './commands/complete.js';
46
+ import { withDefaultRepo, defaultRepoArg } from './utils.js';
29
47
  const program = new Command();
30
48
  program
31
49
  .name('e3')
32
50
  .description('East Execution Engine - Execute tasks across multiple runtimes')
33
51
  .version(packageJson.version);
34
- // Repository commands
35
- program
36
- .command('init <repo>')
37
- .description('Initialize a new e3 repository')
38
- .action(initCommand);
39
- program
40
- .command('status <repo> [workspace]')
41
- .description('Show repository status, or detailed workspace status if workspace provided')
42
- .action(statusCommand);
52
+ // ---------------------------------------------------------------------------
53
+ // repo
54
+ // ---------------------------------------------------------------------------
43
55
  program
44
- .command('gc <repo>')
56
+ .command('repo')
57
+ .description('Repository operations')
58
+ .addCommand(new Command('create')
59
+ .description('Create a new repository')
60
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
61
+ .action(withDefaultRepo(repoCommand.create)))
62
+ .addCommand(new Command('remove')
63
+ .description('Remove a repository')
64
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
65
+ .option('-r, --recursive', 'Remove all workspaces first')
66
+ .action(withDefaultRepo(repoCommand.remove)))
67
+ .addCommand(new Command('status')
68
+ .description('Show repository status')
69
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
70
+ .action(withDefaultRepo(repoCommand.status)))
71
+ .addCommand(new Command('gc')
45
72
  .description('Remove unreferenced objects')
73
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
46
74
  .option('--dry-run', 'Report what would be deleted without deleting')
47
75
  .option('--min-age <ms>', 'Minimum file age in ms before deletion', '60000')
48
- .action(gcCommand);
49
- // Package commands
76
+ .action(withDefaultRepo(repoCommand.gc)))
77
+ .addCommand(new Command('list')
78
+ .description('List repositories on a server')
79
+ .argument('<server>', 'Server URL (e.g., http://localhost:3000)')
80
+ .action(repoCommand.list));
81
+ // ---------------------------------------------------------------------------
82
+ // package
83
+ // ---------------------------------------------------------------------------
50
84
  program
51
85
  .command('package')
52
86
  .description('Package operations')
53
87
  .addCommand(new Command('import')
54
88
  .description('Import package from .zip file')
55
- .argument('<repo>', 'Repository path')
89
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
56
90
  .argument('<zipPath>', 'Path to .zip file')
57
- .action(packageCommand.import))
91
+ .action(withDefaultRepo(packageCommand.import)))
58
92
  .addCommand(new Command('export')
59
93
  .description('Export package to .zip file')
60
- .argument('<repo>', 'Repository path')
94
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
61
95
  .argument('<pkg>', 'Package name[@version]')
62
96
  .argument('<zipPath>', 'Output .zip path')
63
- .action(packageCommand.export))
97
+ .action(withDefaultRepo(packageCommand.export)))
64
98
  .addCommand(new Command('list')
65
99
  .description('List installed packages')
66
- .argument('<repo>', 'Repository path')
67
- .action(packageCommand.list))
100
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
101
+ .action(withDefaultRepo(packageCommand.list)))
68
102
  .addCommand(new Command('remove')
69
103
  .description('Remove a package')
70
- .argument('<repo>', 'Repository path')
104
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
71
105
  .argument('<pkg>', 'Package name[@version]')
72
- .action(packageCommand.remove));
73
- // Workspace commands
106
+ .action(withDefaultRepo(packageCommand.remove)));
107
+ // ---------------------------------------------------------------------------
108
+ // workspace
109
+ // ---------------------------------------------------------------------------
74
110
  program
75
111
  .command('workspace')
76
112
  .description('Workspace operations')
77
113
  .addCommand(new Command('create')
78
114
  .description('Create an empty workspace')
79
- .argument('<repo>', 'Repository path')
115
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
80
116
  .argument('<name>', 'Workspace name')
81
- .action(workspaceCommand.create))
117
+ .action(withDefaultRepo(workspaceCommand.create)))
82
118
  .addCommand(new Command('deploy')
83
119
  .description('Deploy a package to a workspace')
84
- .argument('<repo>', 'Repository path')
120
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
85
121
  .argument('<ws>', 'Workspace name')
86
- .argument('<pkg>', 'Package name[@version]')
87
- .action(workspaceCommand.deploy))
122
+ .argument('[pkg]', 'Package name[@version] (omit when using --from-zip)')
123
+ .option('--from-zip <path>', 'Import the zip and deploy (creates the workspace if needed)')
124
+ .action(withDefaultRepo(workspaceCommand.deploy)))
88
125
  .addCommand(new Command('export')
89
126
  .description('Export workspace as a package')
90
- .argument('<repo>', 'Repository path')
127
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
91
128
  .argument('<ws>', 'Workspace name')
92
129
  .argument('<zipPath>', 'Output .zip path')
93
130
  .option('--name <name>', 'Package name (default: deployed package name)')
94
131
  .option('--version <version>', 'Package version (default: auto-generated)')
95
- .action(workspaceCommand.export))
132
+ .action(withDefaultRepo(workspaceCommand.export)))
96
133
  .addCommand(new Command('list')
97
134
  .description('List workspaces')
98
- .argument('<repo>', 'Repository path')
99
- .action(workspaceCommand.list))
135
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
136
+ .action(withDefaultRepo(workspaceCommand.list)))
100
137
  .addCommand(new Command('remove')
101
138
  .description('Remove a workspace')
102
- .argument('<repo>', 'Repository path')
139
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
103
140
  .argument('<ws>', 'Workspace name')
104
- .action(workspaceCommand.remove));
105
- // Dataset commands
106
- program
107
- .command('list <repo> [path]')
108
- .description('List workspaces or tree contents at path (ws.path.to.tree)')
109
- .action(listCommand);
110
- program
111
- .command('tree <repo> <path>')
112
- .description('Show full tree structure at path (ws or ws.subtree)')
113
- .option('--depth <n>', 'Maximum depth to display')
114
- .option('--types', 'Show dataset types')
115
- .action(treeCommand);
141
+ .action(withDefaultRepo(workspaceCommand.remove)))
142
+ .addCommand(new Command('status')
143
+ .description('Show detailed workspace status (tasks, datasets, locks)')
144
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
145
+ .argument('<ws>', 'Workspace name')
146
+ .action(withDefaultRepo(workspaceCommand.status)));
147
+ // ---------------------------------------------------------------------------
148
+ // dataset
149
+ // ---------------------------------------------------------------------------
116
150
  program
117
- .command('get <repo> <path>')
118
- .description('Get dataset value at path (ws.path.to.dataset)')
151
+ .command('dataset')
152
+ .description('Dataset operations within a workspace')
153
+ .addCommand(new Command('get')
154
+ .description('Print a dataset value (path: <ws>.<name>)')
155
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
156
+ .argument('<path>', 'Dataset path (<ws>.<name>)')
119
157
  .option('-f, --format <format>', 'Output format: east, json, beast2', 'east')
120
- .action(getCommand);
121
- program
122
- .command('set <repo> <path> <file>')
123
- .description('Set dataset value from file (ws.path.to.dataset)')
124
- .option('--type <typespec>', 'Type specification in .east format (required for .json/.csv files)')
125
- .action(setCommand);
126
- // Execution commands
158
+ .action(withDefaultRepo(getCommand)))
159
+ .addCommand(new Command('set')
160
+ .description('Set a dataset value from a file (path: <ws>.<name>)')
161
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
162
+ .argument('<path>', 'Dataset path (<ws>.<name>)')
163
+ .argument('<file>', 'Path to .east, .beast2, .json, or .csv file')
164
+ .option('--type <typespec>', 'Inline .east type specification (required for .json/.csv)')
165
+ .option('--type-file <path>', 'Read .east type specification from a file (alternative to --type)')
166
+ .action(withDefaultRepo(setCommand)))
167
+ .addCommand(new Command('list')
168
+ .description('List dataset paths in a workspace')
169
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
170
+ .argument('<ws>', 'Workspace name')
171
+ .option('-l, --long', 'Show kind/type/status/size columns')
172
+ .action(withDefaultRepo(listCommand)))
173
+ .addCommand(new Command('status')
174
+ .description('Show status of a single dataset')
175
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
176
+ .argument('<path>', 'Dataset path (<ws>.<name>)')
177
+ .action(withDefaultRepo(datasetStatusCommand)))
178
+ .addCommand(new Command('find')
179
+ .description('Search dataset names by substring or glob pattern')
180
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
181
+ .argument('<ws>', 'Workspace name')
182
+ .argument('<pattern>', 'Substring or glob (`*`, `?`)')
183
+ .action(withDefaultRepo(findCommand)));
184
+ // ---------------------------------------------------------------------------
185
+ // task
186
+ // ---------------------------------------------------------------------------
127
187
  program
128
- .command('run <repo> <task> [inputs...]')
129
- .description('Run task ad-hoc (task format: pkg/task or pkg@version/task)')
130
- .option('-o, --output <path>', 'Output file path')
131
- .option('--force', 'Force re-execution even if cached')
132
- .action(runCommand);
188
+ .command('task')
189
+ .description('Task operations within a workspace')
190
+ .addCommand(new Command('list')
191
+ .description('List tasks in a workspace with execution status')
192
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
193
+ .argument('<ws>', 'Workspace name')
194
+ .action((repo, ws) => logsCommand(defaultRepoArg(repo), ws, {})))
195
+ .addCommand(new Command('logs')
196
+ .description('View logs for a task')
197
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
198
+ .argument('<path>', 'Task path (<ws>.<task>)')
199
+ .option('--follow', 'Follow log output')
200
+ .action(withDefaultRepo(logsCommand)));
201
+ // ---------------------------------------------------------------------------
202
+ // dataflow
203
+ // ---------------------------------------------------------------------------
133
204
  program
134
- .command('start <repo> <ws>')
135
- .description('Execute tasks in a workspace')
205
+ .command('dataflow')
206
+ .description('Workspace dataflow execution')
207
+ .addCommand(new Command('run')
208
+ .description('Execute the workspace dataflow')
209
+ .argument('[repo]', 'Repository path or URL (default: $E3_REPO or .)')
210
+ .argument('<ws>', 'Workspace name')
136
211
  .option('--filter <pattern>', 'Only run tasks matching pattern')
137
212
  .option('--concurrency <n>', 'Max concurrent tasks', '4')
138
213
  .option('--force', 'Force re-execution even if cached')
139
- .action(startCommand);
214
+ .action(withDefaultRepo(startCommand)));
215
+ // ---------------------------------------------------------------------------
216
+ // auth
217
+ // ---------------------------------------------------------------------------
218
+ program.addCommand(createAuthCommand());
219
+ // ---------------------------------------------------------------------------
220
+ // run (ad-hoc) — uses pkg.task dot syntax
221
+ // ---------------------------------------------------------------------------
140
222
  program
141
- .command('watch <repo> <workspace> <source>')
223
+ .command('run')
224
+ .description('Run a task ad-hoc from a package (task: pkg.task or pkg@version.task)')
225
+ .argument('<repo>', 'Repository path or URL')
226
+ .argument('<task>', 'Task specifier: pkg.task or pkg@version.task')
227
+ .argument('[inputs...]', 'Input file paths (.beast2)')
228
+ .option('-o, --output <path>', 'Output file path')
229
+ .option('--force', 'Force re-execution even if cached')
230
+ .action(runCommand);
231
+ // ---------------------------------------------------------------------------
232
+ // watch — source first, workspace second
233
+ // ---------------------------------------------------------------------------
234
+ program
235
+ .command('watch')
142
236
  .description('Watch a TypeScript file and auto-deploy on changes')
237
+ .argument('<source>', 'TypeScript file to watch')
238
+ .argument('<repo>', 'Repository path or URL')
239
+ .argument('<workspace>', 'Workspace name')
143
240
  .option('--start', 'Execute dataflow after each deploy')
144
241
  .option('--concurrency <n>', 'Max concurrent tasks when using --start', '4')
145
242
  .option('--abort-on-change', 'Abort running execution when file changes')
146
243
  .action(watchCommand);
244
+ // ---------------------------------------------------------------------------
245
+ // convert
246
+ // ---------------------------------------------------------------------------
147
247
  program
148
- .command('logs <repo> <path>')
149
- .description('View task logs (path format: ws or ws.taskName)')
150
- .option('--follow', 'Follow log output')
151
- .action(logsCommand);
152
- // Utility commands
153
- program
154
- .command('convert [input]')
248
+ .command('convert')
155
249
  .description('Convert between .east, .json, and .beast2 formats')
250
+ .argument('[input]', 'Input file path (default: read from stdin)')
156
251
  .option('--from <format>', 'Input format: east, json, beast2 (default: auto-detect)')
157
252
  .option('--to <format>', 'Output format: east, json, beast2', 'east')
158
253
  .option('-o, --output <path>', 'Output file path (default: stdout)')
159
254
  .option('--type <typespec>', 'Type specification in .east format')
160
255
  .action(convertCommand);
256
+ // ---------------------------------------------------------------------------
257
+ // completion (shell scripts) + __complete (hidden handler for the scripts)
258
+ // ---------------------------------------------------------------------------
259
+ program
260
+ .command('completion')
261
+ .description('Shell tab-completion: install, uninstall, or print scripts')
262
+ .addCommand(new Command('install')
263
+ .description('Auto-detect shell and wire up completion in your rc file')
264
+ .option('--shell <shell>', 'Override shell detection: bash | zsh | fish')
265
+ .option('--quiet', 'Suppress output on success')
266
+ .action(completionInstall))
267
+ .addCommand(new Command('uninstall')
268
+ .description('Remove completion from your shell rc file')
269
+ .option('--shell <shell>', 'Override shell detection: bash | zsh | fish')
270
+ .action(completionUninstall))
271
+ .addCommand(new Command('bash')
272
+ .description('Print bash completion script (use `install` to wire it up automatically)')
273
+ .action(() => completionCommand('bash')))
274
+ .addCommand(new Command('zsh')
275
+ .description('Print zsh completion script')
276
+ .action(() => completionCommand('zsh')))
277
+ .addCommand(new Command('fish')
278
+ .description('Print fish completion script')
279
+ .action(() => completionCommand('fish')));
280
+ program
281
+ .command('__complete', { hidden: true })
282
+ .argument('<cword>', 'Index of the word being completed (0-based)')
283
+ .argument('[words...]', 'Words on the command line, excluding the leading e3')
284
+ .action(completeCommand);
161
285
  program.parse();
162
286
  //# sourceMappingURL=cli.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC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CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,0EAA0E,CAAC;KACvF,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAC3C;KACA,UAAU,CACT,IAAI,OAAO,CAAC,KAAK,CAAC;KACf,WAAW,CAAC,6BAA6B,CAAC;KAC1C,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAC1C;KACA,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,8BAA8B,CAAC;KAC3C,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAC3C,CAAC;AAEJ,OAAO;KACJ,OAAO,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KACvC,QAAQ,CAAC,SAAS,EAAE,6CAA6C,CAAC;KAClE,QAAQ,CAAC,YAAY,EAAE,qDAAqD,CAAC;KAC7E,MAAM,CAAC,eAAe,CAAC,CAAC;AAE3B,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Authentication commands for e3 CLI.
7
+ */
8
+ import { Command } from 'commander';
9
+ /**
10
+ * Create the auth command group.
11
+ *
12
+ * Includes login/logout/status/token/whoami all nested under `e3 auth`.
13
+ */
14
+ export declare function createAuthCommand(): Command;
15
+ /**
16
+ * Create the login command.
17
+ */
18
+ export declare function createLoginCommand(): Command;
19
+ /**
20
+ * Create the logout command.
21
+ */
22
+ export declare function createLogoutCommand(): Command;
23
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/commands/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2CpC;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAkF3C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAsE5C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAa7C"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Authentication commands for e3 CLI.
7
+ */
8
+ import { Command } from 'commander';
9
+ import { fetchDiscovery, startDeviceAuth, pollForTokens, setCredential, removeCredential, listCredentials, getCredential, getValidToken, isExpired, decodeJwtPayload, normalizeServerUrl, } from '../credentials.js';
10
+ import { formatError, exitError } from '../utils.js';
11
+ /**
12
+ * Try to open a URL in the default browser.
13
+ */
14
+ async function openBrowser(url) {
15
+ const { exec } = await import('node:child_process');
16
+ const { platform } = await import('node:os');
17
+ return new Promise((resolve) => {
18
+ let command;
19
+ switch (platform()) {
20
+ case 'darwin':
21
+ command = `open "${url}"`;
22
+ break;
23
+ case 'win32':
24
+ command = `start "" "${url}"`;
25
+ break;
26
+ default:
27
+ command = `xdg-open "${url}"`;
28
+ }
29
+ exec(command, (error) => {
30
+ resolve(!error);
31
+ });
32
+ });
33
+ }
34
+ /**
35
+ * Create the auth command group.
36
+ *
37
+ * Includes login/logout/status/token/whoami all nested under `e3 auth`.
38
+ */
39
+ export function createAuthCommand() {
40
+ const auth = new Command('auth')
41
+ .description('Authentication commands');
42
+ auth.addCommand(createLoginCommand());
43
+ auth.addCommand(createLogoutCommand());
44
+ // e3 auth status - List all saved credentials
45
+ auth
46
+ .command('status')
47
+ .description('List saved credentials')
48
+ .action(() => {
49
+ const creds = listCredentials();
50
+ if (creds.length === 0) {
51
+ console.log('No saved credentials.');
52
+ console.log('Run: e3 login <server>');
53
+ return;
54
+ }
55
+ console.log('Saved credentials:\n');
56
+ for (const { server, expiresAt } of creds) {
57
+ const expired = isExpired(expiresAt);
58
+ const status = expired ? '(expired)' : '(valid)';
59
+ console.log(` ${server} ${status}`);
60
+ console.log(` Token expires: ${expiresAt}`);
61
+ }
62
+ });
63
+ // e3 auth token <server> - Print access token for use with curl
64
+ auth
65
+ .command('token')
66
+ .description('Print access token for a server (for curl/debugging)')
67
+ .argument('<server>', 'Server URL')
68
+ .action(async (server) => {
69
+ const serverUrl = normalizeServerUrl(server);
70
+ try {
71
+ // getValidToken handles refresh automatically if token is expired
72
+ const token = await getValidToken(serverUrl);
73
+ // Print just the token, suitable for: curl -H "Authorization: Bearer $(e3 auth token <server>)"
74
+ console.log(token);
75
+ }
76
+ catch (err) {
77
+ exitError(formatError(err));
78
+ }
79
+ });
80
+ // e3 auth whoami [server] - Show current identity
81
+ auth
82
+ .command('whoami')
83
+ .description('Show current identity')
84
+ .argument('[server]', 'Server URL')
85
+ .action((server) => {
86
+ const creds = listCredentials();
87
+ if (creds.length === 0) {
88
+ console.log('Not logged in to any servers.');
89
+ return;
90
+ }
91
+ const servers = server ? [server] : creds.map((c) => c.server);
92
+ for (const serverUrl of servers) {
93
+ const credential = getCredential(serverUrl);
94
+ if (!credential) {
95
+ console.log(`${serverUrl}: Not logged in`);
96
+ continue;
97
+ }
98
+ try {
99
+ const payload = decodeJwtPayload(credential.accessToken);
100
+ const expired = isExpired(credential.expiresAt);
101
+ const status = expired ? '(token expired)' : '';
102
+ console.log(`${serverUrl}: ${status}`);
103
+ console.log(` Subject: ${payload.sub ?? 'unknown'}`);
104
+ if (payload.email) {
105
+ console.log(` Email: ${payload.email}`);
106
+ }
107
+ console.log(` Issuer: ${payload.iss ?? 'unknown'}`);
108
+ }
109
+ catch {
110
+ console.log(`${serverUrl}: Invalid token`);
111
+ }
112
+ }
113
+ });
114
+ return auth;
115
+ }
116
+ /**
117
+ * Create the login command.
118
+ */
119
+ export function createLoginCommand() {
120
+ return new Command('login')
121
+ .description('Log in to a server using OAuth2 Device Flow')
122
+ .argument('<server>', 'Server URL (e.g., http://localhost:3000)')
123
+ .option('--no-browser', 'Do not open browser (for CI/headless environments)')
124
+ .action(async (server, options) => {
125
+ const serverUrl = normalizeServerUrl(server);
126
+ console.log(`Logging in to ${serverUrl}...`);
127
+ // Fetch OIDC discovery document
128
+ let discovery;
129
+ try {
130
+ discovery = await fetchDiscovery(serverUrl);
131
+ }
132
+ catch (err) {
133
+ exitError(`Failed to connect to server: ${formatError(err)}\nMake sure the server is running with --oidc enabled.`);
134
+ }
135
+ // Start device authorization
136
+ let deviceAuth;
137
+ try {
138
+ deviceAuth = await startDeviceAuth(discovery);
139
+ }
140
+ catch (err) {
141
+ exitError(`Failed to start login: ${formatError(err)}`);
142
+ }
143
+ // Display user code and URL (unless in quiet CI mode)
144
+ if (options.browser) {
145
+ console.log('\nTo complete login:');
146
+ console.log(` 1. Open: ${deviceAuth.verification_uri}`);
147
+ console.log(` 2. Enter code: ${deviceAuth.user_code}`);
148
+ console.log(`\nOr visit this URL directly:`);
149
+ console.log(` ${deviceAuth.verification_uri_complete}`);
150
+ // Try to open browser
151
+ const opened = await openBrowser(deviceAuth.verification_uri_complete);
152
+ if (opened) {
153
+ console.log('\nBrowser opened. Waiting for approval...');
154
+ }
155
+ else {
156
+ console.log('\nWaiting for approval...');
157
+ }
158
+ }
159
+ else {
160
+ console.log('Waiting for server approval (--no-browser mode)...');
161
+ }
162
+ // Poll for tokens
163
+ try {
164
+ const tokens = await pollForTokens(discovery, deviceAuth.device_code, deviceAuth.interval, deviceAuth.expires_in);
165
+ // Save credentials
166
+ const entry = {
167
+ accessToken: tokens.access_token,
168
+ refreshToken: tokens.refresh_token,
169
+ expiresAt: new Date(Date.now() + tokens.expires_in * 1000).toISOString(),
170
+ };
171
+ setCredential(serverUrl, entry);
172
+ // Show identity
173
+ const payload = decodeJwtPayload(tokens.access_token);
174
+ console.log(`\nSuccessfully logged in as: ${payload.sub ?? 'unknown'}`);
175
+ console.log(`Token expires: ${entry.expiresAt}`);
176
+ }
177
+ catch (err) {
178
+ exitError(`Login failed: ${formatError(err)}`);
179
+ }
180
+ });
181
+ }
182
+ /**
183
+ * Create the logout command.
184
+ */
185
+ export function createLogoutCommand() {
186
+ return new Command('logout')
187
+ .description('Log out from a server')
188
+ .argument('<server>', 'Server URL')
189
+ .action((server) => {
190
+ const serverUrl = normalizeServerUrl(server);
191
+ const removed = removeCredential(serverUrl);
192
+ if (removed) {
193
+ console.log(`Logged out from ${serverUrl}`);
194
+ }
195
+ else {
196
+ console.log(`Not logged in to ${serverUrl}`);
197
+ }
198
+ });
199
+ }
200
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/commands/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,KAAK,UAAU,WAAW,CAAC,GAAW;IACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACpD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IAE7C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAe,CAAC;QACpB,QAAQ,QAAQ,EAAE,EAAE,CAAC;YACnB,KAAK,QAAQ;gBACX,OAAO,GAAG,SAAS,GAAG,GAAG,CAAC;gBAC1B,MAAM;YACR,KAAK,OAAO;gBACV,OAAO,GAAG,aAAa,GAAG,GAAG,CAAC;g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