Skip to content

Commit d452fc8

Browse files
committed
feat(import): add workflow import functionality with TUI dialog
- Implement new import command and dialog for workflow packages - Remove -codemachine suffix requirement for imports - Add fuzzysort dependency for package search - Create new UI components: TerminalLink, ProgressStep, StatusBadge - Add import route to home commands and slash commands
1 parent 31f785d commit d452fc8

File tree

14 files changed

+688
-54
lines changed

14 files changed

+688
-54
lines changed

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"@opentui/solid": "^0.1.73",
7474
"chalk": "^5.6.2",
7575
"commander": "^14.0.1",
76+
"fuzzysort": "^3.1.0",
7677
"proper-lockfile": "^4.1.2",
7778
"solid-js": "^1.9.10",
7879
"update-notifier": "^7.3.1",

src/cli/commands/import.command.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
unregisterImport,
2424
getAllInstalledImports,
2525
getInstalledImport,
26-
getRequiredSuffix,
2726
} from '../../shared/imports/index.js';
2827

2928
interface ImportCommandOptions {
@@ -196,8 +195,8 @@ function listImports(): void {
196195
if (imports.length === 0) {
197196
console.log('\nNo imports installed.');
198197
console.log(`\nTo install an import, use:`);
199-
console.log(` codemachine import <package-name${getRequiredSuffix()}>`);
200-
console.log(` codemachine import <owner>/<repo${getRequiredSuffix()}>`);
198+
console.log(` codemachine import <package-name>`);
199+
console.log(` codemachine import <owner>/<repo>`);
201200
console.log(` codemachine import <https://github.com/...>`);
202201
return;
203202
}
@@ -244,8 +243,8 @@ async function runImportCommand(
244243
if (!source) {
245244
console.error('❌ Please specify a source to import.');
246245
console.log('\nUsage:');
247-
console.log(` codemachine import <package-name${getRequiredSuffix()}>`);
248-
console.log(` codemachine import <owner>/<repo${getRequiredSuffix()}>`);
246+
console.log(` codemachine import <package-name>`);
247+
console.log(` codemachine import <owner>/<repo>`);
249248
console.log(` codemachine import <https://github.com/...>`);
250249
console.log('\nOther options:');
251250
console.log(' codemachine import --list List installed imports');

src/cli/tui/routes/home/config/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const HOME_COMMANDS = {
4646
TEMPLATE: "/template",
4747
LOGIN: "/login",
4848
LOGOUT: "/logout",
49+
IMPORT: "/import",
4950
EXIT: "/exit",
5051
QUIT: "/quit",
5152
} as const

0 commit comments

Comments
 (0)