personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add `sol root` subcommand for scripting

Prints the repo root path so scripts can inline it: `cd $(sol root)`.
Extracts get_project_root() helper in think/utils.py, used by both
the new command and existing get_journal_info().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+31 -2
+4
skills/solstone/SKILL.md
··· 122 122 sol call support diagnose 123 123 ``` 124 124 125 + ## Paths 126 + 127 + `sol root` prints the solstone repo root — useful for scripting: `cd $(sol root)`, `SOL=$(sol root)`. 128 + 125 129 ## Environment 126 130 127 131 The `sol` CLI uses three environment variables that default sensibly:
+7
sol.py
··· 299 299 print(path) 300 300 return 301 301 302 + # Root command — print repo root for scripting: SOL=$(sol root) 303 + if cmd == "root": 304 + from think.utils import get_project_root 305 + 306 + print(get_project_root()) 307 + return 308 + 302 309 # Resolve command to module path 303 310 try: 304 311 module_path, preset_args = resolve_command(cmd)
+14
tests/test_sol.py
··· 216 216 assert path != "" 217 217 assert path.endswith("/journal") 218 218 219 + def test_main_root_command(self, monkeypatch, capsys): 220 + """Test 'root' command prints the project root directory.""" 221 + monkeypatch.setattr(sys, "argv", ["sol", "root"]) 222 + 223 + sol.main() 224 + 225 + captured = capsys.readouterr() 226 + path = captured.out.strip() 227 + assert path != "" 228 + # root should NOT end with /journal — that's --path 229 + assert not path.endswith("/journal") 230 + # should be a parent of the journal path 231 + assert path.endswith("/solstone") or "/solstone" in path 232 + 219 233 def test_main_unknown_command_exits(self, monkeypatch): 220 234 """Test that unknown command exits with code 1.""" 221 235 monkeypatch.setattr(sys, "argv", ["sol", "unknown-command"])
+6 -2
think/utils.py
··· 78 78 sys.stdout.write("\n") 79 79 80 80 81 + def get_project_root() -> str: 82 + """Return the absolute path to the solstone repository root.""" 83 + return str(Path(__file__).resolve().parent.parent) 84 + 85 + 81 86 def get_journal_info() -> tuple[str, str]: 82 87 """Return the journal path and its source. 83 88 ··· 91 96 if override: 92 97 return override, "override" 93 98 94 - project_root = Path(__file__).resolve().parent.parent 95 - journal = str(project_root / "journal") 99 + journal = str(Path(get_project_root()) / "journal") 96 100 return journal, "project" 97 101 98 102