Iterates over configured cheatpaths and runs git pull on each one that
is a git repository with a clean worktree. Supports SSH remotes via key
file discovery and SSH agent fallback. Works with --path filtering.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace docopt-go with spf13/cobra, giving cheat a built-in
`--completion` flag that dynamically generates shell completions for
bash, zsh, fish, and powershell. This replaces the manually-maintained
static completion scripts and resolves the root cause of multiple
completion issues (#768, #705, #633, #632, #476).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The plan9/amd64 build fails because the vendored
cyphar/filepath-securejoin uses syscall.ELOOP, which doesn't
exist on plan9. Upstream fix (cyphar/filepath-securejoin#51) is
stalled. Given ~0 user demand (46 downloads total, one release),
remove the target rather than carry a local patch.
Closes#774
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused parameters, dead files, and inaccurate doc.go files
- Extract shared helpers, eliminate duplication
- Rename cheatpath.Cheatpath to cheatpath.Path
- Optimize filesystem walks (WalkDir, skip .git)
- Move sheet name validation to sheet.Validate
- Move integration tests to test/integration/
- Consolidate internal/mock into mocks/
- Move fuzz.sh to test/
- Inline loadSheets helper into command callers
- Extract config.New into its own file
- Fix stale references in HACKING.md and CLAUDE.md
- Restore plan9 build target
- Remove redundant and low-value tests
- Clean up project documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a --brief flag that lists cheatsheets with only title and tags,
omitting the file path column. Can be used standalone (-b) or combined
with --list (-lb), and composes with existing filters (-t, -p).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously cheat only checked the current working directory for a .cheat
subdirectory. Now it walks upward through ancestor directories, stopping
at the first .cheat directory found. This mirrors how git discovers .git
directories, so users can place .cheat at their project root and have it
work from any subdirectory.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a note explaining that syntax highlighting is powered by Chroma,
with a link to Chroma's supported languages list.
Closes#766
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move `doc/adr/` to `adr/` for discoverability. Remove the generic
ADR README — `ls adr/` serves the same purpose.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Searching for `.git/` in file paths incorrectly matched directory names
ending with `.git` (e.g., `personal.git/cheat/hello`), causing sheets
under such paths to be silently skipped. Fix by requiring the path
separator on both sides (`/.git/`), so `.git` is only matched as a
complete path component.
Rewrites test suite with comprehensive coverage for all six documented
edge cases, including the #711 scenario and combination cases (e.g.,
a real .git directory inside a .git-suffixed parent).
Closes#711
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, env vars were only consulted during config generation
and baked into conf.yml. At runtime, the config file value was
always used, making it impossible to override the editor via
environment variables.
Now the precedence is: $VISUAL > $EDITOR > conf.yml > auto-detect.
Closes#589
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This workflow has been failing for years due to an expired/missing
COMMITTER_TOKEN. Homebrew maintains their own automated version
bump pipeline, making this redundant.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminates glibc version mismatch errors when running release
binaries on systems with older glibc versions.
Closes#744
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cheat --init now comments out the community cheatpath by default and
includes a git clone instruction with the resolved path. This prevents
warnings about missing directories when users save the --init output
as their config without also cloning community cheatsheets.
Closes#773
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prompt() created a new bufio.NewReader(os.Stdin) on each call, which
buffered all piped input on the first call and left nothing for
subsequent prompts. This made cheat un-scriptable (e.g., piping answers
via printf). Fix by reading one byte at a time from os.Stdin directly.
Also adds an end-to-end integration test for the first-run experience
(regression test for #721, #771, #730) and bumps the Dockerfile to
Go 1.26.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- cmdInit (--init) now substitutes EDITOR_PATH, PAGER_PATH, and
WORK_PATH instead of leaving them as literal strings
- Installer now substitutes WORK_PATH and always creates personal
and work directories regardless of community cheatsheet choice
- When community cheatsheets are declined, the community cheatpath
is commented out in the generated config
- config.New() skips nonexistent cheatpaths with a warning instead
of hard-erroring on EvalSymlinks failure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add .gitattributes to force LF in mock files (Windows autocrlf)
- Fix parse.go: detect line endings from content instead of runtime.GOOS
- Add fail-fast: false to CI matrix; trigger on all branch pushes
- Skip chmod-based tests on Windows (permissions work differently)
- Use filepath.Join for expected paths in Windows path tests
- Use platform-appropriate invalid paths in error tests
- Add Windows absolute path test case for ValidateSheetName
- Skip Unix-specific integration tests on Windows
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Resolve symlinks in temp dir paths (macOS /var -> /private/var)
- Pre-create non-empty community dir to ensure clone fails reliably
regardless of network access on CI runners
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump Go from 1.19 to 1.26 and update all dependencies
- Rewrite CI workflow with matrix strategy (Linux, macOS, Windows)
- Update GitHub Actions to current versions (checkout@v4, setup-go@v5)
- Update CodeQL actions from v1 to v3
- Fix cross-platform bug in mock/path.go (path.Join -> filepath.Join)
- Clean up dependabot config (weekly schedule, remove stale ignore)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>