NuSpec.AI Pro

Getting Started

Everything you need to set up NuSpec.AI.Pro.

Install

Add to your packable project (the one you run dotnet pack on):

<PackageReference Include="NuSpec.AI.Pro" Version="1.0.3" PrivateAssets="all" />

<!-- Optional: attribute support -->
<PackageReference Include="NuSpec.AI.Attributes" Version="1.0.3" />

NuSpec.AI.Pro is a development dependency — it does not ship as a runtime dependency of your package.

Set your license key

Choose one of three ways (highest priority first):

1. MSBuild property (recommended for CI)

<PropertyGroup>
  <NuSpecAiLicenseKey>$(NUSPEC_AI_LICENSE_KEY)</NuSpecAiLicenseKey>
</PropertyGroup>

Set NUSPEC_AI_LICENSE_KEY as a secret in your CI environment.

2. Environment variable

export NUSPEC_AI_LICENSE_KEY=<your-key>

3. User file

~/.nuspec-ai/license.key

Paste your key (just the JWT string) into this file.

Choose your formats

<PropertyGroup>
  <NuSpecAiFormats>ultra</NuSpecAiFormats>   <!-- 77% fewer tokens -->
  <!-- Options: json | yaml | compact | ultra | all | semicolon-separated -->
</PropertyGroup>
FormatFileAvg. savings
jsonai/package-map.jsonBaseline
yamlai/package-map.yaml−29%
compactai/package-map.compact.json−40%
ultraai/package-map.ultra−71%

CI/CD setup

GitHub Actions

# Add to your repo secrets: NUSPEC_AI_LICENSE_KEY
- name: Pack
  env:
    NUSPEC_AI_LICENSE_KEY: ${{ secrets.NUSPEC_AI_LICENSE_KEY }}
  run: dotnet pack

Azure DevOps

# Add to pipeline library: NUSPEC_AI_LICENSE_KEY
- task: DotNetCoreCLI@2
  env:
    NUSPEC_AI_LICENSE_KEY: $(NUSPEC_AI_LICENSE_KEY)
  inputs:
    command: pack

Attribute support

Install NuSpec.AI.Attributes to annotate types and members:

using NuSpec.AI;

[AiRole("aggregate-root", "audited")]
public class Order { }

[AiIgnore]
public string InternalToken { get; set; }

[AiDescription("Do not call for subscription orders.")]
public Task RefundAsync(int orderId) { }

Coexistence with the free package

If both NuSpec.AI and NuSpec.AI.Pro are referenced, Pro wins automatically. The free package sits inert. You can safely remove the free package reference.

FAQ

What happens when my annual license expires?

The tool falls back to standard JSON output and emits a NSPECAI001 warning. Your build never fails. Renew via the Stripe Customer Portal to get a new key.

Is the license validated offline?

Yes — entirely. The license key is a signed JWT verified against a public key embedded in the tool binary. No network calls at pack time, ever.

Can I use one key for multiple projects and developers?

Yes. Per-org licensing means one key covers all packages, all devs, and all CI environments in your organization.