When running tn list (or tn projects list), the CLI fails with:
Error: HTTP 400: {"success":false,"error":"For filtering tasks, please use POST /api/tasks/query which supports advanced filtering capabilities. GET /api/tasks is for basic listing only. See API documentation for details."}
Root Cause:
The listTasks() method in lib/api.js constructs a query string and sends a GET request to /api/tasks, but the TaskNotes HTTP API explicitly rejects GET requests to that endpoint and requires POST requests to /api/tasks/query.
Steps to Reproduce:
- Configure the CLI with a running TaskNotes API instance
- Run
tn list
- Observe HTTP 400 error
Expected Behavior:
tn list should successfully fetch tasks using the POST /api/tasks/query endpoint.
Actual Behavior:
Command fails with HTTP 400 and error message directing to use POST instead of GET.
Root Issue:
-
lib/api.js has two methods:
listTasks(filters) — uses GET (❌ broken)
queryTasks(filterQuery) — uses POST (✅ correct)
-
commands/list.js calls api.listTasks() for basic filtering, which sends GET requests.
-
The API no longer supports GET /api/tasks; it requires POST /api/tasks/query.
Solution:
Modify commands/list.js to use api.queryTasks() instead of api.listTasks() when handling both basic and advanced filters. The queryTasks() method already exists and correctly uses POST.
Affected Commands:
tn list
tn projects list (also uses listTasks())
- Any other command that calls
listTasks()
When running
tn list(ortn projects list), the CLI fails with:Root Cause:
The
listTasks()method inlib/api.jsconstructs a query string and sends a GET request to/api/tasks, but the TaskNotes HTTP API explicitly rejects GET requests to that endpoint and requires POST requests to/api/tasks/query.Steps to Reproduce:
tn listExpected Behavior:
tn listshould successfully fetch tasks using the POST/api/tasks/queryendpoint.Actual Behavior:
Command fails with HTTP 400 and error message directing to use POST instead of GET.
Root Issue:
lib/api.jshas two methods:listTasks(filters)— uses GET (❌ broken)queryTasks(filterQuery)— uses POST (✅ correct)commands/list.jscallsapi.listTasks()for basic filtering, which sends GET requests.The API no longer supports GET
/api/tasks; it requires POST/api/tasks/query.Solution:
Modify
commands/list.jsto useapi.queryTasks()instead ofapi.listTasks()when handling both basic and advanced filters. ThequeryTasks()method already exists and correctly uses POST.Affected Commands:
tn listtn projects list(also useslistTasks())listTasks()