systemlink-cliSystemLink CLI
SystemLink CLI (slcli) is a cross-platform Python CLI for SystemLink integrators, providing comprehensive management of SystemLink resources via REST APIs.
Features
-
Secure Authentication: Credential storage using keyring with
login/logoutcommands - Test Plan Templates: Complete management (list, export, import, delete) with JSON and table output formats
- Jupyter Notebooks: Full lifecycle management (list, download, create, update, delete) with workspace filtering
- Cross-Platform: Windows, macOS, and Linux support with standalone binaries
- Professional CLI: Consistent error handling, colored output, and comprehensive help system
- Output Formats: JSON and table output options for programmatic integration and human-readable display
- Extensible Architecture: Designed for easy addition of new SystemLink resource types
- Quality Assurance: Full test suite with CI/CD, linting, and automated packaging
Installation
Homebrew (macOS/Linux)
Install SystemLink CLI using Homebrew from our official tap:
# Add the NI developer tools tap brew tap ni-kismet/homebrew-ni # Install slcli brew install slcli
From Source
-
Install dependencies:
poetry install
Quick Start
-
Login to SystemLink:
slcli login
-
List available resources:
# View test plan templates slcli templates list # View notebooks slcli notebook list
-
Get help for any command:
slcli --help slcli templates --help slcli notebook --help
Development Setup
-
Install Poetry (if not already installed):
pip install poetry
-
Install dependencies:
poetry install
Running
-
Run the CLI directly:
poetry run slcli
-
Or as a Python module:
poetry run python -m slcli
Build a Standalone Binary (Cross-Platform)
macOS/Linux (Homebrew/PyInstaller)
To build a single-file executable and Homebrew formula:
poetry run python scripts/build_homebrew.py
- This will:
- Build the PyInstaller binary in
dist/slcli/ - Create a tarball
dist/slcli.tar.gz - Generate a Homebrew formula
dist/homebrew-slcli.rbwith the correct SHA256
- Build the PyInstaller binary in
You can then install locally with:
brew install ./dist/homebrew-slcli.rb
Windows (Scoop/PyInstaller)
To build a Windows executable and Scoop manifest:
poetry run python scripts/build_pyinstaller.py poetry run python scripts/build_scoop.py
- This will:
- Build
dist/slcli.exe - Generate a Scoop manifest
dist/scoop-slcli.jsonwith the correct SHA256
- Build
You can use the manifest in your own Scoop bucket for easy installation.
CI/CD Automation
- All builds, tests, and packaging are automated via GitHub Actions for both Homebrew and Scoop.
- Artifacts (
slcli.tar.gz,homebrew-slcli.rb,slcli.exe,scoop-slcli.json) are uploaded for each build.
Release Process
Creating a Release
-
Update the version in
pyproject.toml:[tool.poetry] version = "0.2.0" # Update to new version
-
Create and push a git tag:
git tag v0.2.0 git push origin v0.2.0
-
Automated release workflow will:
- Run all tests and linting
- Build PyInstaller binaries for all platforms
- Generate Homebrew formula and Scoop manifest
- Create GitHub release with all artifacts
- Automatically update the Homebrew tap (
ni-kismet/homebrew-ni)
Release Artifacts
Each release automatically generates:
-
slcli.tar.gz- Source tarball for Homebrew -
homebrew-slcli.rb- Homebrew formula -
slcli.exe- Windows executable -
scoop-slcli.json- Scoop manifest for Windows
Homebrew Publishing
The release workflow automatically:
- Updates the formula in
ni-kismet/homebrew-nitap - Calculates SHA256 checksums
- Updates version and download URLs
- Commits changes to the tap repository
Users can then install the latest version with:
brew update brew upgrade slcli
Testing & Linting
- Run tests:
poetry run pytest
- Lint code:
poetry run ni-python-styleguide lint
Contributing
See the NI Python development wiki for contribution guidelines.
Authentication
Before using SystemLink CLI commands, you need to authenticate with your SystemLink server:
Login to SystemLink
slcli login
This will securely prompt for your API key and SystemLink URL, then store them using your system's keyring.
Logout (remove stored credentials)
slcli logoutTest Plan Template Management
The templates command group allows you to manage test plan templates in SystemLink.
List all test plan templates
# Table format (default) slcli templates list # JSON format for programmatic use slcli templates list --output json
Export a template to a local JSON file
slcli templates export --id <template_id> --output template.json
Import a template from a local JSON file
slcli templates import --file template.json
Delete a template
slcli templates delete --id <template_id>
Notebook Management
The notebook command group allows you to manage Jupyter notebooks in SystemLink.
List all notebooks in a workspace
# List all notebooks (table format - default) slcli notebook list # List notebooks in specific workspace slcli notebook list --workspace MyWorkspace # JSON format for programmatic use slcli notebook list --output json # Control pagination (table format only) slcli notebook list --take 50
Download notebook content and/or metadata
# Download notebook content (.ipynb) by ID: slcli notebook download --id <notebook_id> --output mynotebook.ipynb # Download notebook content by name: slcli notebook download --name MyNotebook --output mynotebook.ipynb # Download notebook metadata as JSON: slcli notebook download --id <notebook_id> --type metadata --output metadata.json # Download both content and metadata: slcli notebook download --id <notebook_id> --type both --output mynotebook.ipynb
Create a new notebook
# Create from existing .ipynb file: slcli notebook create --file mynotebook.ipynb --name MyNotebook slcli notebook create --file mynotebook.ipynb --workspace MyWorkspace --name MyNotebook # Create an empty notebook: slcli notebook create --name MyNotebook slcli notebook create --workspace MyWorkspace --name MyNotebook
Update notebook metadata and/or content
# Update metadata only: slcli notebook update --id <notebook_id> --metadata metadata.json # Update content only: slcli notebook update --id <notebook_id> --content mynotebook.ipynb # Update both metadata and content: slcli notebook update --id <notebook_id> --metadata metadata.json --content mynotebook.ipynb
Delete a notebook
slcli notebook delete --id <notebook_id>
Output Formats
SystemLink CLI supports both human-readable table output and machine-readable JSON output for list commands:
Table Output (Default)
- Colored, formatted tables using GitHub-style formatting
- Pagination support for large result sets
- Truncated text with ellipsis (…) for better readability
- Visual success (✓) and error (✗) indicators
JSON Output
- Complete data export without pagination
- Perfect for scripting and automation
- Consistent structure across all list commands
# Human-readable table slcli templates list slcli notebook list # Machine-readable JSON slcli templates list --output json slcli notebook list --output json
0 commit comments