Skip to content

interlynk-io/pylynk

Repository files navigation

pylynk: Command Line Tool for the Interlynk Platform

GitHub all releases

pylynk is the official CLI tool for interfacing with Interlynk's SBOM management platform. Upload, download, and manage SBOMs (Software Bill of Materials) from your terminal or CI/CD pipelines.

Installation

Using pip

git clone https://github.com/interlynk-io/pylynk
cd pylynk
pip3 install -r requirements.txt
python3 pylynk.py --help

Using Docker

docker pull ghcr.io/interlynk-io/pylynk:latest

Or build locally:

docker build -t pylynk .

Authentication

Set your security token via environment variable (recommended):

export INTERLYNK_SECURITY_TOKEN=your_token_here

Or pass it with each command:

python3 pylynk.py prods --token your_token_here

Quick Start

Upload an SBOM

python3 pylynk.py upload --prod 'my-product' --sbom my-sbom.json

Download an SBOM

python3 pylynk.py download --prod 'my-product' --verId 'version-id' --out-file sbom.json

List Vulnerabilities

python3 pylynk.py vulns --prod 'my-product' --env 'production'

Using Docker

# Upload
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN \
  -v $(pwd):/app/data \
  ghcr.io/interlynk-io/pylynk upload --prod 'my-product' --sbom /app/data/my-sbom.json

# Download
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN \
  -v $(pwd):/app/data \
  ghcr.io/interlynk-io/pylynk download --prod 'my-product' --verId 'version-id' --out-file /app/data/sbom.json

Commands

Command Description Documentation
prods List products docs/prods.md
vers List versions for a product docs/vers.md
status Check SBOM processing status docs/status.md
upload Upload an SBOM docs/upload.md
download Download an SBOM docs/download.md
vulns List vulnerabilities docs/vulns.md
version Show pylynk version -

Output Formats

All commands support multiple output formats via --output:

  • table - Human-readable table format (default)
  • json - JSON format for programmatic use
  • csv - CSV format for spreadsheet import

Commands with timestamps also support --human-time to display timestamps in human-friendly format (e.g., '2 days ago').

# Table format (default)
python3 pylynk.py prods

# JSON format
python3 pylynk.py prods --output json

# CSV format
python3 pylynk.py prods --output csv

# With human-friendly timestamps
python3 pylynk.py prods --human-time

CI/CD Integration

PyLynk automatically detects CI environments (GitHub Actions, Bitbucket Pipelines, Azure DevOps) and captures build metadata during uploads.

See docs/ci-cd.md for detailed CI/CD integration instructions.

Environment Variables

Variable Description
INTERLYNK_SECURITY_TOKEN Authentication token (required)
INTERLYNK_API_URL Override API endpoint (default: https://api.interlynk.io/lynkapi)
PYLYNK_INCLUDE_CI_METADATA Control CI metadata collection (auto/true/false)

Debugging

Enable verbose output:

python3 pylynk.py prods --verbose

Point to a different API endpoint:

export INTERLYNK_API_URL=http://localhost:3000/lynkapi

Troubleshooting

Error Solution
"Authentication failed" Verify your INTERLYNK_SECURITY_TOKEN is correct
"Product not found" Check product name spelling and organization access
"Version not found" Verify version ID or use vers command to list available versions

Docker with Local API

On macOS/Windows, use host.docker.internal:

export INTERLYNK_API_URL=http://host.docker.internal:3000/lynkapi
docker run -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN \
  -e INTERLYNK_API_URL=$INTERLYNK_API_URL ...

On Linux, use --network="host":

docker run --network="host" -e INTERLYNK_SECURITY_TOKEN=$INTERLYNK_SECURITY_TOKEN ...

Other SBOM Open Source Tools

Contact

Stargazers

If you like this project, please support us by starring it.

Stargazers

About

Interlynk CLI

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 6