ShellPilot

0.4.0-preview0002

GitHub Copilot in your PowerShell terminal: device-flow auth, model listing, chat and agentic tool-calling with usage and cost.

Minimum PowerShell version

7.0

This is a prerelease version of ShellPilot.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name ShellPilot -AllowPrerelease

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name ShellPilot -Prerelease

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) raandree. All rights reserved.

Package Details

Author(s)

  • raandree

Tags

GitHubCopilot Copilot AI LLM Chat Agent

Functions

Clear-ShpChat Clear-ShpContext Clear-ShpUsage ConvertTo-ShpTokenCount Get-ShpChat Get-ShpContext Get-ShpCosineSimilarity Get-ShpCostEstimate Get-ShpDefault Get-ShpModel Get-ShpModelName Get-ShpTool Get-ShpUsage Initialize-Shp Invoke-Shp Register-ShpTool Request-ShpEmbedding Resolve-ShpError Select-ShpModel Set-ShpContext Start-ShpChat Unregister-ShpTool

PSEditions

Core

Dependencies

This module has no dependencies.

Release Notes

## [0.4.0-preview0002] - 2026-07-28

### Added

- `Resolve-ShpError` explains the last error in the session and suggests a fix.
 It takes an error record (`$Error[0]` by default, or from the pipeline), sends
 the message, exception type, category, target, failing command line and script
 stack trace to the model, and returns the usual `Invoke-Shp` result. Every
 tool is disabled unless `-EnableTools` is passed, so diagnosing an error
 cannot touch the machine.
- `Invoke-Shp` supports `ShouldProcess`. `-WhatIf` dry-runs a whole agent turn -
 the model still plans and calls tools, but `write_file`, `create_directory`,
 `run_command` and user-registered tools are skipped and told they were not
 approved - and `-Confirm` prompts before each of those calls. Default
 behaviour is unchanged.
- `Invoke-Shp -MaxBudgetUSD` stops the tool-calling loop once the turn's
 estimated spend passes the cap, and the result carries a new `BudgetExceeded`
 flag.
- `Invoke-Shp -AppendSystemPrompt` adds inline system instructions in either
 parameter set, so a file-driven system prompt can still be topped up for a
 single call.
- `Invoke-Shp -AllowPrivateNetwork` opts the `fetch_url` tool back in to
 loopback, link-local and private addresses.
- `Start-ShpChat` gained the `/models`, `/history`, `/retry` and `/usage`
 commands. `/retry` drops the last exchange and resends the previous prompt.
- The price table supports a long-context tier. An entry may carry a
 `LongContext` block with a `Threshold` in input tokens plus its own rates, and
 the cost breakdown now reports `Tier` and `TiersUsed`.

### Fixed

- The `fetch_url` tool no longer reaches private networks. Every URL, including
 each redirect target, is checked before the request: only `http` and `https`
 are allowed, and host names must resolve to publicly routable addresses.
 Loopback, link-local (including the `169.254.169.254` cloud metadata address),
 RFC 1918, carrier-grade NAT, `0.0.0.0/8`, multicast and their IPv6 equivalents
 are refused, as are IPv4-mapped forms and names that fail to resolve.
 Redirects are followed manually, up to five hops, so a public URL can no
 longer bounce the model into the host's own network.
- Corrected the `gpt-5.6` rates, which shipped as placeholders. `gpt-5.6-luna`
 was charged five times its real rate (now 1.00 / 0.10 / 6.00 USD per million
 input / cached-input / output tokens) and `gpt-5.6-terra` twice
 (now 2.50 / 0.25 / 15.00). `gpt-5.6-sol` was already correct.
- Cost is now calculated per round-trip instead of on the turn totals. A model's
 long-context rate is selected by a single request's input size, so a turn made
 of several smaller round-trips is no longer at risk of being priced as one
 oversized request, and a genuinely oversized request is no longer under-priced
 at the default rate. Added the published thresholds and long-context rates for
 `gpt-5.4`, `gpt-5.5`, `gpt-5.6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra` and
 `gemini-3.1-pro`.
- Added the missing price-table entries for models the service advertises:
 `gemini-3-flash-preview`, `gemini-3.1-pro-preview`, `gemini-3.6-flash` and
 `mai-code-1-flash-picker`, which all reported empty cost and credit fields.
 Also added published rates for `claude-fable-5`, `claude-opus-4.8-fast` and
 `kimi-k2.7-code`.
- Request bodies are now serialised with a stable key order. PowerShell
 hashtables have no defined enumeration order and .NET randomises string
 hashing per process, so the same payload could serialise differently between
 runs and defeat backend prompt caching.
- `Invoke-Shp` and `Get-ShpCostEstimate` now report `CostUSD` and `Credits` for
 `claude-opus-5` and `claude-sonnet-5`. Neither model had an entry in
 `data/PriceTable.psd1`, and the price lookup matches the model id exactly, so
 every call using them returned empty cost, credit and cost-breakdown fields.
 The rates are the published ones: Opus 5 at 5.00 / 0.50 / 6.25 / 25.00 USD per
 million input / cached-input / cache-write / output tokens, and Sonnet 5 at
 its introductory 2.00 / 0.20 / 2.50 / 10.00 (the standard
 3.00 / 0.30 / 3.75 / 15.00 takes effect on 2026-09-01).

FileList

Version History

Version Downloads Last updated
0.4.0-previe... (current version) 4 7/28/2026
0.4.0-previe... 3 7/28/2026
0.3.1 12 7/23/2026
0.3.1-previe... 3 7/23/2026
0.3.0-previe... 8 7/12/2026
0.3.0-previe... 7 7/9/2026
0.3.0-previe... 4 7/9/2026
0.3.0-previe... 6 7/9/2026
0.2.1-previe... 8 7/8/2026
0.2.0 34 7/8/2026
0.2.0-previe... 6 7/8/2026
0.2.0-previe... 4 7/8/2026
0.2.0-previe... 31 6/12/2026
Show more