Doist / Doist/todoist-cli

`--labels` accepts an invalid `@`-prefixed label instead of stripping or rejecting it

Open
#550 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
310
Forks
18
Avg merge
10h 23m
Merged PRs (30d)
54

Description

Summary

td task add --labels "@Foo" attaches the label literally as @Foo. Since @ is display syntax and never part of a stored label name, this produces an invalid label: it renders as @@Foo in the UI and never appears in the UI's label-management list. The CLI accepts it silently — no strip, no warning, no error.

Repro (td 5.3.6)
td task add "repro" --labels "@ZZTEST_Mode:Foo" --json
# -> task labels: ["@ZZTEST_Mode:Foo"]

td label list --json
# -> appears under sharedLabels as "@ZZTEST_Mode:Foo"

In the Todoist UI the task shows @@ZZTEST_Mode:Foo, and the label does not appear in the label-management list — confirming it is not a valid label.

Actual

The CLI stores an invalid label name (leading @).

The fix (maintainers' call)

A leading @ in a --labels value is never valid. The CLI should not accept it as-is. Either option resolves it:

  • Strip the leading @ so @Foo and Foo resolve to the same label; or
  • Reject with a clear error.

We don't have a strong preference — the key point is that silently storing @Foo is wrong.

Note — inconsistency inside the CLI

td label remove-shared "@ZZTEST_Mode:Foo" already strips the @ and looks up ZZTEST_Mode:Foo:

Error: LABEL_NOT_FOUND
Shared label "ZZTEST_Mode:Foo" not found.

So the CLI normalises a leading @ on remove-shared, but not on the --labels apply path.

Bundled skill guidance

The package ships a todoist-cli agent skill (SKILL.md). Until the CLI handles this, the skill should teach agents the rule explicitly: never pass a @ to --labels (or an MCP labels array); the @ belongs only in td task quickadd strings, where the parser strips it. Ideally the skill says to strip a leading @ from any label value before applying.

Environment
  • td 5.3.6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the --labels apply path and compare its handling with td label remove-shared, which already strips a leading @; also inspect the bundled todoist-cli SKILL.md guidance and the quickadd/MCP label references. Reproduce with the commands in the issue, then ensure the chosen strip-or-reject behavior prevents @-prefixed labels from being stored and is reflected in the skill guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.