-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsh-agent.ps1
More file actions
51 lines (44 loc) · 1.24 KB
/
psh-agent.ps1
File metadata and controls
51 lines (44 loc) · 1.24 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
#!/usr/bin/env pwsh
<#
.SYNOPSIS
PshAgent CLI entry script
.DESCRIPTION
Launches the PshAgent interactive CLI.
This is a thin shim that imports the module and starts the REPL.
.PARAMETER ConnectionString
Provider/model connection string (e.g., 'anthropic/claude-sonnet-4-20250514')
.PARAMETER SystemPrompt
System prompt for the agent
.PARAMETER Compact
Enable compact output mode
.EXAMPLE
./psh-agent.ps1
.EXAMPLE
./psh-agent.ps1 -ConnectionString 'anthropic/claude-sonnet-4-20250514'
.EXAMPLE
./psh-agent.ps1 'openai/gpt-4o' -Compact
#>
[CmdletBinding()]
param(
[Parameter(Position = 0)]
[string]$ConnectionString,
[Parameter()]
[string]$SystemPrompt,
[Parameter()]
[switch]$Compact
)
$ErrorActionPreference = 'Stop'
# Import module from same directory
$modulePath = Join-Path $PSScriptRoot 'PshAgent' 'PshAgent.psd1'
if (-not (Test-Path $modulePath)) {
Write-Error "Module not found at $modulePath"
exit 1
}
Import-Module $modulePath -Force
# Build params
$params = @{}
if ($ConnectionString) { $params.ConnectionString = $ConnectionString }
if ($SystemPrompt) { $params.SystemPrompt = $SystemPrompt }
if ($Compact) { $params.Compact = $true }
# Start the interactive CLI
Start-PshAgent @params