Skip to content

SAIF CLI Installation

This guide provides step-by-step instructions for installing the SAIF CLI (Command Line Interface), a powerful tool for automating development workflows across multiple cloud services.

📚 Overview

The SAIF CLI is a console application published to a NuGet feed and installed using the .NET CLI. It provides a unified interface to automate common development tasks including:

  • 🎯 Creating projects with dotnet new templates
  • 🔄 Setting up Azure DevOps pipelines
  • 📦 Creating Azure DevOps repositories
  • ⚙️ Configuring project infrastructure
  • 🚀 Managing deployment workflows

✨ Why Use SAIF CLI

The SAIF CLI provides several key benefits:

  • 🎯 Single Interface: Perform multiple operations across various cloud services from one tool
  • 📏 Standardization: Ensures all projects in CIAM are created with consistent setup and naming conventions
  • ⚡ Automation: Reduces manual work by automating repetitive development tasks
  • 🔒 Best Practices: Enforces platform standards and best practices automatically
  • ⏱️ Time Savings: Streamlines project setup and configuration processes

📋 Prerequisites

Before installing the SAIF CLI, ensure you have:

  • ✅ Windows, macOS, or Linux operating system
  • .NET SDK installed (version 10.0 for Forge 3.0)
  • Terraform (for infrastructure development)
  • Node.js (for TypeScript development)
  • Docker Desktop (for local development)
  • ✅ PowerShell (for Windows) or Bash (for macOS/Linux)
  • ✅ Access to SAIF Corporation Azure DevOps organization
  • ✅ Appropriate permissions to access the SAIFCorporation NuGet feed

🚀 Installation Steps

Follow these steps to install the SAIF CLI on your development machine.

Step 1: Install Azure DevOps Credential Provider

The Azure DevOps Credential Provider is required to authenticate with the SAIFCorporation NuGet feed.

For Windows (PowerShell)

Open PowerShell and run the following command:

iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"

This command will:

  • Download and install the Azure Artifacts Credential Provider
  • Configure it to work with .NET Framework and .NET Core
  • Enable automatic authentication with Azure DevOps feeds

For macOS/Linux (Bash)

Open a terminal and run:

sh -c "$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)"

Step 2: Add SAIFCorporation NuGet Source

Add the SAIFCorporation NuGet feed as a package source:

dotnet nuget add source https://pkgs.dev.azure.com/SAIFCorporation/_packaging/SAIFCorporation/nuget/v3/index.json -n SAIFCorporation

What this does:

  • Registers the SAIFCorporation NuGet feed with your .NET CLI
  • Names the source "SAIFCorporation" for easy reference
  • Enables access to SAIF platform packages and tools

Step 3: Install SAIF CLI

Install the SAIF CLI as a global .NET tool:

dotnet tool update --global SAIF.Platform.CLI

Command explanation:

  • dotnet tool update --global: Installs or updates a global .NET tool
  • SAIF.Platform.CLI: The package name for the SAIF CLI
  • Using update instead of install ensures you get the latest version, even if already installed

Expected output:

Tool 'saif' (version '<latest version>') was successfully installed.

Step 4: Install Platform Packages and Templates

After installing the CLI, run saif update to download all the latest packages, tools, and SAIF templates for platform development:

saif update

✅ Verify Installation

After installation, verify that the SAIF CLI is correctly installed and accessible.

Check SAIF CLI Version

Run the following command:

saif --version

Expected output:

You should see the version number of the installed SAIF CLI, such as:

1.2.3

Test SAIF CLI Help

Display the available commands:

saif --help

This will show a list of available commands and options, confirming the CLI is working correctly.

🔄 Updating SAIF CLI

To update the SAIF CLI to the latest version, simply run:

saif update

This command will:

  • Check for the latest version in the SAIFCorporation feed
  • Download and install the update if available
  • Preserve your existing configuration

Alternative Update Method

You can also update using the .NET tool command:

dotnet tool update --global SAIF.Platform.CLI

Check for Updates

To see if an update is available without installing:

dotnet tool list --global

This shows all installed global tools and their current versions.

🔍 Troubleshooting

❌ Common Issues and Solutions

Issue: "Unable to load the service index for source"

Solution: Ensure you have access to the SAIFCorporation Azure DevOps organization and the credential provider is installed correctly.

# Reinstall the credential provider
iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"

# Clear NuGet cache
dotnet nuget locals all --clear

Issue: "Tool 'saif' is not recognized"

Solutions:

  • ✅ Ensure the .NET tools path is in your system PATH environment variable
  • ✅ Close and reopen your terminal/PowerShell window
  • ✅ Verify installation with dotnet tool list --global

Windows PATH location:

%USERPROFILE%\.dotnet\tools

macOS/Linux PATH location:

$HOME/.dotnet/tools

Issue: Authentication fails when installing

Solutions:

  • ✅ Ensure you're logged into Azure DevOps in your browser
  • ✅ Run the credential provider installation again
  • ✅ Try clearing cached credentials:
# Windows
cmdkey /delete:https://pkgs.dev.azure.com/SAIFCorporation

# macOS/Linux
rm -rf ~/.nuget/plugins/netcore

Issue: "A newer version of this tool already exists"

Solution: Use the update command instead of install:

dotnet tool update --global SAIF.Platform.CLI

Issue: Package source already exists

Solution: If the NuGet source is already added, you'll see an error. You can either:

  1. Skip this step, or
  2. Update the existing source:
dotnet nuget update source SAIFCorporation --source https://pkgs.dev.azure.com/SAIFCorporation/_packaging/SAIFCorporation/nuget/v3/index.json

🔧 Debugging Tips

Enable Detailed Logging

For more detailed error messages, set verbose logging:

$env:DOTNET_CLI_CONTEXT_VERBOSE="true"
saif --version

Check Installed Tools

List all globally installed .NET tools:

dotnet tool list --global

Verify NuGet Sources

List all configured NuGet sources:

dotnet nuget list source

📖 Next Steps

Now that you have the SAIF CLI installed, explore these resources:

  • 📘 View available commands: Run saif --help to see all available commands
  • 🚀 Create your first project: Use saif new to scaffold a new application
  • 🔧 Configure your environment: Set up additional tools and credentials
  • 📖 Explore documentation: Visit Forge Documentation for detailed guides

Common SAIF CLI Commands

Here are some frequently used commands to get you started:

# View CLI version
saif --version

# Show help for all commands
saif --help

# Show help for a specific command
saif <command> --help

# View available templates
saif new --help

# Create a new project from template (prompted for options)
saif new <template-name>

# Update SAIF CLI to the latest version
saif update

📖 Additional Resources


Happy automating with SAIF CLI! 🎉