Skip to content

CLI Extension Management Guide

This guide explains how to install, manage, and uninstall SPM extensions using the command-line interface.

Table of Contents

  1. Overview
  2. Installing Extensions
  3. Listing Installed Extensions
  4. Uninstalling Extensions
  5. Browsing Available Extensions
  6. Searching Extensions
  7. Extension Package Structure

Overview

The SPM CLI provides comprehensive extension management capabilities:

  • Install extensions from local .nupkg files
  • List all installed extensions with metadata
  • Uninstall extensions cleanly
  • Browse available extensions in the registry
  • Search for extensions by keywords

All extension management commands are under the spm extension namespace.


Installing Extensions

From Local Package File

Install an extension from a local .nupkg file:

spm extension install path/to/MyExtension.1.0.0.nupkg

What happens during installation:

  1. Extraction - The .nupkg file is extracted to the Extensions/ directory
  2. Metadata - Package metadata is read from the .nuspec file
  3. File Organization - Files are organized according to NuGet conventions:
  4. lib/net10.0/*.dll → Copied to extension directory
  5. content/**/* → Static files (CSS, JS, images)
  6. contentFiles/**/* → Content files
  7. Registration - Extension metadata is saved to extension.json

Example Output:

Installing extension: MyCustomExtension.1.0.0.nupkg
  Source: Local file
  Extracting to: C:\Cesivi\Extensions
✓ Extension 'MyCustomExtension' v1.0.0 installed successfully
  Package ID: MyCustomExtension
  Version: 1.0.0
  Location: C:\Cesivi\Extensions\MyCustomExtension

From NuGet.org (Future Enhancement)

Direct installation from NuGet.org is planned for future releases:

# Planned feature (not yet implemented)
spm extension install MyCustomExtension --version 1.0.0

Current Workaround:

  1. Download the .nupkg file from NuGet.org manually
  2. Install using the local file path

Listing Installed Extensions

Basic List

List all installed extensions:

spm extension list

Example Output:

Installed SPM Extensions:
─────────────────────────────────
• MyCustomExtension v1.0.0
• CesiviExtensions.Example v1.0.0
• CustomTheme v2.1.0

Total: 3 extension(s)

Verbose Mode

Get detailed information about installed extensions:

spm extension list --verbose

Example Output:

Installed SPM Extensions:
─────────────────────────────────
• MyCustomExtension v1.0.0
  Location: C:\Cesivi\Extensions\MyCustomExtension
  Description: Custom field renderers and WebParts

• CesiviExtensions.Example v1.0.0
  Location: C:\Cesivi\Extensions\CesiviExtensions.Example
  Description: Example extension with field renderers, WebParts, and custom footer

Total: 2 extension(s)

Uninstalling Extensions

Remove an installed extension:

spm extension uninstall MyCustomExtension

Interactive Confirmation:

Uninstall extension 'MyCustomExtension'? (y/N): y
Uninstalling extension: MyCustomExtension
✓ Extension 'MyCustomExtension' uninstalled successfully

Skip Confirmation:

spm extension uninstall MyCustomExtension --yes

What happens during uninstallation:

  1. Metadata Removal - Extension metadata is removed from configuration
  2. File Deletion - Extension directory and all files are deleted
  3. Cleanup - Any static file registrations are cleaned up

Browsing Available Extensions

Browse all available extensions in the registry:

spm extension browse

Example Output:

All Extensions:
═════════════════════════════════════════════════════════════
• Advanced Charts v1.2.0 [INSTALLED]
  ID: advanced-charts
  [WebPart] by SPM Community
  Create interactive charts using Chart.js and D3.js
  Downloads: 1250

• Custom Authentication v2.0.1
  ID: custom-auth
  [Extension] by Security Team
  SAML and OAuth 2.0 authentication providers
  Downloads: 890

Total: 13 extension(s)

Use 'spm extension info <id>' for detailed information
Use 'spm extension search <query>' to search extensions

Filter by Category:

spm extension browse --category WebPart

Available Categories:

  • FieldRenderer - Custom field rendering components
  • WebPart - Page components and widgets
  • Extension - General extensibility plugins
  • Theme - Visual themes and styles
  • Workflow - Workflow activities and triggers
  • Authentication - Authentication providers
  • Storage - Storage providers
  • Other - Miscellaneous extensions

Searching Extensions

Search for extensions by keywords:

spm extension search chart

Example Output:

Search results for 'chart':
═════════════════════════════════════════════════════════════
• Advanced Charts v1.2.0
  ID: advanced-charts
  [WebPart] by SPM Community
  Create interactive charts using Chart.js and D3.js
  Downloads: 1250

• Chart WebPart v1.0.0
  ID: chart-webpart
  [WebPart] by Core Team
  Simple chart rendering for lists
  Downloads: 340

Found 2 extension(s)

Search with Category Filter:

spm extension search authentication --category Extension

Search matches against:

  • Extension name
  • Description
  • Author
  • Tags

Extension Package Structure

NuGet Package (.nupkg) Format

Extensions are distributed as standard NuGet packages with the following structure:

MyCustomExtension.1.0.0.nupkg
├── MyCustomExtension.nuspec          # Package metadata
├── lib/
│   └── net10.0/
│       ├── MyCustomExtension.dll     # Extension assembly
│       └── Dependencies.dll          # (if any)
├── content/
│   └── wwwroot/
│       ├── css/
│       │   └── custom-styles.css     # Static CSS files
│       ├── js/
│       │   └── custom-scripts.js     # Static JavaScript files
│       └── images/
│           └── logo.png              # Images and assets
└── README.md                         # (optional)

Extension Metadata (extension.json)

After installation, each extension has a metadata file:

{
  "packageId": "MyCustomExtension",
  "version": "1.0.0",
  "installedDate": "2026-01-17T10:30:00Z",
  "enabled": true
}

.nuspec File Example

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>MyCustomExtension</id>
    <version>1.0.0</version>
    <authors>Your Name</authors>
    <description>Custom field renderers and WebParts for SPM</description>
    <tags>spm extension field-renderer webpart</tags>
    <dependencies>
      <group targetFramework="net10.0">
        <dependency id="Cesivi.WebUI" version="1.0.0" />
      </group>
    </dependencies>
  </metadata>
</package>

Creating Your Own Extension Package

1. Build Your Extension Project

cd MyCustomExtension
dotnet build --configuration Release

2. Create NuGet Package

dotnet pack --configuration Release

This creates bin/Release/MyCustomExtension.1.0.0.nupkg

3. Install Locally for Testing

spm extension install bin/Release/MyCustomExtension.1.0.0.nupkg

4. Verify Installation

spm extension list --verbose

Troubleshooting

Extension Not Loading

Problem: Extension installed but not appearing in WebUI

Solutions:

  1. Restart Server - Extensions are loaded at startup

    spm restart
    

  2. Check Extension Path - Verify files are in Extensions/ directory

    spm extension list --verbose
    

  3. Check Logs - Look for extension loading errors

    tail -f logs/cesivi.log
    

Installation Failed

Problem: spm extension install fails with extraction error

Solutions:

  1. Verify Package - Ensure .nupkg file is valid:

    # Extract manually to inspect contents
    unzip MyExtension.nupkg -d temp/
    

  2. Check Permissions - Ensure write access to Extensions/ directory

  3. Check Disk Space - Ensure sufficient disk space

Uninstall Failed

Problem: Extension directory not deleted

Solutions:

  1. Close Applications - Ensure no processes are using extension files
  2. Manual Deletion - Delete extension directory manually:
    rm -rf Extensions/MyCustomExtension
    

Best Practices

Extension Installation

  1. Review Source - Only install extensions from trusted sources
  2. Test in Development - Test extensions in dev environment first
  3. Read Documentation - Check extension documentation before installing
  4. Backup Configuration - Backup appsettings.json before installing

Extension Development

  1. Follow Naming Conventions - Use clear, descriptive package IDs
  2. Version Properly - Follow semantic versioning (SemVer)
  3. Include Documentation - Provide README and usage examples
  4. Test Thoroughly - Test installation, operation, and uninstallation
  5. Declare Dependencies - Specify all required dependencies in .nuspec

Extension Management

  1. Keep Extensions Updated - Regularly check for updates
  2. Monitor Performance - Watch for performance impacts
  3. Limit Extensions - Only install needed extensions
  4. Regular Cleanup - Uninstall unused extensions


Last Updated: 2026-01-17 Created for: PLAN-149 Phase 3.3 (Extension CLI Install/Package)