Skip to main content

Solwyn CLI

Work with Solwyn from the command line: enforce and attribute LLM spend for calls the Solwyn SDK does not instrument, inspect budgets, costs, and provider health, and recover from leaked or expired project keys — from your terminal, your scripts, or your coding agent.

This README describes solwyn-cli 0.3.0. The package is distributed on PyPI as solwyn-cli; run solwyn --version to see which version you have installed, and use solwyn --help and MCP discovery to inspect its exact surface.

Installation

Install the published package with uv:

uv tool install solwyn-cli
solwyn --version

Or use pipx install solwyn-cli. For development or unreleased commands, install from an authorized checkout with uv tool install ..

Requires Python 3.11 or newer. The package installs two identical executables: solwyn and solwyn-cli (an alias matching the package name).

Getting started

solwyn login          # authenticate; use --with-key to store a project key instead
solwyn init           # configure Solwyn for the current repository
solwyn status         # project budget and provider health at a glance

solwyn init authenticates, selects a project, writes local configuration, detects the provider SDKs your code imports, prints the wiring for each, and verifies your budget end-to-end. Add --agents to also write guidance files for Claude, Cursor, and AGENTS.md.

Three ways to use it

Calls made through the Solwyn Python SDK are enforced and attributed automatically. The CLI covers the three cases the SDK cannot reach.

Give a coding agent a budget

solwyn mcp serves read, guardrail, and attribution tools to any MCP client over local stdio, resolving configuration and credentials fresh on every call. Standard MCP capability and schema discovery exposes the exact tools and input/output shapes in the running version. solwyn agent-context prints a compact SDK 0.6 capability contract suitable for pasting into an agent's context, and solwyn init --agents writes the equivalent guidance into the repository.

solwyn --project proj_0123456789abcdef01234567 mcp --profile read   # 33 read tools
solwyn --project proj_0123456789abcdef01234567 mcp                  # default guardrails profile, all 37 tools
solwyn doctor --mcp                                                 # verify the wiring

Customer reads include account-wide alert activity and open deliveries, last firing, advisory unpriced outage traffic, plan catalog/status/change preview, identity/email verification, phone/SMS prerequisites, team roster/invitations, cost analysis/simulation, provider visibility and audit. The 33 reads appear in both profiles; billing/team/member writes remain CLI-only. See alerts, budget, plan, account, team and invitation acceptance.

Start with the MCP quickstart. Profiles are fixed at launch and never grant permissions; see MCP profiles and tool contracts and the agent integration guide.

Gate CI on budget

One pipeline step, one exit code, no code change. budget status is a pure read, so a read-only key is enough.

# Exit 4 when the project is at or over 80% of its monthly budget.
solwyn --json budget status --max-utilization 80

See Gate CI on budget.

Meter a call the SDK does not wrap

For a curl, another language, or a one-off script, reserve budget before the call and settle it after. A denied check exits with code 4, so scripts stop before they spend.

# 1. Reserve immediately before the call.
solwyn budget check --provider openai --model gpt-4.1 --estimated-input-tokens 1200

# 2. Make the provider call yourself.

# 3. Settle with what the call actually used. This also records attribution.
solwyn budget confirm --call-id 12345678-1234-1234-1234-123456789abc --provider openai --model gpt-4.1 \
  --reservation-id "$RESERVATION" --input-tokens 1180 --output-tokens 640

The CLI's caller-owned workflow maintains parity with Solwyn Python SDK 0.6.0 semantics and covers enforcement and attribution. Use record for a completed call that had no reservation, such as a local model. The same loop prices image, video, audio, and speech calls by their billed units, declares fallback intent, scopes enforcement to a single agent run, and reserves for a batch of calls at once; see Meter un-instrumented calls for the walkthrough and caller-owned spend reference for the full rules.

Commands

Every command's --help states its exit codes, authentication requirements, and JSON output schema.

Group Commands
Setup and identity init, login, logout, whoami, doctor
Monitoring status, costs, forecast, overview, providers
Budget guardrails budget status / check / confirm / set, record, runs
Agents mcp, mcp-config, agent-context
Administration budget rules / rule / threshold, alerts, channels, notifications, webhooks, keys, projects, account, tags, audit, attest, plan, config

Account management includes subscription preview, change, cancellation/resume, scheduled-change discard, hosted checkout/portal links and pending-intent dismissal. Billing writes require owner JWT and confirmation or --yes; preview is a JWT read at any role. See the plan reference. The in-repo command reference describes this checkout. The published guide lives in the CLI docs.

Scripting

API and setup commands support global --json for schema-bearing JSON output (each payload names its schema, e.g. solwyn.costs.v1), and exit codes are stable and documented per command: 0 success, 2 usage, with distinct codes for API, auth, budget-denial, and not-found failures. The local config commands emit plain text. Global flags select the project (--project), API base URL (--api-url), and output format, and go before the subcommand.

Trust posture

Solwyn CLI:

  • sends only your own spend events; sdk_instance_id is an invocation ID (the retained operation UUID for recoverable MCP batches); no telemetry;
  • never captures, logs, or transmits prompts or responses;
  • never collects, stores, or proxies provider API keys;
  • has no telemetry, update checks, or phone-home behavior; and
  • stores Solwyn credentials only in the operating system keychain, never in configuration files, command-line arguments, or output.

Development

The project uses uv for dependency and environment management. See CONTRIBUTING.md for the full local workflow and contract-update rules.

uv sync --locked --all-groups
uv run solwyn --version
uv run ruff check .
uv run ruff format --check .
uv run pytest

Two test-suite properties worth knowing before contributing:

  • Any change to the CLI surface (commands, flags, help text, exit codes, JSON output) requires regenerating the machine-readable contract snapshot with scripts/generate_contract.py; tests/test_contract_snapshot.py fails until you do.
  • The vendored OpenAPI snapshot and its drift guards are self-invalidating by design — adopt fields properly or record a decline in the registry; never loosen a guard to make a test pass.

The vendored snapshot has two independent safeguards: public CLI CI checks its age and the checked-in request/response contracts, while a proposed private monitor compares its content with Core. The private monitor, ownership, and verified Core follow-ups are documented in Core contract follow-ups and tracked in Core issue #403.

Further in-repo references: MCP release checklist, bounded MCP work and recovery, MCP diagnostics, media confirmation, and staging smoke tests.

Security

Please report security issues privately as described in SECURITY.md.

License

Licensed under the Apache License 2.0. See LICENSE.

Metadata

Release files for solwyn-cli 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solwyn-cli 0.3.0
File Size Uploaded Provenance Actions
solwyn_cli-0.3.0.tar.gz 845.0 kB With provenance Details for solwyn_cli-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for solwyn-cli 0.3.0
File Interpreter ABI Platform Actions
solwyn_cli-0.3.0-py3-none-any.whl Python 3 none any Details for solwyn_cli-0.3.0-py3-none-any.whl

Total release size: 1.2 MB

Release files / solwyn_cli-0.3.0.tar.gz

Download URL solwyn_cli-0.3.0.tar.gz
Size 845.0 kB
Tags Source
SHA-256 checksum
How to use checksums
86ee499773ad63804d67594c434824b015aea1f93932485abd451fa29755f423
BLAKE2b-256 checksum
How to use checksums
124497ad3af85f341434c62c4aa982cce26414564898dd7fab30e87454282411
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / solwyn_cli-0.3.0-py3-none-any.whl

Download URL solwyn_cli-0.3.0-py3-none-any.whl
Size 309.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8f2527b179f46229641b1ed240a2d2ce9b278b4f78ddd27cc080c7aa6dbdc3a
BLAKE2b-256 checksum
How to use checksums
0f6c653e2548e7e5747d9bcd74814bbb4b9681a82277f65d1965bbc5714d0d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for solwyn-cli 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for solwyn_cli-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page