English | 日本語 | 简体中文 | 한국어 | Español | Français | Deutsch
A one-liner installer that wires codegraph into your entire development machine.
Think of it as codegraph install / codegraph uninstall, but for your shell environment.
- Adds
.codegraph/to the global git ignore (optional — skip with--no-ignore).codegraph/is excluded from git tracking in every repository — existing and future. - Installs a
gitwrapper for zsh / bash / fish Creating a repository withgit init/git cloneautomatically runscodegraph initin the background. - Indexes existing repositories in bulk
Runs
codegraph initin every git repository underDEV_DIR(default:~/dev) that doesn't have a.codegraphdirectory yet.
curl -fsSL https://raw.githubusercontent.com/yuyutar1/codegraph-auto-init/main/install.sh | shOptions:
# Skip the bulk scan of existing repositories (wire up the settings only)
curl -fsSL https://raw.githubusercontent.com/yuyutar1/codegraph-auto-init/main/install.sh | sh -s -- --no-scan
# Change the scan target directory (default: ~/dev)
DEV_DIR=~/src sh -c "$(curl -fsSL https://raw.githubusercontent.com/yuyutar1/codegraph-auto-init/main/install.sh)"
# Don't add .codegraph/ to the global git ignore (for those who want git to track it)
curl -fsSL https://raw.githubusercontent.com/yuyutar1/codegraph-auto-init/main/install.sh | sh -s -- --no-ignoreSafe to run repeatedly (idempotent). Already-configured items are skipped.
curl -fsSL https://raw.githubusercontent.com/yuyutar1/codegraph-auto-init/main/uninstall.sh | shRemoves the global ignore entry, the source line in .zshrc, the wrapper, the CLI, and its configuration.
Per-repository indexes (.codegraph/) are kept by default. To delete them as well:
curl -fsSL https://raw.githubusercontent.com/yuyutar1/codegraph-auto-init/main/uninstall.sh | sh -s -- --purgeThe installer also puts a codegraph-auto-init command into ~/.local/bin, so you are not locked into the DEV_DIR chosen at install time:
codegraph-auto-init scan ~/work # bulk-index repos under ~/work right now
codegraph-auto-init add-dir ~/work # add ~/work to the configured scan directories
codegraph-auto-init scan # re-scan all configured directories
codegraph-auto-init dirs # list configured directories
codegraph-auto-init remove-dir ~/work # remove a directory from the configurationConfigured directories are stored in ~/.config/codegraph-auto-init/dirs (one per line). DEV_DIR at install time only seeds this file.
| Target | What happens |
|---|---|
~/.config/git/ignore |
One .codegraph/ line is appended (or to the file set in core.excludesFile if configured) |
~/.config/codegraph-auto-init/git-wrapper.sh |
The wrapper for zsh / bash. After a successful git init / git clone, it detects the new repository and runs codegraph init in the background |
~/.zshrc / ~/.bashrc |
One source line each (tagged with a # codegraph-auto-init marker), added only when the shell is installed |
~/.config/fish/conf.d/codegraph-auto-init.fish |
The fish version of the wrapper, auto-loaded by fish (installed only when fish is present) |
~/.local/bin/codegraph-auto-init |
Management CLI (scan / dirs / add-dir / remove-dir) |
The wrapper does nothing in the following cases (fails safe):
- the
codegraphCLI is not onPATH - the target directory already has
.codegraph/ - bare repositories (
git init --bare) - subcommand detection fails on value-taking global options such as
git -C dir init
| Requirement | Needed for | Notes |
|---|---|---|
| macOS / Linux | everything | uses POSIX sh and find / grep; Windows is not supported |
| git 1.7.12+ | everything | the default global ignore path ~/.config/git/ignore requires 1.7.12+; any modern git qualifies |
| curl | install / uninstall | only for the one-liner; not needed when running from a local checkout |
| zsh / bash / fish | auto-init on git init / git clone |
the wrapper is installed for each shell found on the machine; the ignore setting, the CLI, and the bulk scan work with any shell |
| codegraph CLI | indexing (wrapper and scan) |
the installer completes without it (the initial scan is skipped); install it later and run codegraph-auto-init scan |
~/.local/bin in PATH |
the codegraph-auto-init command |
the installer warns when it is missing |
MIT