Prepare for a public release: identity out of the code, one-line install - #10
Merged
Conversation
The post template hardcoded one person: a byline, a site name, a Mastodon handle, a GitHub profile and an email address. It also hardcoded two CrawlProof account ids — an analytics site id and an ad slot id. None of that is a property of the tool, and in a public repository all of it is worse than untidy: a fresh checkout would publish somebody else's name on every post, and meter that install's pageviews and ad impressions into an account it inherited from the repository rather than chose. So identity now comes from a config file, read from $BLOG_CONFIG, then <blog dir>/blog.config.json, then ~/.config/cli-tools/blog.json, with the environment able to override any scalar field. The defaults are empty and the empty case is a good one rather than a broken one: no byline, no identity links, and no third-party scripts at all — which is the only fully smolweb-valid output the template has ever been able to produce. `blog-post config` prints which file was picked up and what it resolved to, and `new` says so on stderr when it renders a post with no byline, because a silent anonymous post is the failure worth catching. Also replaces two colleagues' GitHub handles in gh-prs usage examples with placeholders, drops a personal dev URL from the feed plugin doc, and ignores blog.config.json plus the usual credential file shapes. Verified: rendering with the maintainer's config reproduces the previous template byte for byte. 98 tests pass, typecheck clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Until now installing these meant knowing to clone the repo to a particular path, run pnpm, and then run a script whose name is not `link` for a reason nobody would guess. That is fine for the person who wrote it and a poor front door for a public repository. So there is now `install.sh` behind the usual one-liner, and a `cli-tools` command that fronts the set: cli-tools list what is here, and what is on PATH cli-tools update pull, reinstall, relink cli-tools link [--force] symlink into ~/.local/bin cli-tools aliases --install merge the pit aliases cli-tools <command> [args…] run any of the others The dispatcher exists mainly so the set has one name to install by: moshcode decides a tool is present by looking for a binary, so `cli-tools` on PATH is what makes `moshcode install cli-tools` and `/cli-tools …` work. Three things it is careful about. The installer adopts a checkout that already owns these command names rather than cloning a second copy whose links are all refused as not-ours, with no explanation of why nothing changed. `update` refuses to move a dirty or diverged tree instead of discarding work. And `aliases --install` merges: a name you bound yourself is kept, and the collision is reported rather than silently repointed. The aliases are thin on purpose and none shares a name with a command — a shell function beats PATH, so an alias named after the file it wraps would shadow it. Both invariants are now tests rather than comments. Also adds a `tools` plugin (/tools:install, /tools:list) and corrects the `zsh -c` rationale these docs had inherited: current moshcode runs `$SHELL -ic`, which does source rc files. The reason to stay on PATH is the weaker one the README already gives. 114 tests pass, typecheck clean, installer verified end to end into a sandbox. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan3 finding(s) MEDIUM: 1 | LOW: 2
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Two changes, both prerequisites for making this repository public.
The blog identity is configuration now
The post template hardcoded one person: a byline, a site name, a Mastodon handle, a GitHub profile and an email address, plus two CrawlProof account ids (an analytics site id and an ad slot id).
In a public repository that is worse than untidy. A fresh checkout would publish somebody else's name on every post, and meter that install's pageviews and ad impressions into an account it inherited from the repository rather than chose.
Identity now comes from a config file, read from
$BLOG_CONFIG, then<blog dir>/blog.config.json, then~/.config/cli-tools/blog.json, with the environment able to override any scalar field. The defaults are empty and the empty case is a good one rather than a broken one: no byline, no identity links, and no third-party scripts at all — which is the only fully smolweb-valid output this template has ever been able to produce.blog-post configprints which file was picked up and what it resolved to.blog-post newsays so on stderr when it renders a post with no byline, because a silent anonymous post is the failure worth catching.blog.config.example.jsonis the starting point;blog.config.jsonis gitignored.Verified byte for byte: rendering with the maintainer's config reproduces the previous template exactly.
Also drops two colleagues' GitHub handles from
gh-prsusage examples, removes a personal dev URL from the feed plugin doc, and ignores the usual credential file shapes.One-line install, and a
cli-toolsfront doorInstalling this meant knowing to clone to a particular path, run pnpm, then run a script deliberately not named
link. Fine for the author, poor front door for a public repo.curl -fsSL https://raw.githubusercontent.com/profullstack/cli-tools/master/install.sh | shAnd a dispatcher, which is mostly there so the set has one name to install by — moshcode decides a tool is present by looking for a binary, so
cli-toolson PATH is what makesmoshcode install cli-toolsand/cli-tools …work:Three things it is careful about:
updaterefuses to move a dirty or diverged tree instead of discarding work.aliases --installmerges: a name you bound yourself is kept, and the collision is reported rather than silently repointed.Adds a
toolsplugin (/tools:install,/tools:list) alongside the existingbloganddomainones.A correction
These docs had inherited the claim that PATH executables are needed because the pit runs aliases through
zsh -c. The README already notes that stopped being true — current moshcode runs$SHELL -ic, which does source rc files. The new code and docs give the weaker, still-sufficient reason: a file works from every caller without anything having been sourced first.The aliases are thin on purpose and none shares a name with a command, since a shell function beats PATH and would shadow the file. Both invariants are tests now, not comments.
Checks
aliases.json.🤖 Generated with Claude Code