Conversation
README.md
Outdated
| # 1) Get data by path | ||
| PUBKY_CLI_RECOVERY_PASSPHRASE=pass \ | ||
| cargo run -- user get /pub/my-cool-app/hello.txt ./alice.recovery | ||
|
|
||
| # 2) Publish data from file |
There was a problem hiding this comment.
Nitpick: but maybe publish/get/delete would be more natural order of operations
|
Some review feedback from Codex: 🍒 Key feedbackRepeated sign‑in / sign‑out pattern isn’t resilience-friendlyIn all three helpers (publish_data, delete_data, get_data) the session is torn down only on the “happy path”. If storage.put/get/delete throws, you’ll skip the signout() call. Consider wrapping the signout in a match/finally block or call it in a drop guard so the session always gets closed. Path validationstorage.put/delete/get expect an absolute Pubky path. Right now the CLI just forwards the string verbatim. It’d be safer to run it through PubkyResource::parse / ResourcePath::parse (or at least validate the /pub/... prefix) so users get a nice error rather than the SDK error. get assumes UTF-8 text.text() forces UTF-8; any binary file (even Lightning backups) will panic. You’ll probably want to stream bytes and either dump stdout as-is or add --outfile. Until then, document that this command is text-only. CLI UX details
|
|
I guess that's fine for the MVP |
|
we can also move the session creation/destroy to separate functions, but this is for refactor. |
No description provided.