Do not promise an output path the config can override

Review caught this on the previous commit, and it was right. `sync` resolves
its target as `--out` if given, otherwise `.tokenchit.json`'s `output` —
`tokenchit.svg` is that field's default, not a fixed location. Saying the bare
command "writes tokenchit.svg in the repository root" is wrong for anyone who
has configured another path.

Checked rather than assumed: a config with `output: docs/custom-card.svg` makes
the bare command report `would write docs/custom-card.svg`.

Three places said it. Step 3 now says the configured output, the flag table no
longer implies the default is fixed, and the README snippet carries a note to
use the path sync actually reported. The command's usage comment says the same.
This commit is contained in:
iyashjayesh
2026-09-27 01:43:14 +05:30
parent 7899734c64
commit df34108e0f
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ slash-command harnesses can reach it.
## Usage
```
/token-card # write ./tokenchit.svg
/token-card # write the configured output (./tokenchit.svg by default)
/token-card --out docs/usage.svg # write somewhere else
/token-card --theme dark
/token-card --dry-run # report what would be written, write nothing
+6 -2
View File
@@ -66,7 +66,8 @@ npm view @tokenchit/cli@0.10.0 dist.integrity dist.tarball
**Skip this entirely when the user passed `--dry-run`**, and report that `.tokenchit.json`
*would* be created. A preview that writes a config file is not a preview.
3. **Render the card.** The bare command, which writes `tokenchit.svg` in the repository root:
3. **Render the card.** The bare command writes to the configured output — `tokenchit.svg`
unless `.tokenchit.json` names another path:
```bash
npx -y @tokenchit/cli@0.10.0 sync
@@ -79,7 +80,7 @@ npm view @tokenchit/cli@0.10.0 dist.integrity dist.tarball
| Flag | Effect |
|---|---|
| `--out <path>` | Write somewhere other than `tokenchit.svg` |
| `--out <path>` | Write somewhere other than the configured output |
| `--theme auto` \| `light` \| `dark` | Card theme; `auto` adapts to the reader's system |
| `--dry-run` | Print what would be written and touch nothing |
@@ -96,6 +97,9 @@ npm view @tokenchit/cli@0.10.0 dist.integrity dist.tarball
![tokenchit](./tokenchit.svg)
```
Use the path `sync` actually reported, not this one, when the output is configured
elsewhere.
Do not edit the README without being asked.
Stop after step 4. Publishing to the public leaderboard is a separate `publish` command that