gh-select

Files and paths

What gh-select writes to your cache and config directories, and where release assets, saved files and clones go.

View as Markdown

Cache directory

$XDG_CACHE_HOME/gh-select, or ~/.cache/gh-select when the variable is unset. When your home directory cannot be found, the system temporary directory is used.

FileHolds
repos-v3.jsonthe repository list for My repos
starred-v3.jsonthe starred list
locals.jsonthe map from owner/repo to the local clone found by the last scan
latest-release.jsonthe newest release tag seen and when it was checked, for the daily update notice

Everything in it can be deleted. The next start fetches and scans again. The -v3 suffix is the cache schema. A release that changes the stored fields bumps it, which refetches once.

A cache file is written to a .tmp file and renamed, so an interrupted run never leaves a half-written list.

Config directory

$XDG_CONFIG_HOME/gh-select, or ~/.config/gh-select.

PathHolds
themethe name of the theme last picked with ctrl+t
themes/NAME.jsoncustom themes. See the theme file

gh-select creates the directory only when it saves a theme. It never writes any other setting. Everything else is a flag or an environment variable.

Files you ask for

WhatWhere
ClonesCLONE_DIR/REPO, or ./REPO without a clone directory
Partial clonesthe same place as clones
Release assetsDOWNLOAD_DIR/FILE, or ./FILE
Unpacked archivesa folder inside DOWNLOAD_DIR, named after the archive's single top-level folder or after the archive
One saved fileDOWNLOAD_DIR/FILE
Several saved filesDOWNLOAD_DIR/REPO/PATH, keeping repository paths
In-progress downloadsFILE.part, renamed when complete

The clone directory is -d/--dir, then GH_SELECT_CLONE_DIR. The download directory is --download-dir, then GH_SELECT_DOWNLOAD_DIR. Both expand a leading ~.

Nothing is ever overwritten. A clone onto an existing folder fails, a download onto an existing file fails, and a saved file gets a -1, -2 suffix.

Binary and build info

A release build gets its version from the tag. A local build reports the commit it was built from, such as dev+270fe07, read from the build information Go embeds.

Edit this page on GitHub

Last updated on

On this page