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 newtemplates - 🔄 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:
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:
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:
Command explanation:
dotnet tool update --global: Installs or updates a global .NET toolSAIF.Platform.CLI: The package name for the SAIF CLI- Using
updateinstead ofinstallensures you get the latest version, even if already installed
Expected output:
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:
✅ Verify Installation¶
After installation, verify that the SAIF CLI is correctly installed and accessible.
Check SAIF CLI Version¶
Run the following command:
Expected output:
You should see the version number of the installed SAIF CLI, such as:
Test SAIF CLI Help¶
Display the available commands:
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:
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:
Check for Updates¶
To see if an update is available without installing:
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:
macOS/Linux PATH location:
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:
Issue: Package source already exists¶
Solution: If the NuGet source is already added, you'll see an error. You can either:
- Skip this step, or
- 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:
Check Installed Tools¶
List all globally installed .NET tools:
Verify NuGet Sources¶
List all configured NuGet sources:
📖 Next Steps¶
Now that you have the SAIF CLI installed, explore these resources:
- 📘 View available commands: Run
saif --helpto see all available commands - 🚀 Create your first project: Use
saif newto 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
📚 Related Documentation¶
- Your First Forge Application - Create a project using SAIF CLI
- Project Templates - Available templates for new projects
- Azure DevOps Services - Azure DevOps integration
- Version Compatibility - Supported .NET versions
📖 Additional Resources¶
Happy automating with SAIF CLI! 🎉