Rebrand to shout, add light mode, update docs

This commit is contained in:
Chris Wanstrath 2026-03-10 10:07:03 -07:00
parent 60eb31cfc9
commit b04849cc5a
3 changed files with 62 additions and 75 deletions

View File

@ -3,21 +3,35 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>shout — test your CLI</title>
<meta name="description" content="Write shell sessions. Run them as tests. That's it.">
<title>shout — shell output tester</title>
<meta name="description" content="shell output tester">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #0a0a0a;
--fg: #b0b0b0;
--bright: #e0e0e0;
--green: #4ec966;
--red: #e55;
--dim: #555;
--accent: #4ec966;
--code-bg: #111;
--border: #222;
--bg: #fff;
--fg: #444;
--bright: #1a1a1a;
--green: #1a7f37;
--red: #cf222e;
--dim: #888;
--accent: #1a7f37;
--code-bg: #f5f5f5;
--border: #ddd;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #0a0a0a;
--fg: #b0b0b0;
--bright: #e0e0e0;
--green: #4ec966;
--red: #e55;
--dim: #555;
--accent: #4ec966;
--code-bg: #111;
--border: #222;
}
}
html { font-size: 16px; }
@ -34,7 +48,7 @@
}
header {
padding: 6rem 0 3rem;
padding: 6rem 0 2.5rem;
}
h1 {
@ -79,8 +93,7 @@
}
section {
padding: 3rem 0;
border-top: 1px solid var(--border);
padding: 0 0 2em 0;
}
h2 {
@ -125,32 +138,6 @@
.exit-code { color: var(--red); }
.pass { color: var(--green); }
.features {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
}
.feature {
padding: 1.2rem;
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 4px;
}
.feature h3 {
font-size: 0.85rem;
color: var(--bright);
margin-bottom: 0.4rem;
font-weight: 600;
}
.feature p {
font-size: 0.8rem;
color: var(--dim);
margin: 0;
line-height: 1.5;
}
footer {
padding: 3rem 0;
@ -180,7 +167,6 @@
@media (max-width: 520px) {
header { padding: 3rem 0 2rem; }
h1 { font-size: 2rem; }
.features { grid-template-columns: 1fr; }
section { padding: 2rem 0; }
}
</style>
@ -189,9 +175,9 @@
<header>
<h1><span>$</span> shout</h1>
<p class="tagline">Write shell sessions. Run them as tests.</p>
<div class="install" onclick="navigator.clipboard.writeText('bun install -g @because/shout')">
<span class="prompt">$</span> <span class="cmd">bun install -g @because/shout</span>
<p class="tagline">shell output tester</p>
<div class="install" onclick="navigator.clipboard.writeText('bun install -g @because/shout --registry=https://npm.nose.space')">
<span class="prompt">$</span> <span class="cmd">bun install -g @because/shout --registry=https://npm.nose.space</span>
<span class="hint">click to copy</span>
</div>
</header>
@ -207,8 +193,9 @@
<span class="exit-code">[1]</span>
<span class="prompt">$</span> <span class="cmd">brew --version</span>
<span class="output">Homebrew </span><span class="wildcard">...</span></code></pre>
<p><code class="wildcard">...</code> matches anything &mdash; inline or across lines. <code class="exit-code">[1]</code> asserts the exit code.</p>
<span class="output">Homebrew 5</span><span class="wildcard">...</span></code></pre>
<p><code class="wildcard">...</code> matches anything &mdash; inline or across lines.</p>
<p><code class="exit-code">[1]</code> asserts the exit code.</p>
</section>
<section>
@ -226,33 +213,33 @@
</section>
<section>
<h2>Features</h2>
<div class="features">
<div class="feature">
<h3>Wildcards</h3>
<p><code>...</code> matches anything &mdash; inline for partial lines, standalone for multiple lines.</p>
</div>
<div class="feature">
<h3>Exit codes</h3>
<p><code>[N]</code> asserts a specific exit code. <code>[*]</code> matches any non-zero code.</p>
</div>
<div class="feature">
<h3>Parallel</h3>
<p><code>--parallel</code> runs test files concurrently. Each gets its own shell.</p>
</div>
<div class="feature">
<h3>Timeouts</h3>
<p><code>--timeout 5s</code> per-command timeout. Supports <code>ms</code>, <code>s</code>, <code>m</code>.</p>
</div>
<div class="feature">
<h3>PATH control</h3>
<p><code>--path ./bin</code> prepends to PATH. Test your local builds.</p>
</div>
<div class="feature">
<h3>Verbose</h3>
<p><code>-v</code> prints each command as it runs. See what's happening.</p>
</div>
</div>
<h2>Usage</h2>
<pre><code><span class="prompt">$</span> <span class="cmd">shout --help</span>
<span class="output">Usage: shout [options] [files...]
shell output tester.
Arguments:
files Files or directories to test
Options:
-u, --update Rewrite expected output in-place with actual output
-k, --keep Keep temp directories after run
--clean-env Start with empty environment
--path &lt;path&gt; Prepend &lt;path&gt; to PATH (repeatable)
--timeout &lt;dur&gt; Per-command timeout (default: "10s")
-v, --verbose Print each command as it runs
--parallel Run files in parallel
-h, --help display help for command</span></code></pre>
</section>
<section>
<h2>Environment</h2>
<p>Shout sets these variables before running your commands:</p>
<pre><code><span class="bright">HOME</span> <span class="dim"></span> <span class="output">temp directory for this test file</span>
<span class="bright">SHOUT_DIR</span> <span class="dim"></span> <span class="output">same temp directory</span>
<span class="bright">PATH</span> <span class="dim"></span> <span class="output">prepended with --path dirs, if any</span></code></pre>
<p>Each file runs in its own temp directory. <code>--clean-env</code> starts with an empty environment instead of inheriting yours.</p>
</section>
<footer>

View File

@ -1,7 +1,7 @@
{
"name": "@because/shout",
"version": "0.0.2",
"description": "test shell output",
"description": "shell output tester",
"module": "src/index.ts",
"type": "module",
"files": [

View File

@ -126,7 +126,7 @@ export async function runFile(
: { ...process.env as Record<string, string> }
env["HOME"] = tmpDir
env["CUE_DIR"] = tmpDir
env["SHOUT_DIR"] = tmpDir
if (options.pathDirs?.length) {
env["PATH"] = options.pathDirs.join(":") + ":" + (env["PATH"] ?? "")