Workflowy CLI with usage reports

Hey folks, long-time user and big fan of Workflowy here!

I wrote a CLI using the latest API, in Go. Aside from the expected CRUD operations, it can generate usage reports, including a descendant count (i.e.,direct children plus descendants) to get a sense of where your data resides. It also tries to intelligently use the Get or ExportAll API depending on the use case, caches the content locally, and works with a backup file if you don’t want to get an API key.

I appreciate any and all feedback.

8 Likes

Hello marc

This is wonderful. I’ve just started exploring it.

A recommendation: The pbcopy command isn’t a thing on Linux. You might add to your README.md something like “In Linux, use wl-copy (under Wayland) or xclip (under X11).”

A tip: When I tried uploading a report back into my Workflowy, I got a rate-limit error. To get the full report into WF and maintain formatting, I pasted the output of the report subcommand into StackEdit then immediately copied and pasted it from there into WF. A bit of extra work but I ended up with a tree from which I could navigate to the relevant parts of my WF for paring, edits, etc.

A question: would a find-and-replace command be possible?

Hi Michael,

Thank you for your feedback. Much appreciated. I updated the README to include Linux systems.

Yes, the rate-limiting on upload is an issue. I could perhaps warn if the number of nodes to upload is higher than 60 (I think the rate limit is 60/min), or add an option to limit the report to 60 nodes when uploading.

In my testing though, you should be able to copy and paste directly into WF, since it is markdown and WF will accept markdown. Are you sure you need the StackEdit step?

find-and-replace is very doable (assuming the same upload rate limits though), and something I have found myself needing as well. I’ll add to the feature request list. Shouldn’t be too difficult.

Thanks again!

Hi Marc,

Cheers!

Could my need for StackEdit come from Mac and Linux handling clipboards differently? Or maybe I’m doing it wrong?

When I run workflowy report count -f markdown, the output includes html formatting e.g. <span> and <b>. Example:

- [<b>🪷 <span class="colored c-blue">realms</span></b>](https://workflowy.com/#/redacted-wf-guid) (57.4%, 46336 descendants)

When I paste this into WF (either manually copied from the terminal with Ctrl-Shift-C or piping to wl-copy) I get this:

When I paste into StackEdit then copy-paste the result into WF, I get this

(In WF Settings, my “Recognize markdown pasting” is on.)

What do you think?

Michael

Oh interesting, I see the issue. WF is exporting formatting as HTML, and not as Markdown. It seems StackEdit is either stripping the HTML tags (or converting them back to Markdown), which WF them imports properly. I could probably do the same in the report generation, perhaps controlled with a flag.

I’ll add that the feature request list! Thanks!

1 Like

Hi Michael,

I’ve released a new version since last week, with a few things:

  • a “search and replace” command, which works on one item or their children (configurable with –item-id and –depth)
  • fixed the issue with links containing html tags so that copy/paste works correctly
  • fixed the issue where uploaded reports would not contain links
  • a “targets” and a “delete” command
  • a few other bugs (full list at workflowy/CHANGELOG.md at main · mholzen/workflowy · GitHub )

You can get it via brew update then brew upgrade workflowy-cli

As always, I welcome feedback. Hope this helps!

Marc