Repository navigation
feat(cli): titles, references, JSON output and restoring deleted pastes - #72
Conversation
Creating a paste takes a CreateOptions struct instead of a growing list of positional arguments, and passes title and reference_url along with the existing syntax, expiry and visibility parameters. Pastes now carry their id, title, reference link, share and raw URLs and timestamps, all optional so older servers still decode. New calls list removed pastes, restore one and delete one for good. Pastes serialize the way the server represents them, with binary content base64 encoded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fnjMN7WpEjQJD2zveakV6
- create takes --title and --reference (alias --ref) and prints the server's share link. - create, show, delete, deleted and restore accept --json and print a single line of JSON, so scripts can read ids, links and metadata. - delete explains how to restore the paste; delete --permanent removes it for good, including one that was already deleted. - deleted lists restorable pastes with their reason, purge date and title. - restore brings a deleted or expired paste back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fnjMN7WpEjQJD2zveakV6
|
Oracle review complete: signed off, with no blocking findings in the CLI/client changes. Integrated the reviewed PR71 reference-metadata fix via a history-preserving merge; no Rust code changes were needed. Final validation: cargo fmt --check, cargo clippy --workspace --all-features -- -D warnings, cargo test --workspace, mix precommit (563 ExUnit tests plus JS tests), and mix credo passed. Compatibility note from review: older server responses still decode (wire compatibility), but CreateOptions replaces the previous Rust method argument lists, so downstream Rust callers must migrate; source compatibility is not claimed. Review session: https://ampcode.com/threads/T-01a12594-e2f1-75be-b343-9239564f5c84 Post-push CI is green: memory/local/S3 Elixir tests, Rust tests, formatting/linting, and production-container build passed. Release/publication jobs skipped as expected. |
Summary
The second of two stacked PRs. Stacked on #71, whose endpoints it uses. It brings the Rust client and the CLI up to the redesigned paste model.
Client (
textbin-client)CreateOptionsstruct and sendstitleandreference_urlalong with syntax, expiry and visibility.list_removed_pastes,restore_pasteandpurge_paste.data, and binary content as base64.CLI (
textbin)create --title … --reference …(alias--ref) prints the server's share link.--jsononcreate,show,delete,deletedandrestoreprints one line of JSON for scripts. This covers the paste commands in RFD 3's "machine-readable--json" item. Theauthcommands are not covered yet.deletetells you how to restore the paste.delete --permanentdeletes it for good, including one that was already deleted.deletedlists restorable pastes with their reason, purge date and title.restore <id>brings a deleted or expired paste back.Test plan
cargo fmt --check,cargo clippy --workspace --all-features -- -D warningscargo test --workspace: 61 tests, 0 failures. New tests cover create query params, decoding links, JSON serialization of text and binary pastes, the deleted-collection requests against a stub server,deletedrow formatting and argument parsing.show --json,delete,deleted,restore,delete --permanent, and a restore of the purged paste, which returned 404.🤖 Generated with Claude Code
https://claude.ai/code/session_019fnjMN7WpEjQJD2zveakV6
Generated by Claude Code