import pathlib, subprocess, sys
repo=pathlib.Path(sys.argv[1]); repo.mkdir(parents=True,exist_ok=True)
def git(*args): subprocess.run(['git','-C',str(repo),*args],check=True,stdout=subprocess.DEVNULL)
git('init','--initial-branch=main')
(repo/'README.md').write_text('Unicode branch checkout demonstration\n')
(repo/'t3.json').write_text('{"defaultThreadEnvMode":"local"}\n')
git('add','.'); git('-c','user.name=Demo','-c','user.email=demo@example.invalid','commit','-m','Initial commit')
git('branch','\u3000');git('branch','feature')
subprocess.run(['node','apps/server/src/bin.ts','project','add',str(repo),'--title','demo-repo','--base-dir',sys.argv[2]],check=True)
