Spaces:
Running
Running
| param( | |
| [string]$SpaceId = "patdev/mcp-bridge", | |
| [Parameter(Mandatory=$true)][string]$ApiKey, | |
| [string]$OAuthSigningKey = "", | |
| [string]$PublicBaseUrl = "", | |
| [string]$ChatgptCallbackUrl = "", | |
| [string]$OAuthClientId = "chatgpt", | |
| [string]$OAuthClientSecret = "", | |
| [switch]$Restart | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | |
| $root = Split-Path -Parent $scriptDir | |
| $argsList = @("$root\scripts\sync_hf.py", "--space-id", $SpaceId, "--api-key", $ApiKey) | |
| if ($OAuthSigningKey -ne "") { $argsList += @("--oauth-signing-key", $OAuthSigningKey) } | |
| if ($PublicBaseUrl -ne "") { $argsList += @("--public-base-url", $PublicBaseUrl) } | |
| if ($ChatgptCallbackUrl -ne "") { $argsList += @("--chatgpt-callback-url", $ChatgptCallbackUrl) } | |
| if ($OAuthClientId -ne "") { $argsList += @("--oauth-client-id", $OAuthClientId) } | |
| if ($OAuthClientSecret -ne "") { $argsList += @("--oauth-client-secret", $OAuthClientSecret) } | |
| if ($Restart) { $argsList += "--restart" } | |
| python @argsList | |