{"id":49064450,"url":"https://github.com/redpeacock78/texenv","last_synced_at":"2026-04-20T04:02:31.003Z","repository":{"id":324230704,"uuid":"1096469958","full_name":"redpeacock78/texenv","owner":"redpeacock78","description":"A lightweight version manager for TinyTeX (minimal TeX Live) inspired by rbenv. It lets you install multiple TinyTeX releases side‑by‑side, select global or per‑project versions, expose TeX executables through shims, and freeze / restore package sets.","archived":false,"fork":false,"pushed_at":"2026-04-14T07:21:19.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-14T08:27:25.517Z","etag":null,"topics":["bash","bash-script","env","latex","shell","shell-script","tex","tex-installation","tex-versions","tinytex","version-control","version-manager"],"latest_commit_sha":null,"homepage":"https://deepwiki.com/redpeacock78/texenv","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redpeacock78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-14T13:26:22.000Z","updated_at":"2026-04-14T07:21:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/redpeacock78/texenv","commit_stats":null,"previous_names":["redpeacock78/texenv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redpeacock78/texenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpeacock78%2Ftexenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpeacock78%2Ftexenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpeacock78%2Ftexenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpeacock78%2Ftexenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redpeacock78","download_url":"https://codeload.github.com/redpeacock78/texenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redpeacock78%2Ftexenv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32032302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","env","latex","shell","shell-script","tex","tex-installation","tex-versions","tinytex","version-control","version-manager"],"created_at":"2026-04-20T04:02:30.275Z","updated_at":"2026-04-20T04:02:30.987Z","avatar_url":"https://github.com/redpeacock78.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# texenv\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/redpeacock78/texenv)  \n\nA lightweight version manager for TinyTeX (minimal TeX Live) inspired by rbenv. It lets you install multiple TinyTeX releases side‑by‑side, select global or per‑project versions, expose TeX executables through shims, and freeze / restore package sets.\n\n## Features\n\n- Install specific TinyTeX release versions (including a rolling daily build).\n- Maintain multiple versions concurrently under $HOME/.texenv/versions\n- Set a global default or per‑directory local version via .tex-version\n- Shims for TeX commands; automatic shim regeneration after tlmgr installs/updates/removals and explicit rehash command\n- Execute tlmgr and other TeX tools inside the currently selected version\n- Freeze installed package names to tex-require.txt or lock with TeX Live version in tex-require.lock\n- Restore installs any missing packages from a requirements file (does not remove extras)\n- Repository management for tlmgr:\n  - Auto-selects an appropriate repository based on TeX Live year (latest tlnet for current year, historic tlnet-final for past years)\n  - Show current repository and set per-version mirror overrides\n- Spawn a shell scoped to a specific TinyTeX version\n- Introspection helpers: which/where/whence, root, shims\n- Pure Bash implementation; see Requirements\n- No modification of system TeX installations\n\n## Requirements\n\n- Operating systems:\n  - macOS (Darwin): platform \"universal-darwin\", archives \".tgz\"\n  - Linux x86_64: platform \"x86_64-linux\", archives \".tar.gz\"\n  - Linux ARM64 (aarch64 / arm64): platform \"aarch64-linux\", archives \".tar.gz\"\n  - Others are not supported (texenv exits with \"unsupported OS\").\n- Shell:\n  - Bash \u003e= 4.x\n  - zsh users can eval the init snippet in their shell profile.\n  - POSIX sh is not supported.\n- Tools:\n  - curl\n  - perl with File::Find module (validated at startup)\n  - tar\n  - find, grep, awk, diff, cat, mkdir, uname, sort, rm\n- Network:\n  - Internet access to GitHub Releases and API (for version list and archives)\n\n## Installation\n\n### Using anyenv (Recommended)\n\nIf you have [anyenv](https://github.com/anyenv/anyenv) installed, you can easily install texenv:\n\n```bash\nrm -rf \"${HOME}/.config/anyenv/anyenv-install\"\nanyenv install --init https://github.com/redpeacock78/anyenv-install.git texenv-add\nanyenv install texenv\n```\n\nAdd texenv initialization lines to your shell profile (~/.bashrc, ~/.zshrc, etc.):\n\n```bash\neval \"$(anyenv init -)\"\n```\n\n### Manual Installation\n\nClone the repository somewhere on your PATH (recommended: $HOME/.texenv):\n\n```bash\ngit clone https://github.com/redpeacock78/texenv.git ~/.texenv\n```\n\nAdd texenv initialization lines to your shell profile (~/.bashrc, ~/.zshrc, etc.):\n\n```bash\neval \"$(~/.texenv/bin/texenv init -)\"\n```\n\nThe `init -` snippet prepends `~/.texenv/bin` and `~/.texenv/shims` to `PATH`, sets\n`TEXENV_SHELL` to the current shell name, defines a `texenv()` shell function that\nhandles special subcommands (e.g. `shell`), and automatically runs `texenv init` on\neach new shell session.\n\nOpen a new shell (or source your profile). The first `texenv init` call will create\nall required directories automatically. You can also run it explicitly:\n\n### Directory Structure\n\nAfter installation, the following directory structure will be created:\n\n```text\n~/.texenv/\n  bin/texenv\n  shims/\n  versions/\n  config/\n  texmf/\n  version\n```\n\nEnsure ~/.texenv/bin and ~/.texenv/shims appear early in PATH (the init - output adds them).\n\n## Command overview\n\nMatches `texenv help`:\n\n- commands            List available commands\n- init                Initialize texenv environment\n- install [version]   Install specified TeX Live version\n- uninstall [version] Uninstall specified TeX Live version\n- version             Show current TeX Live version\n- versions            List installed TeX Live versions\n- shell [version]     Spawn a new shell with specified TeX Live version\n- global [version]    Set global TeX Live version\n- local [version]     Set local TeX Live version\n- repo [options]      Manage tlmgr repository\n- exec [cmd] [args]   Execute command in current TeX Live version\n- rehash              Rebuild shims for installed TeX Live versions\n- freeze [options]    Freeze installed TeX packages to requirements file\n- restore             Restore TeX packages from requirements file\n- which [cmd]         Show path to shim for specified command\n- where [cmd]         Show path to command in current TeX Live version\n- whence [cmd]        Show path to command in all installed TeX Live versions\n- env                 Display texenv environment information\n- root                Show texenv root directory\n- shims               Show executable file(s) from texenv shims directory\n- help                Show this help message\n\n## Upgrading texenv\n\n```bash\ncd ~/.texenv\ngit pull --ff-only\ntexenv rehash\n```\n\n## Installing TinyTeX versions\n\nList available versions (queried from tinytex-releases):\n\n```bash\ntexenv install --list\n# show more (paginated by API): \ntexenv install --list --all\n```\n\nInstall a specific version:\n\n```bash\ntexenv install 2024.09\n```\n\nInstall / refresh the daily build:\n\n```bash\ntexenv install daily\n```\n\nThe daily build is stored as `daily-YYYY.MM.DD` under `~/.texenv/versions/`.\ntexenv first attempts to fetch the standard archive (`.tgz` on macOS, `.tar.gz` on\nLinux). If that URL returns a non-200 status, it falls back to the `.tar.xz` variant:\n- macOS: `TinyTeX-1-darwin.tar.xz`\n- Linux: `TinyTeX-1-linux-{arch}.tar.xz`\n\nForce reinstall an already installed version:\n\n```bash\ntexenv install --force 2024.09\n```\n\n## Listing installed versions\n\n```bash\ntexenv versions\n```\n\nOutput marks the active one with an asterisk and indicates which file set it (global version or a local .tex-version).\n\n## Selecting the active version\n\nSet the global default:\n\n```bash\ntexenv global 2024.09\n```\n\nSet a project‑local version (writes .tex-version in the current directory):\n\n```bash\ntexenv local 2024.11\n```\n\nCheck the current version:\n\n```bash\ntexenv version\n```\n\n## Executing TeX commands\n\nUse texenv exec to run any TeX program inside the active version:\n\n```bash\ntexenv exec pdflatex main.tex\ntexenv exec tlmgr info geometry\n```\n\nBehavior with tlmgr:\n- Before tlmgr install/update/info/search, texenv ensures repository configuration (`texenv repo`).\n- After tlmgr install/update/uninstall/remove, shims are regenerated (`texenv rehash` invoked).\n\nShims let you call commands directly (e.g. `pdflatex`) once generated. texenv resolves the correct version via TinyTeX-Version and source metadata.\n\n## Rehashing shims\n\nAfter installs, removals, or tlmgr operations that change available binaries:\n\n```bash\ntexenv rehash\n```\n\n## Repository management (tlmgr)\n\nShow current repository:\n\n```bash\ntexenv repo -s\n```\n\nAuto-selection (default):\n- If TeX Live year equals the current year, uses the latest tlnet:\n  - https://ctan.math.illinois.edu/systems/texlive/tlnet\n- Otherwise uses the historic archive for that year:\n  - https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/[YEAR]/tlnet-final\n\nSet a per-version mirror override (persisted):\n\n```bash\ntexenv repo -m https://mirror.example.org/tex-archive/systems/texlive/tlnet\n```\n\nMirror overrides are stored at:\n\n- config/[version]/mirror_repo.txt\n\nIf the requested repository matches the current setting, the command is a no-op.\n\n## Freezing packages\n\nGenerate a requirements file of currently installed packages:\n\n```bash\ntexenv freeze\n```\n\nCreate a lock file including the TeX Live version (first line comment):\n\n```bash\ntexenv freeze --lock\n# file header example:\n# TeX Live: 2024\n```\n\nFiles produced:\n\n- tex-require.txt\n- tex-require.lock\n\n## Restoring packages\n\nRestore from whichever requirements file exists (prefers lock):\n\n```bash\ntexenv restore\n```\n\nNotes:\n- Installs packages that are listed but not currently installed.\n- Does not remove extra packages.\n- If the lock file requires a newer TeX Live than the active one, restore aborts to protect compatibility.\n\n## Inspecting environment\n\n```bash\ntexenv env\n```\n\nShows:\n\n- Active TinyTeX version\n- TEXMF path variables (via kpsewhich)\n- Active configured repositories\n- texenv-related PATH entries\n- Installed versions summary\n\n## Shell-scoped version\n\nSpawn a new subshell with a specified version (exports TEXENV_VERSION for the shell):\n\n```bash\neval \"$(texenv shell 2024.09)\"\n```\n\nIf no version is provided and no shell-specific version is set, it reports the state.\n\n## Uninstalling a version\n\n```bash\ntexenv uninstall 2024.09\n```\n\n## How version resolution works\n\n- Local .tex-version in the current or parent directories overrides global version.\n- Global version stored in ~/.texenv/version used when no local file found.\n- resolveVersion outputs both TinyTeX-Version and TinyTeX-Path (for shell-scoped versions, the path indicates the shell origin).\n\n## Directory layout\n\n- versions/[ver] contains the extracted TinyTeX tree (bin/[platform]/... etc.)\n- shims/[cmd] are small Bash launchers pointing back to bin/texenv exec\n- texmf/ is assigned to TEXMFHOME for user-level additions\n- config/ stores internal data:\n  - cmd_list_cache.txt\n  - [version]/mirror_repo.txt\n\n## Environment variables\n\n- `TEXENV_ROOT` (default: `$HOME/.texenv`) — installation root\n- `TEXENV_DIR` (default: current working directory) — used for local `.tex-version` lookup\n- `TEXENV_VERSION` — override active version for the current shell session\n- `TEXENV_PLATFORM` (detected: `universal-darwin`, `x86_64-linux`, or `aarch64-linux`)\n- `TEXENV_BIN` — path to `$TEXENV_ROOT/bin`; prepended to `PATH` by `init -`\n- `TEXENV_SHELL` — set to the current shell name (`${SHELL##*/}`) by `init -`\n- `TEXENV_DEBUG=1` — enables shell tracing (`set -x`)\n- `TEXMFHOME` — overridden to `$TEXENV_ROOT/texmf` (user TeX macro folder)\n\n## Removing texenv\n\n1. Delete ~/.texenv\n2. Remove initialization lines from your shell profile\n3. Remove PATH entries referencing ~/.texenv/bin and ~/.texenv/shims\n\n## Contributing\n\n- Open issues for bugs or enhancement ideas.\n- Submit pull requests with concise commits and description.\n- Keep code Bash-compatible; avoid external dependencies.\n\n## License\n\nMIT License. See LICENSE file.\n\n## Disclaimer\n\ntexenv manages TinyTeX distributions non-destructively. It does not replace full TeX Live installations; for advanced scenarios (custom schemes, system-wide install) use official TeX Live tools directly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredpeacock78%2Ftexenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredpeacock78%2Ftexenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredpeacock78%2Ftexenv/lists"}