sn-cli
sn-cli copied to clipboard
[FR] allow publishing in Listed
I just found this project from the Standard Notes Reddit while look for a CLI program to interact with Standard Notes. So far I am happy with what I see apart from typing email and password for each command.
I was looking into Standard Notes because with Listed.to, it allows people to publish anonymous blog. I am really excited about Listed.to and it's feature. If I were to use it, I would spin up a minimal VM and install a CLI client to write and publish the blog but as of now it is not possible to do it with this program as it requires sign in and extensions are not supported as well.
It would be very helpful for a lot of privacy concern people if this feature is implemented.
Thanks for the great tool!
Hi @fazlerabbi37, thanks for the feedback.
You don't need to type email and password each time if you are on MacOS or Linux. Just run sn session --add and follow the prompts. After that, you can just use sn --use-session <command>. That also works if you are using MFA as the token that gets stored does not require MFA for subsequent authentication. For an extra level of security, the stored session can be encypted (before storing in keyring/keychain) but that does require entering a password at a prompt.
IIRC, I didn't provide options for --username and --password as that would mean credentials would be echoed to the shell and I didn't think that a good idea.
Not sure what you mean by requiring sign-in and lack of support for extensions. What did you have in mind?
After that, you can just use sn --use-session
Thanks for the hint! I must have missed it. Would you consider passing the --use-session by default so that we don't need to use the flag every time also because as of now it only usages one session and replace if new one is added.
Not sure what you mean by requiring sign-in
would you allow using this tool without sign in so that people can use it locally without syncing?
and lack of support for extensions
I was talking about a service, Listed.to, that integrates with Standard Notes via the extension and allows people to publish anonymous blog.
If the CLI program were to support usages without sign in and blog publishing via Listed.to with the integration of extension it would be really helpful.
I've just released a new version that includes the ability to specify --use-session in an environment variable, i.e. export SN_USE_SESSION=yes
https://github.com/jonhadfield/sn-cli/releases/tag/0.1.0-beta2
I've not considered local-only use but I've included local storage in this release so will look into it. Btw, local storage means that, after an initial sync, it only needs to push/pull deltas for each operation, making it much faster if you have lots of items.
I haven't looked at how Listed.to works but assume you're basically giving permission to a completely separate app that reads items from your SN account. Will have a look.
Was this ever looked into? Would like a way to programmatically public to Listed
Back in November there was a major change to the way SN does encryption, and I've just about finished updating my library to support it: https://github.com/jonhadfield/gosn-v2. Now working on updating this app to make use of it. In the meantime, I'll ask the SN team if it's possible.
Seems it is possible: https://github.com/standardnotes/listed/blob/develop/app/controllers/authors_controller.rb#L158 Will take a look once I've finished getting sn-cli sorted.