-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.py
More file actions
55 lines (43 loc) · 1.7 KB
/
setup_env.py
File metadata and controls
55 lines (43 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
"""
Environment Setup Script for Tabula Rasa
This script helps users set up their .env file for the Tabula Rasa training system.
It will create a .env file based on the .env.template if one doesn't exist.
"""
import os
import shutil
from pathlib import Path
def setup_environment():
"""Set up the .env file for the user."""
env_file = Path('.env')
template_file = Path('.env.template')
print(" Tabula Rasa Environment Setup")
print("=" * 40)
# Check if .env already exists
if env_file.exists():
print(" .env file already exists")
print(f" Location: {env_file.absolute()}")
# Ask if user wants to update it
response = input("\n Do you want to update it with the latest template? (y/N): ").strip().lower()
if response not in ['y', 'yes']:
print(" Keeping existing .env file")
return
# Check if template exists
if not template_file.exists():
print(" .env.template file not found")
print(" Please ensure .env.template exists in the project root")
return
try:
# Copy template to .env
shutil.copy2(template_file, env_file)
print(f" Created .env file from template")
print(f" Location: {env_file.absolute()}")
print("\n Next steps:")
print(" 1. Edit .env file and add your ARC-3 API key")
print(" 2. Update any paths if needed")
print(" 3. Run the training system")
print(f"\n Get your API key from: https://three.arcprize.org")
except Exception as e:
print(f" Error creating .env file: {e}")
if __name__ == "__main__":
setup_environment()