From a4bc3d17074a2fdc04f38881e5d3398b4369f745 Mon Sep 17 00:00:00 2001 From: ngoc Date: Mon, 26 Jan 2026 10:32:53 +0700 Subject: [PATCH] Update terminal --- cli/commands/dev.ts | 36 ++++++++++++++++++++++++++++++++++++ package.json | 3 +-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/cli/commands/dev.ts b/cli/commands/dev.ts index 095e379..0a2cac7 100644 --- a/cli/commands/dev.ts +++ b/cli/commands/dev.ts @@ -205,6 +205,42 @@ export async function runDevCommand(cliDir: string, envPath?: string) { process.on('SIGINT', cleanup); process.on('SIGTERM', cleanup); + // Open a new terminal + console.log(`\n${colors.green}✅ Setup complete!${colors.reset}`); + console.log(`${colors.blue}Opening new terminal...${colors.reset}\n`); + + try { + // For macOS, open a new Terminal window + if (process.platform === 'darwin') { + spawn('osascript', [ + '-e', + `tell application "Terminal" to do script "cd ${process.cwd()}"` + ], { detached: true, stdio: 'ignore' }).unref(); + } + // For Linux, try common terminal emulators + else if (process.platform === 'linux') { + const terminals = ['gnome-terminal', 'konsole', 'xterm']; + for (const term of terminals) { + if (commandExists(term)) { + spawn(term, ['--working-directory', process.cwd()], { + detached: true, + stdio: 'ignore' + }).unref(); + break; + } + } + } + // For Windows + else if (process.platform === 'win32') { + spawn('cmd', ['/c', 'start', 'cmd', '/K', `cd /d ${process.cwd()}`], { + detached: true, + stdio: 'ignore' + }).unref(); + } + } catch (e) { + console.log(`${colors.yellow}⚠️ Could not open new terminal automatically${colors.reset}`); + } + // Keep process alive await new Promise(() => {}); } diff --git a/package.json b/package.json index 4373ecb..875a9d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nla", - "version": "1.0.1", + "version": "1.0.0", "description": "Natural Language Agreement Oracle - CLI for creating and managing blockchain agreements using natural language", "type": "module", "private": false, @@ -43,7 +43,6 @@ "patch": "npm version patch", "minor": "npm version minor", "major": "npm version major", - "publish": "npm publish --dry-run", "dev": "bun run index.ts", "start": "bun run index.ts", "test": "bun test ./tests --exclude alkahest-ts/** ",