From dac1aa91eacdfd77a715a43b326e145ebe58a02c Mon Sep 17 00:00:00 2001 From: antitree Date: Tue, 19 May 2026 21:54:26 -0400 Subject: [PATCH] feat: support TRACHE_HOME env var for shared cache directory Allows users to set TRACHE_HOME to a fixed path so trache works from any working directory without needing a .trache/ folder in each one. Falls back to .trache in cwd when unset, preserving existing behaviour. Co-Authored-By: Claude Sonnet 4.6 --- src/trache/cli/_context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/trache/cli/_context.py b/src/trache/cli/_context.py index a902bf8..aa47985 100644 --- a/src/trache/cli/_context.py +++ b/src/trache/cli/_context.py @@ -3,13 +3,15 @@ from __future__ import annotations import json +import os import re import shutil import sys from pathlib import Path from typing import Optional -TRACHE_ROOT = Path(".trache") +# If TRACHE_HOME is set, use it as the root; otherwise default to .trache in cwd. +TRACHE_ROOT = Path(os.environ["TRACHE_HOME"]) if "TRACHE_HOME" in os.environ else Path(".trache") _board_override: Optional[str] = None