Skip to content

docs: add a demo GIF, correct the documented config location - #32

Merged
patramsey merged 2 commits into
mainfrom
docs/demo-gif
Aug 2, 2026
Merged

docs: add a demo GIF, correct the documented config location#32
patramsey merged 2 commits into
mainfrom
docs/demo-gif

Conversation

@patramsey

Copy link
Copy Markdown
Owner

Adds the demo GIF, recorded against the sandbox API, showing domain check through to a registered domain and a DNS record.

docs/demo.tape is the vhs script that produces it, and carries the warnings that matter: log in before recording so no token prompt lands in a frame, confirm the active profile is sandbox first, and expect a re-record to fail at the availability check — because the previous run really did register that name.

Two things the first take got wrong

domain check offers to register inline when interactive. The first recording typed the follow-up command straight into that prompt: the leading n of namecom answered it (printing aborted), and the shell got amecom domain register …command not found.

I caught this by extracting frames and looking at them — vhs exits 0 either way, and the sandbox API confirmed no registration had happened. A green exit code proves nothing here.

That inline offer turns out to be the better demo anyway: the whole flow is one command. The tape now uses it, and the guided form is gone.

PATH resolution picked the wrong binary. which namecom on a machine with a Homebrew install resolves to the released build — so the GIF would have shown an older version's output while looking current. The tape now puts the repo first on PATH in its hidden setup, and the header says to run make build first. make install doesn't help: go install names the binary after the module path, so it lands as namecom-cli.

The config path in the docs was wrong

Not theoretical — it's why a search for existing credentials on this Mac came up empty while a working config sat in Library/Application Support the whole time.

README.md said credentials live at ~/.config/namecom/config.yaml, and Path()'s doc comment called the location "XDG". But the code uses os.UserConfigDir():

Platform Actual location
macOS ~/Library/Application Support/namecom/config.yaml
Linux $XDG_CONFIG_HOME/namecom/config.yaml, else ~/.config/…
Windows %AppData%\namecom\config.yaml

Only Linux matched the docs. README now lists all three and points at namecom auth status, which prints the path in use. The doc comment explains why "XDG" was the wrong word.

No behavior change — the code was always right. Nobody's credentials need moving, which matters if other tools read the same file.

One thing to decide

The GIF shows [sandbox] tags on the success lines (✓ [sandbox] Registered lunarcrate.com…). I left them in because they're truthful — no one should think this demo spent $17.99. If you'd rather the README demo not announce it's sandbox, say so and I'll restructure around commands that don't emit the tag.

Test plan

  • vhs validate docs/demo.tape passes
  • Recording verified by inspecting extracted frames, not by exit code
  • Registration confirmed real: domain check reported purchasable: true before and false after
  • go build ./..., golangci-lint run, go test -race ./internal/config/ all clean
  • Documented paths checked against os.UserConfigDir() behavior and against auth status output on this machine

The GIF records `domain check` through to a registered domain and a DNS
record, against the SANDBOX API. docs/demo.tape is the vhs script that
produces it, and carries the warnings that matter: log in before
recording so no token prompt lands in a frame, confirm the active profile
is sandbox first, and expect a re-record to fail at the availability
check because the previous run really did register that name.

Two things the first take got wrong, both now handled in the tape:

`domain check` offers to register inline when interactive. The first
recording typed the follow-up command into that prompt: the leading "n"
of "namecom" answered it (printing "aborted") and the shell received
"amecom domain register …" -> command not found. Verified by extracting
frames rather than trusting a zero exit code, which vhs returns either
way. That inline offer turns out to be the better demo anyway — the whole
flow is one command, so the tape now uses it and the guided form is gone.

PATH resolution picked the wrong binary. `which namecom` on a machine
with a Homebrew install resolves to the released build, so the GIF would
have shown an older version's output while looking current. The tape now
puts the repository first on PATH in its hidden setup, and the header
says to run `make build` first. `make install` does not help: go install
names the binary after the module path, so it lands as `namecom-cli`.

Separately, the documented config location was wrong on macOS and
Windows. README said credentials live at ~/.config/namecom/config.yaml
and the Path() doc comment called the location "XDG", but the code uses
os.UserConfigDir, which is ~/Library/Application Support on darwin and
%AppData% on windows. Only Linux matched the docs. This is not
theoretical: it is why a search for existing credentials on a Mac came up
empty while a working config sat in Library/Application Support the whole
time. README now lists all three platforms and points at `auth status`,
which prints the path in use; the doc comment explains why "XDG" was the
wrong word. No behavior change — the code was always right.
The pauses were dead air. The sleeps were picked defensively after a take
where a keystroke got eaten by a waiting prompt, and defensive turned out
to mean roughly triple what the commands need.

Measured against the sandbox rather than guessed again:

  domain check           0.46s   (tape slept 5s)
  inline registration    2.86s   (tape slept 6s)
  dns create             0.31s   (tape slept 4s)

Sleeps are now sized per step, and the tape records which number came
from where so the next edit does not have to re-derive it.

The distinction that matters is which sleeps are load-bearing. Two of
them sit between an Enter and the next Type while a prompt is waiting for
input; undersize those and the prompt eats the keystrokes, which is how
an earlier take ended up running "amecom". Those keep real margin —
1.5s over a 0.46s call, 4.5s over a 2.86s one. The trailing sleep after
the last command has nothing typed after it, so it is purely reading time
and can be trimmed freely. The comments say so.

Typing speed 60ms -> 40ms, which is most of the remaining saving: the two
commands are 35 and 59 characters, so typing alone was 5.7s of the 24.2s.

Re-recorded against driftwoodco.com, since the previous run really did
register the old name. Verified the same way as before — extracted the
final frame and looked at it, and confirmed the registration landed via
the API — because vhs exits 0 whether or not the recording is coherent.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@patramsey
patramsey merged commit 0fa27a3 into main Aug 2, 2026
3 checks passed
@patramsey
patramsey deleted the docs/demo-gif branch August 2, 2026 22:26
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

Successfully merging this pull request may close these issues.

2 participants