Skip to content

Commit f39d0bd

Browse files
committed
fix(import): launch TUI wizard when running agentcore import with no args
Previously `agentcore import` with no --source flag showed help text. Now it launches the interactive ImportFlow TUI, matching the pattern used by `agentcore add` and other commands.
1 parent 6f6be66 commit f39d0bd

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/cli/commands/import/command.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,20 @@ export const registerImport = (program: Command) => {
2222
.option('-y, --yes', 'Auto-confirm prompts')
2323
.action(async (cliOptions: { source?: string; target?: string; yes?: boolean }) => {
2424
if (!cliOptions.source) {
25-
// No --source and no subcommand — show help
26-
importCmd.outputHelp();
25+
// No --source and no subcommand — launch interactive TUI
26+
const { requireProject } = await import('../../tui/guards/project');
27+
requireProject();
28+
const { render } = await import('ink');
29+
const React = await import('react');
30+
const { ImportFlow } = await import('../../tui/screens/import');
31+
const { clear, unmount } = render(
32+
React.createElement(ImportFlow, {
33+
onBack: () => {
34+
clear();
35+
unmount();
36+
},
37+
})
38+
);
2739
return;
2840
}
2941

0 commit comments

Comments
 (0)