Repository navigation
Add verified README examples and an executable-README CI test - #16
Merged
Merged
Conversation
kwsantiago
force-pushed
the
readme-examples
branch
from
June 28, 2026 16:35
e23512d to
052dee8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expands the README with a worked example for every command, modeled on nak's example-driven docs, and adds a test that keeps those examples honest.
README
A new "Examples" section covering
key,event(sign-only, tags, PoW, publish),req,count,verify,relay,sync, anddecode. Every example was run before being added:req,count,relay) run against the publicwss://relay.damus.io.ws://127.0.0.1:7777, with a note that any relay URL works.key,decode,verify, event sign-only) show exact output.The intro flags the three things that can't be reproduced verbatim:
key generateis random, event signatures use random BIP-340 aux data (sosigdiffers each run whileiddoes not), and the live-query numbers reflect the relay at capture time.Executable-README test
tests/integration_readme.shparses the ```shell blocks in README.md, runs each example, and asserts the output matches what's shown, so a drifted example fails CI. It is offline-only and added to thebuildjob after the existing offline tests.://URL) andkey generateare skipped and reported."sig"field is normalized to"..."on both sides before comparing, so the id, content, and tags are checked exactly while the unreproducible signature is ignored.Current run: 12 examples asserted, 0 failed, 12 skipped.