Skip to content

Commit 79733a7

Browse files
authored
fix: resolve acceptance test findings (#9)
## Summary - Fix `.gitignore` crash on read-only repos with external `--output-dir` - Add symlink `.gitignore` guard - Fix version-pinned curl URLs (v1.0.0 → main) - Add SHA256 checksum to README manual install - Use `$RUNNER_TEMP` in release workflow - Add sudo warning to install.sh - README: TOC, uninstall section, agent/CI docs, colour env vars, install.sh env vars - Agent example in `--help` output - 3 new bats tests - Bump to v1.0.2 ## Test plan - [x] shellcheck clean - [x] shfmt clean - [x] 231/231 bats tests pass --------- Signed-off-by: K1-R1 <77465250+K1-R1@users.noreply.github.com>
1 parent ac1a20b commit 79733a7

9 files changed

Lines changed: 440 additions & 29 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ jobs:
123123
tarball_url="https://github.com/K1-R1/smoosh/archive/refs/tags/${TAG_NAME}.tar.gz"
124124
125125
# Compute SHA256 from the release tarball.
126-
curl -fsSL "${tarball_url}" -o /tmp/smoosh-src.tar.gz
127-
sha256="$(sha256sum /tmp/smoosh-src.tar.gz | awk '{print $1}')"
126+
curl -fsSL "${tarball_url}" -o "$RUNNER_TEMP/smoosh-src.tar.gz"
127+
sha256="$(sha256sum "$RUNNER_TEMP/smoosh-src.tar.gz" | awk '{print $1}')"
128128
129129
# Clone, patch, push.
130130
git clone \
131131
"https://x-access-token:${COMMITTER_TOKEN}@github.com/K1-R1/homebrew-tap.git" \
132-
/tmp/homebrew-tap
133-
cd /tmp/homebrew-tap
132+
"$RUNNER_TEMP/homebrew-tap"
133+
cd "$RUNNER_TEMP/homebrew-tap"
134134
git config user.email "github-actions[bot]@users.noreply.github.com"
135135
git config user.name "github-actions[bot]"
136136

CHANGELOG.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
## [1.0.2] - 2026-03-17
11+
12+
### Fixed
13+
14+
- `.gitignore` auto-update no longer crashes on read-only repos when
15+
`--output-dir` points outside the repository root. The `.gitignore` write
16+
is now skipped (with a warning) since an external absolute path in
17+
`.gitignore` would be meaningless anyway.
18+
- README and `install.sh` header comment no longer pin curl install URLs to
19+
`v1.0.0` — now reference `main` branch so users always get the latest
20+
install script.
21+
22+
### Security
23+
24+
- `.gitignore` auto-update skips symlinks with a warning, preventing the
25+
`cp` + `mv` pattern from overwriting the symlink target.
26+
- `install.sh` now warns before falling back to `sudo` for installation,
27+
making privilege escalation visible in `curl | bash` contexts.
28+
- README manual install instructions now include SHA256 checksum
29+
verification step.
30+
- Release workflow uses `$RUNNER_TEMP` instead of world-readable `/tmp` for
31+
intermediate files.
32+
33+
### Added
34+
35+
- Table of contents in README for quick navigation.
36+
- Uninstall section in README (Homebrew and manual paths, shadow binary
37+
note).
38+
- Agent/CI usage section in README with JSON schema example, recommended
39+
commands, and automation flags table.
40+
- `--no-color` flag documented in README configuration reference table.
41+
- Colour environment variable precedence documented (`--no-color` >
42+
`NO_COLOR` > `FORCE_COLOR` > `CLICOLOR` > TTY auto-detect).
43+
- `install.sh` environment variables documented in README (`SMOOSH_VERSION`,
44+
`SMOOSH_INSTALL_DIR`, `SMOOSH_NO_CONFIRM`, `SMOOSH_NO_VERIFY`).
45+
- Agent/CI example added to `--help` output.
46+
- 3 new bats tests: external `--output-dir` skips `.gitignore`, symlink
47+
`.gitignore` is not followed, `--help` includes agent example.
48+
1049
## [1.0.1] - 2026-03-15
1150

1251
### Fixed
@@ -64,6 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
64103
- Output path shown relative to repo root
65104
- Demo recordings: interactive mode flow and power-user flags
66105

67-
[Unreleased]: https://github.com/K1-R1/smoosh/compare/v1.0.1...HEAD
106+
[Unreleased]: https://github.com/K1-R1/smoosh/compare/v1.0.2...HEAD
107+
[1.0.2]: https://github.com/K1-R1/smoosh/compare/v1.0.1...v1.0.2
68108
[1.0.1]: https://github.com/K1-R1/smoosh/compare/v1.0.0...v1.0.1
69109
[1.0.0]: https://github.com/K1-R1/smoosh/releases/tag/v1.0.0

README.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ ChatGPT, or your own RAG pipeline. Pure bash, zero dependencies.
1616

1717
</div>
1818

19+
**[Quick Start](#quick-start)** · **[Why smoosh?](#why-smoosh)** · **[Features](#features)** · **[Installation](#installation)** · **[Uninstall](#uninstall)** · **[Usage](#usage)** · **[AI Tools](#using-smoosh-with-ai-tools)** · **[Agent / CI](#agents-and-ci-pipelines)** · **[Config Reference](#configuration-reference)** · **[FAQ](#faq)**
20+
1921
## Quick Start
2022

2123
```bash
@@ -94,24 +96,48 @@ brew install K1-R1/tap/smoosh
9496
### curl (macOS / Linux / Git Bash)
9597

9698
```bash
97-
curl -fsSL https://raw.githubusercontent.com/K1-R1/smoosh/v1.0.0/install.sh | bash
99+
curl -fsSL https://raw.githubusercontent.com/K1-R1/smoosh/main/install.sh | bash
98100
```
99101

100102
Installs to `/usr/local/bin`. Override with:
101103

102104
```bash
103105
SMOOSH_INSTALL_DIR="$HOME/.local/bin" \
104-
curl -fsSL https://raw.githubusercontent.com/K1-R1/smoosh/v1.0.0/install.sh | bash
106+
curl -fsSL https://raw.githubusercontent.com/K1-R1/smoosh/main/install.sh | bash
105107
```
106108

109+
The installer supports these environment variables:
110+
111+
| Variable | Default | Description |
112+
| --- | --- | --- |
113+
| `SMOOSH_INSTALL_DIR` | `/usr/local/bin` | Installation directory |
114+
| `SMOOSH_VERSION` | latest | Pin a specific version (e.g. `1.0.1`) |
115+
| `SMOOSH_NO_CONFIRM` | `0` | Set to `1` to skip confirmation prompt |
116+
| `SMOOSH_NO_VERIFY` | `0` | Set to `1` to skip checksum verification (unsafe) |
117+
107118
### Manual
108119

109120
```bash
110121
curl -fsSL https://github.com/K1-R1/smoosh/releases/latest/download/smoosh -o smoosh
122+
curl -fsSL https://github.com/K1-R1/smoosh/releases/latest/download/smoosh.sha256 -o smoosh.sha256
123+
sha256sum -c smoosh.sha256
111124
chmod +x smoosh
112125
sudo mv smoosh /usr/local/bin/
113126
```
114127

128+
### Uninstall
129+
130+
```bash
131+
# Homebrew
132+
brew uninstall smoosh
133+
134+
# curl / manual
135+
rm "$(which smoosh)"
136+
```
137+
138+
If you installed via both methods, check `which smoosh` after removing one — a
139+
second copy may remain in a different location.
140+
115141
## Usage
116142

117143
### Basics
@@ -242,6 +268,49 @@ grounded in your actual code.
242268

243269
Works with any ChatGPT plan that supports file uploads.
244270

271+
### Agents and CI pipelines
272+
273+
smoosh is designed to be called by AI agents and CI pipelines, not just humans.
274+
275+
**Pre-flight check** — estimate size before generating output:
276+
277+
```bash
278+
smoosh --json --dry-run --all .
279+
```
280+
281+
```json
282+
{
283+
"dry_run": true,
284+
"repo": "my-project",
285+
"files": [
286+
{"path": "README.md", "words": 194, "chunk": 1},
287+
{"path": "src/main.py", "words": 312, "chunk": 1}
288+
],
289+
"total_words": 506,
290+
"estimated_tokens": 658,
291+
"estimated_chunks": 1
292+
}
293+
```
294+
295+
**Generate output:**
296+
297+
```bash
298+
smoosh --no-interactive --json --all .
299+
```
300+
301+
**Key flags for automation:**
302+
303+
| Flag | Purpose |
304+
| --- | --- |
305+
| `--no-interactive` | Skip TTY detection and prompts |
306+
| `--json` | Structured JSON to stdout (status messages go to stderr) |
307+
| `--quiet` | Output file paths only, one per line |
308+
| `--dry-run` | Preview without writing files |
309+
| `--no-color` | Disable colour escape codes |
310+
311+
Exit codes 0–7 are differentiated for programmatic decision-making — see
312+
[Configuration Reference](#configuration-reference) below.
313+
245314
## Configuration Reference
246315

247316
| Flag | Default | Description |
@@ -262,10 +331,14 @@ Works with any ChatGPT plan that supports file uploads.
262331
| `--quiet` || Print output paths only (stdout) |
263332
| `--json` || Structured JSON to stdout |
264333
| `--no-interactive` || Skip interactive mode even in a TTY |
334+
| `--no-color` || Disable colour output |
265335
| `--no-check-secrets` || Skip the basic secrets scan |
266336
| `--version` || Print version and exit 0 |
267337
| `--help` || Print full usage and exit 0 |
268338

339+
**Colour control:** `--no-color` flag > `NO_COLOR` env var > `FORCE_COLOR` >
340+
`CLICOLOR` > TTY auto-detect. See [no-color.org](https://no-color.org/).
341+
269342
**Exit codes:**
270343

271344
| Code | Meaning |

0 commit comments

Comments
 (0)