-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.ps1
62 lines (53 loc) · 1.96 KB
/
install.ps1
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
56
57
58
59
60
61
62
# Symmetry CLI Install Script for Windows
$ErrorActionPreference = "Stop"
$RED = "`e[31m"
$GREEN = "`e[32m"
$YELLOW = "`e[33m"
$NC = "`e[0m"
function Print-Color($color, $message) {
Write-Host "$color$message$NC"
}
if (!(Get-Command npm -ErrorAction SilentlyContinue)) {
Print-Color $RED "Error: npm is not installed. Please install Node.js and npm first."
exit 1
}
Print-Color $YELLOW "Installing symmetry-cli globally..."
if (npm install -g symmetry-cli) {
Print-Color $GREEN "symmetry-cli installed successfully!"
} else {
Print-Color $RED "Failed to install symmetry-cli. Please check your npm configuration and try again."
exit 1
}
$config_dir = "$env:USERPROFILE\.config\symmetry"
$provider_yaml = "$config_dir\provider.yaml"
$user_secret = (Get-Random).ToString()
New-Item -ItemType Directory -Force -Path $config_dir | Out-Null
if (!(Test-Path $provider_yaml)) {
Print-Color $YELLOW "Creating provider.yaml file..."
@"
# Symmetry Configuration
apiHostname: localhost
apiKey:
apiChatPath: /v1/chat/completions
apiPort: 11434
apiProtocol: http
apiProvider: ollama
dataCollectionEnabled: true
maxConnections: 10
modelName: llama3.1:latest
name: $env:USERNAME
path: $config_dir
public: true
systemMessage:
userSecret: $user_secret
serverKey: 4b4a9cc325d134dee6679e9407420023531fd7e96c563f6c5d00fd5549b77435
"@ | Set-Content $provider_yaml
Print-Color $GREEN "provider.yaml created successfully at $provider_yaml"
} else {
Print-Color $YELLOW "provider.yaml already exists at $provider_yaml"
}
Print-Color $GREEN "Installation complete! You can now run 'symmetry-cli' to start your node."
Print-Color $YELLOW "Please edit $provider_yaml to customize your provider settings, especially:"
Print-Color $YELLOW " - apiKey: Add your API key if required"
Print-Color $YELLOW " - name: Currently set to your system username, change if needed"
Print-Color $YELLOW " - public: Set to true by default, change to false if you don't want to be publicly accessible"