Compare commits

..

2 Commits

Author SHA1 Message Date
Ralph Khreish
879409ac66 feat: improve tm init 2025-04-16 14:51:02 +02:00
Ralph Khreish
d9296614f8 chore: fix weird bug where package.json is not upgrading its version based on current package version 2025-04-16 14:48:20 +02:00
8 changed files with 37 additions and 43 deletions

View File

@@ -1,5 +0,0 @@
---
'task-master-ai': minor
---
Add `npx task-master-ai` that runs mcp instead of using `task-master-mcp``

View File

@@ -1,5 +0,0 @@
---
'task-master-ai': patch
---
Fixed a bug that prevented the task-master from running in a Linux container

View File

@@ -146,7 +146,7 @@ To enable enhanced task management capabilities directly within Cursor using the
4. Configure with the following details: 4. Configure with the following details:
- Name: "Task Master" - Name: "Task Master"
- Type: "Command" - Type: "Command"
- Command: "npx -y task-master-ai" - Command: "npx -y task-master-mcp"
5. Save the settings 5. Save the settings
Once configured, you can interact with Task Master's task management commands directly through Cursor's interface, providing a more integrated experience. Once configured, you can interact with Task Master's task management commands directly through Cursor's interface, providing a more integrated experience.

View File

@@ -20,14 +20,20 @@ A task management system for AI-driven development with Claude, designed to work
MCP (Model Control Protocol) provides the easiest way to get started with Task Master directly in your editor. MCP (Model Control Protocol) provides the easiest way to get started with Task Master directly in your editor.
1. **Add the MCP config to your editor** (Cursor recommended, but it works with other text editors): 1. **Install the package**
```bash
npm i -g task-master-ai
```
2. **Add the MCP config to your editor** (Cursor recommended, but it works with other text editors):
```json ```json
{ {
"mcpServers": { "mcpServers": {
"taskmaster-ai": { "taskmaster-ai": {
"command": "npx", "command": "npx",
"args": ["-y", "task-master-ai"], "args": ["-y", "task-master-mcp"],
"env": { "env": {
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE", "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE", "PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",

View File

@@ -10,14 +10,20 @@ There are two ways to set up Task Master: using MCP (recommended) or via npm ins
MCP (Model Control Protocol) provides the easiest way to get started with Task Master directly in your editor. MCP (Model Control Protocol) provides the easiest way to get started with Task Master directly in your editor.
1. **Add the MCP config to your editor** (Cursor recommended, but it works with other text editors): 1. **Install the package**
```bash
npm i -g task-master-ai
```
2. **Add the MCP config to your editor** (Cursor recommended, but it works with other text editors):
```json ```json
{ {
"mcpServers": { "mcpServers": {
"taskmaster-ai": { "taskmaster-ai": {
"command": "npx", "command": "npx",
"args": ["-y", "task-master-ai"], "args": ["-y", "task-master-mcp"],
"env": { "env": {
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE", "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY_HERE",
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE", "PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY_HERE",

View File

@@ -46,18 +46,22 @@ export const initProject = async (options = {}) => {
}; };
// Export a function to run init as a CLI command // Export a function to run init as a CLI command
export const runInitCLI = async (options = {}) => { export const runInitCLI = async () => {
try { // Using spawn to ensure proper handling of stdio and process exit
const init = await import('./scripts/init.js'); const child = spawn('node', [resolve(__dirname, './scripts/init.js')], {
const result = await init.initializeProject(options); stdio: 'inherit',
return result; cwd: process.cwd()
} catch (error) { });
console.error('Initialization failed:', error.message);
if (process.env.DEBUG === 'true') { return new Promise((resolve, reject) => {
console.error('Debug stack trace:', error.stack); child.on('close', (code) => {
} if (code === 0) {
throw error; // Re-throw to be handled by the command handler resolve();
} } else {
reject(new Error(`Init script exited with code ${code}`));
}
});
});
}; };
// Export version information // Export version information
@@ -75,21 +79,11 @@ if (import.meta.url === `file://${process.argv[1]}`) {
program program
.command('init') .command('init')
.description('Initialize a new project') .description('Initialize a new project')
.option('-y, --yes', 'Skip prompts and use default values') .action(() => {
.option('-n, --name <n>', 'Project name') runInitCLI().catch((err) => {
.option('-d, --description <description>', 'Project description')
.option('-v, --version <version>', 'Project version', '0.1.0')
.option('-a, --author <author>', 'Author name')
.option('--skip-install', 'Skip installing dependencies')
.option('--dry-run', 'Show what would be done without making changes')
.option('--aliases', 'Add shell aliases (tm, taskmaster)')
.action(async (cmdOptions) => {
try {
await runInitCLI(cmdOptions);
} catch (err) {
console.error('Init failed:', err.message); console.error('Init failed:', err.message);
process.exit(1); process.exit(1);
} });
}); });
program program

1
package-lock.json generated
View File

@@ -31,7 +31,6 @@
}, },
"bin": { "bin": {
"task-master": "bin/task-master.js", "task-master": "bin/task-master.js",
"task-master-ai": "mcp-server/server.js",
"task-master-mcp": "mcp-server/server.js" "task-master-mcp": "mcp-server/server.js"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -6,8 +6,7 @@
"type": "module", "type": "module",
"bin": { "bin": {
"task-master": "bin/task-master.js", "task-master": "bin/task-master.js",
"task-master-mcp": "mcp-server/server.js", "task-master-mcp": "mcp-server/server.js"
"task-master-ai": "mcp-server/server.js"
}, },
"scripts": { "scripts": {
"test": "node --experimental-vm-modules node_modules/.bin/jest", "test": "node --experimental-vm-modules node_modules/.bin/jest",