From 304044a2f15ec0dc15bff649c6e1504d76187270 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Thu, 29 Jan 2026 21:18:16 +0900 Subject: [PATCH] fix: read version from package.json instead of hardcoded 0.1.0 (closes #3) - Read CLI version dynamically from package.json via createRequire - Fix unused variable lint errors (branch destructuring) - Bump version to 0.2.3 Co-Authored-By: Claude Opus 4.5 --- package.json | 2 +- src/cli.ts | 10 +++++++--- src/commands/taskExecution.ts | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1084bef..84b8320 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "takt", - "version": "0.2.5", + "version": "0.2.3", "description": "TAKT: Task Agent Koordination Tool - AI Agent Workflow Orchestration", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/cli.ts b/src/cli.ts index 1844be9..be07349 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -12,6 +12,7 @@ * takt /config - Select permission mode interactively */ +import { createRequire } from 'node:module'; import { Command } from 'commander'; import { resolve } from 'node:path'; import { @@ -42,6 +43,9 @@ import { summarizeTaskName } from './task/summarize.js'; import { DEFAULT_WORKFLOW_NAME } from './constants.js'; import { checkForUpdates } from './utils/updateNotifier.js'; +const require = createRequire(import.meta.url); +const { version: cliVersion } = require('../package.json') as { version: string }; + const log = createLogger('cli'); checkForUpdates(); @@ -85,7 +89,7 @@ const program = new Command(); program .name('takt') .description('TAKT: Task Agent Koordination Tool') - .version('0.1.0'); + .version(cliVersion); program .argument('[task]', 'Task to execute or slash command') @@ -119,7 +123,7 @@ program } log.info('TAKT CLI starting', { - version: '0.1.0', + version: cliVersion, cwd, task: task || null, verbose, @@ -226,7 +230,7 @@ program } // Ask whether to create a worktree - const { execCwd, isWorktree, branch } = await confirmAndCreateWorktree(cwd, task); + const { execCwd, isWorktree } = await confirmAndCreateWorktree(cwd, task); log.info('Starting task execution', { task, workflow: selectedWorkflow, worktree: isWorktree }); const taskSuccess = await executeTask(task, execCwd, selectedWorkflow, cwd); diff --git a/src/commands/taskExecution.ts b/src/commands/taskExecution.ts index fce4095..08f2c42 100644 --- a/src/commands/taskExecution.ts +++ b/src/commands/taskExecution.ts @@ -74,7 +74,7 @@ export async function executeAndCompleteTask( const executionLog: string[] = []; try { - const { execCwd, execWorkflow, isWorktree, branch } = await resolveTaskExecution(task, cwd, workflowName); + const { execCwd, execWorkflow, isWorktree } = await resolveTaskExecution(task, cwd, workflowName); // cwd is always the project root; pass it as projectCwd so reports/sessions go there const taskSuccess = await executeTask(task.content, execCwd, execWorkflow, cwd);