dstask icon indicating copy to clipboard operation
dstask copied to clipboard

dstask import-tw or dstask-import tw?

Open devhell opened this issue 3 years ago • 5 comments

Hi,

Love this project, thank you very much for it. Using git as a backend is such a good idea! I have been using taskwarrior until now and was looking at manually importing all my tasks when I notice the mentioned import mechanisms. I'm not clear if there's a difference between them, or if there's a preference for one over the other. Also, it seems that the import is not working, with either, from a taskwarrior (v2.6.0) export.

Using dstask import-tw export.json I receive: No tasks found. Run 'dstask help' for instructions. Using dstask-import tw < export.json I receive: failed to decode JSON from stdin

Any hints welcome :)

devhell avatar Nov 06 '22 20:11 devhell

Since I am playing around with dstask and imported my taskwarrior (v3.0.2) database to try it out, just a report for how to handle this:

The correct workflow currently is:

task export > tw.json
cat tw.json | dstask-import-linux-amd64 tw

(Or directly piping from taskw to dstask of course).

However, it also failed with the message failed to decode JSON from stdin for me.

The issue was that the import could not deal with any 'depends' fields in my taskwarrior export file. Once those had all been removed the import worked perfectly.

Since I am just trying the tool out I simply filtered each task line with the field (with :g/depends":/d in vim) but it seems reasonable that just removing the "depends:.." fields themselves would work without losing the associated tasks.

I am not sure if there was a change in the way taskwarrior represents dependencies in their exports, or if there is a bug in the dstask-import code but that seems to be where the issue was coming from on my end.

marty-oehme avatar Jun 22 '25 12:06 marty-oehme

Thanks for the comprehensive reply! I'll check it out. :)

devhell avatar Jul 05 '25 10:07 devhell

I also have this problem, even using cat.

cat taskwarrior.json| ./dstask-import-linux-amd64 tw
failed to decode JSON from stdin

I checked with jq that the taskwarrior json export is correctly formatted

clobrano avatar Oct 13 '25 11:10 clobrano

I also have this problem, even using cat.

cat taskwarrior.json| ./dstask-import-linux-amd64 tw
failed to decode JSON from stdin

I checked with jq that the taskwarrior json export is correctly formatted

the fix is mentioned 2 posts above by marty

niderhoff avatar Oct 18 '25 08:10 niderhoff

oh I'm sorry, I didn't read it all

clobrano avatar Oct 18 '25 16:10 clobrano