bug: generate -f flag doesn't support -f=value syntax, is inconsistent #725

Closed
opened 2025-10-14 16:11:01 -06:00 by navan · 0 comments
Owner

Originally created by @eriknelson on 5/15/2025

Description

The tm generate command fails when the -f flag (for the tasks file path) is provided using the equals sign syntax (-f=/path/to/tasks.json). The CLI incorrectly includes the equals sign as part of the file path string, leading to a "No such file or directory" (ENOENT) error.

When the -f flag is provided with a space separator (-f /path/to/tasks.json), the command works correctly.

Steps to Reproduce

  1. Navigate to your project directory where Task Master is used.
  2. Ensure you have a tasks.json file, for example at $(pwd)/tm/tasks/packer/tasks.json.
  3. Run the tm generate command using the -f= syntax:
    tm generate -f=$(pwd)/tm/tasks/packer/tasks.json --output=$(pwd)/tm/tasks/packer
    
  4. Observe that the command fails with an ENOENT error, and the error message includes the equals sign in the reported file path (=/home/...).
  5. Run the tm generate command again, but this time using the -f space syntax:
    tm generate -f $(pwd)/tm/tasks/packer/tasks.json --output=$(pwd)/tm/tasks/packer
    
  6. Observe that the command executes successfully.

Expected Behavior

The tm generate -f flag should correctly parse the file path regardless of whether it is specified as -f /path/to/tasks.json or -f=/path/to/tasks.json. The equals sign, if present when using the -f=value syntax, should be treated as a separator between the flag and its value and should not be included as part of the file path string.

Actual Behavior

When using the -f=/path syntax, the command attempts to open a file path that starts with an equals sign (e.g., =/home/.../tasks.json), resulting in a "No such file or directory" error. The command only succeeds when the space syntax (-f /path) is used.

Screenshots or Logs

Failing Command (-f= syntax):

# tm generate -f=$(pwd)/tm/tasks/packer/tasks.json --output=/tm/tasks/packer
  _____         _      __  __           _
 |_   _|_ _ ___| | __ |  \/  | __ _ ___| |_ ___ _ __
   | |/ _` / __| |/ / | |\/| |/ _` / __| __/ _ \ '__|
   | | (_| \__ \   <  | |  | | (_| \__ \ ||  __/ |
   |_|\__,_|___/_|\_\ |_|  |_|\__,_|___/\__\___|_|

by https://x.com/eyaltoledano
╭────────────────────────────────────────────╮
│                                            │
│   Version: unknown   Project: Taskmaster   │
│                                            │
╰────────────────────────────────────────────╯

Generating task files from: =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json
Output directory: /tm/tasks/packer
[INFO] Preparing to regenerate task files in =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json
[ERROR] Error reading JSON file =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json: ENOENT: no such file or directory, open '=/home/ernelson/git/strategium/tm/tasks/packer/tasks.json'
[ERROR] Error generating task files: No valid tasks found in =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json
Error generating task files: No valid tasks found in =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json

(Notice the equals sign included in the file path: =/home/ernelson/...)

Successful Command (-f space syntax):

# tm generate -f $(pwd)/tm/tasks/packer/tasks.json --output=$(pwd)/tm/tasks/packer
  _____         _      __  __           _
 |_   _|_ _ ___| | __ |  \/  | __ _ ___| |_ ___ _ __
   | |/ _` / __| |/ / | |\/| |/ _` / __| __/ _ \ '__|
   | | (_| \__ \   <  | |  | | (_| \__ \ ||  __/ |
   |_|\__,_|___/_|\_\ |_|  |_|\__,_|___/\__\___|_|

by https://x.com/eyaltoledano
╭────────────────────────────────────────────╮
│                                            │
│   Version: unknown   Project: Taskmaster   │
│                                            │
╰────────────────────────────────────────────╯

Generating task files from: /home/ernelson/git/strategium/tm/tasks/packer/tasks.json
Output directory: /home/ernelson/git/strategium/tm/tasks/packer
[INFO] Preparing to regenerate task files in /home/ernelson/git/strategium/tm/tasks/packer/tasks.json
[INFO] Found 15 tasks to regenerate
[INFO] Validating and fixing dependencies
[INFO] Generating individual task files...
[SUCCESS] All 15 tasks have been generated into '/home/ernelson/git/strategium/tm/tasks/packer'.

(Notice the equals sign is correctly omitted from the file path: /home/ernelson/...)

Environment

  • Task Master version: v0.13.2
  • Node.js version: v22.14.0
  • Operating system: Arch Linux
  • IDE (if applicable): cli (via ZSH), cursor (v0.50.4), and roo + ms vscode

Additional Context

  • This behavior appears inconsistent with how other flags (like --output) might be handled by standard CLI argument parsers, which typically support both -f value and -f=value syntax for single-value options like file paths.
  • This inconsistency can potentially cause issues when using mcp servers, I've
    seen them confused by issues similar to this. One example is it's often unclear
    to the model if, when passing the file argument, it is expected to be prepended
    with a leading / or not, and how that gets merged with the projectRoot.
*Originally created by @eriknelson on 5/15/2025* ### Description The `tm generate` command fails when the `-f` flag (for the tasks file path) is provided using the equals sign syntax (`-f=/path/to/tasks.json`). The CLI incorrectly includes the equals sign as part of the file path string, leading to a "No such file or directory" (`ENOENT`) error. When the `-f` flag is provided with a space separator (`-f /path/to/tasks.json`), the command works correctly. ### Steps to Reproduce 1. Navigate to your project directory where Task Master is used. 2. Ensure you have a `tasks.json` file, for example at `$(pwd)/tm/tasks/packer/tasks.json`. 3. Run the `tm generate` command using the `-f=` syntax: ```bash tm generate -f=$(pwd)/tm/tasks/packer/tasks.json --output=$(pwd)/tm/tasks/packer ``` 4. Observe that the command fails with an `ENOENT` error, and the error message includes the equals sign in the reported file path (`=/home/...`). 5. Run the `tm generate` command again, but this time using the `-f` space syntax: ```bash tm generate -f $(pwd)/tm/tasks/packer/tasks.json --output=$(pwd)/tm/tasks/packer ``` 6. Observe that the command executes successfully. ### Expected Behavior The `tm generate -f` flag should correctly parse the file path regardless of whether it is specified as `-f /path/to/tasks.json` or `-f=/path/to/tasks.json`. The equals sign, if present when using the `-f=value` syntax, should be treated as a separator between the flag and its value and should not be included as part of the file path string. ### Actual Behavior When using the `-f=/path` syntax, the command attempts to open a file path that starts with an equals sign (e.g., `=/home/.../tasks.json`), resulting in a "No such file or directory" error. The command only succeeds when the space syntax (`-f /path`) is used. ### Screenshots or Logs **Failing Command (`-f=` syntax):** ``` # tm generate -f=$(pwd)/tm/tasks/packer/tasks.json --output=/tm/tasks/packer _____ _ __ __ _ |_ _|_ _ ___| | __ | \/ | __ _ ___| |_ ___ _ __ | |/ _` / __| |/ / | |\/| |/ _` / __| __/ _ \ '__| | | (_| \__ \ < | | | | (_| \__ \ || __/ | |_|\__,_|___/_|\_\ |_| |_|\__,_|___/\__\___|_| by https://x.com/eyaltoledano ╭────────────────────────────────────────────╮ │ │ │ Version: unknown Project: Taskmaster │ │ │ ╰────────────────────────────────────────────╯ Generating task files from: =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json Output directory: /tm/tasks/packer [INFO] Preparing to regenerate task files in =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json [ERROR] Error reading JSON file =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json: ENOENT: no such file or directory, open '=/home/ernelson/git/strategium/tm/tasks/packer/tasks.json' [ERROR] Error generating task files: No valid tasks found in =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json Error generating task files: No valid tasks found in =/home/ernelson/git/strategium/tm/tasks/packer/tasks.json ``` *(Notice the equals sign included in the file path: `=/home/ernelson/...`)* **Successful Command (`-f` space syntax):** ``` # tm generate -f $(pwd)/tm/tasks/packer/tasks.json --output=$(pwd)/tm/tasks/packer _____ _ __ __ _ |_ _|_ _ ___| | __ | \/ | __ _ ___| |_ ___ _ __ | |/ _` / __| |/ / | |\/| |/ _` / __| __/ _ \ '__| | | (_| \__ \ < | | | | (_| \__ \ || __/ | |_|\__,_|___/_|\_\ |_| |_|\__,_|___/\__\___|_| by https://x.com/eyaltoledano ╭────────────────────────────────────────────╮ │ │ │ Version: unknown Project: Taskmaster │ │ │ ╰────────────────────────────────────────────╯ Generating task files from: /home/ernelson/git/strategium/tm/tasks/packer/tasks.json Output directory: /home/ernelson/git/strategium/tm/tasks/packer [INFO] Preparing to regenerate task files in /home/ernelson/git/strategium/tm/tasks/packer/tasks.json [INFO] Found 15 tasks to regenerate [INFO] Validating and fixing dependencies [INFO] Generating individual task files... [SUCCESS] All 15 tasks have been generated into '/home/ernelson/git/strategium/tm/tasks/packer'. ``` *(Notice the equals sign is correctly omitted from the file path: `/home/ernelson/...`)* ### Environment - Task Master version: `v0.13.2` - Node.js version: v22.14.0 - Operating system: Arch Linux - IDE (if applicable): cli (via ZSH), cursor (v0.50.4), and roo + ms vscode ### Additional Context - This behavior appears inconsistent with how other flags (like `--output`) might be handled by standard CLI argument parsers, which typically support both `-f value` and `-f=value` syntax for single-value options like file paths. - This inconsistency can potentially cause issues when using mcp servers, I've seen them confused by issues similar to this. One example is it's often unclear to the model if, when passing the file argument, it is expected to be prepended with a leading `/` or not, and how that gets merged with the `projectRoot`.
Sign in to join this conversation.
No labels
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:ai-models
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:cli
area:installation
area:installation
area:installation
area:installation
area:installation
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:mcp
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:task-management
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
area:vscode-extension
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
documentation
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
feedback
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
good first issue
help wanted
help wanted
help wanted
help wanted
help wanted
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
high-priority
integration request
integration request
integration request
integration request
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
low-priority
low-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
medium-priority
provider:anthropic
provider:anthropic
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:claude-code
provider:gemini-cli
provider:openai
provider:perplexity
question
question
question
question
question
question
question
question
question
question
question
question
question
question
refactor
refactor
wontfix
wontfix
wontfix
wontfix
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/claude-task-master#725
No description provided.