git clone https://github.com/Mibayy/token-savior
cd token-savior
python3 -m venv ~/.local/token-savior-venv
~/.local/token-savior-venv/bin/pip install -e ".[mcp]"
~/.local/token-savior-venv/bin/python - <<'EOF'
from token_savior.project_indexer import ProjectIndexer
from token_savior.query_api import create_project_query_functions
import tempfile, pathlib
tmpdir = tempfile.mkdtemp()
pathlib.Path(tmpdir + '/sample.py').write_text('''
class Greeter:
    def greet(self, name: str) -> str:
        return f"Hello, {name}!"
    def farewell(self, name: str) -> str:
        return f"Goodbye, {name}!"

def main(greeter: Greeter):
    print(greeter.greet("World"))
''')
indexer = ProjectIndexer(tmpdir)
index = indexer.index()
query = create_project_query_functions(index)
print('--- get_project_summary ---')
print(query['get_project_summary']())
print('--- find_symbol: greet ---')
print(query['find_symbol']('greet'))
print('--- get_change_impact: greet ---')
print(query['get_change_impact']('greet'))
EOF
