import json, pathlib, subprocess, sys, time
# Run from a checkout after vp i. Start gemini-api-fixture.py separately.
checkout = pathlib.Path.cwd()
home = checkout / '.t3'
workspace = pathlib.Path(sys.argv[1]).resolve() / str(time.time_ns()) / 'long-command-demo'
workspace.mkdir(parents=True)
settings = home / 'userdata' / 'settings.json'
settings.parent.mkdir(parents=True, exist_ok=True)
settings.write_text(json.dumps({'providerInstances': {'antigravity': {'driver': 'antigravity', 'enabled': True, 'config': {'enabled': True, 'authMethod': 'gemini-api-key', 'apiKey': 'synthetic-local-key'}}}}))
print('Before continuing, start T3CODE_DEV_SEED=0 GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:18765 vp run dev in this checkout.', flush=True)
input('Press Enter once it is listening: ')
subprocess.run(['git', 'init', '-q', str(workspace)], check=True)
(workspace / 'README.md').write_text('Synthetic long-command demonstration.\n')
subprocess.run(['git', '-C', str(workspace), 'add', '.'], check=True)
subprocess.run(['git', '-C', str(workspace), '-c', 'user.name=Demo', '-c', 'user.email=demo@example.invalid', 'commit', '-qm', 'Initial files'], check=True)
cli = ['node', 'apps/server/src/bin.ts']
subprocess.run(cli + ['project', 'add', str(workspace), '--title', 'Long command demo', '--base-dir', str(home)], check=True)
subprocess.run(cli + ['thread', 'start', '--base-dir', str(home), '--provider', 'antigravity', '--model', 'gemini-4-neon', '--option', 'runtimeMode=full-access', '--title', 'Long heredoc command', str(workspace), 'Write a ~10 KB notes.md with one shell heredoc.', '--wait', '--json'], check=True)
print('Open the returned thread in the web client. Hide sidebar and thread details; expand Worked for, then the command row. Capture at 1280x800, light theme.')
