Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI question #4

Open
cjlm opened this issue Sep 15, 2021 · 9 comments
Open

CLI question #4

cjlm opened this issue Sep 15, 2021 · 9 comments

Comments

@cjlm
Copy link
Owner

cjlm commented Sep 15, 2021

I forgot to enable Issues on the repo so @markfirmware opened a PR with a question instead...

Does this include a cli that I can use to fetch wf data? If so, how is it installed and run?
opusfluxus is not working for me - keeps asking for my email.

Yes, there is a CLI although I haven't documented it as it's not fully tested. I also found that opusfluxus wasn't working but I'm not clear how it's different from send-to-workflowy now. The CLI should work if you do the following in the base directory:

yarn
node wf-cli

It uses the same logic as opusfluxus to save your credentials to a file in your $HOME

Please note that I'll be moving it into it's own yarn workspace in the next release. It shouldn't be in the base directory like it is now.

Let me know how you get on @markfirmware!

@cjlm cjlm mentioned this issue Sep 15, 2021
@markfirmware
Copy link

Actually, ignoring that error and entering my email, I get:

Login successful.
Failed to write sessionid to config

@cjlm
Copy link
Owner Author

cjlm commented Sep 16, 2021

Hmm, strange. I'll look into it.

What auth do you use with WF? Password? Multifactor? Email code?

@cjlm
Copy link
Owner Author

cjlm commented Sep 16, 2021

Looks like it's working correctly but is unable to save to HOME when using GitPod.

The initial error needs fixing though

@cjlm
Copy link
Owner Author

cjlm commented Sep 16, 2021

I'm not sure about the gitpod config bit but there was a pretty obvious mistake in the auth code. I've fixed it on the cli-fix branch for a future merge

@markfirmware
Copy link

Thanks! I tried fix-cli:

What is your workflowy login info? This will not be saved, merely used once to authenticate.
✔ Email: …  #xxx@xxx
err TypeError: Cannot read property 'split' of null
at Object.parseCookies (/workspace/send-to-workflowy/utils.js:5:10)
at WorkflowyClient.login (/workspace/send-to-workflowy/index.js:68:31)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async auth (/workspace/send-to-workflowy/wf-cli.js:217:5)
at async initialize (/workspace/send-to-workflowy/wf-cli.js:17:5)
at async Command.<anonymous> (/workspace/send-to-workflowy/wf-cli.js:93:16)
at async Command.parseAsync (/workspace/send-to-workflowy/node_modules/commander/lib/command.js:871:5)
Login successful.

Since I only entered my email and not a password or the like, I think the successful message is not accurate.

@cjlm
Copy link
Owner Author

cjlm commented Sep 16, 2021

Argh. I've pushed a fix for the cookies thing too. It may work now but it's clear the error handling needs an overhaul.

@cjlm
Copy link
Owner Author

cjlm commented Sep 17, 2021

That appears to resolve it for me on gitpod:

gitpod /workspace/send-to-workflowy $ node wf-cli tree 1
⦿ fetching workflowy tree
No config detected... starting authentication process...
What is your workflowy login info? This will not be saved, merely used once to authenticate.
✔ Email: … <email>
✔ Password … ********************************************************
Login successful.
Your session id is: <sessionid>
Successfully wrote sessionid to /home/gitpod/.config/send-to-workflowy-nodejs/config.json

@markfirmware
Copy link

I am still having trouble on gitpod. I will add a report later tonight.

@cjlm
Copy link
Owner Author

cjlm commented Oct 5, 2021

Any update @markfirmware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants