Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyt 689 migrate cli #337

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Cyt 689 migrate cli #337

wants to merge 20 commits into from

Conversation

shaynakapadia
Copy link
Collaborator

Summary

This MR migrates the rest of the cli to the new non-interactive surfactant cli with added commands for ease of use.

If merged this pull request will

  • migrated surfactant cli find command
  • migrated surfactant cli add command
  • added surfactant cli unload command
  • added surfactant cli merge command

Proposed changes

The changes here will finish migrating the existing cli interface to the new structure. Proposed workflow is below:

surfactant cli load sbom.json # Loads the sbom into surfactant, surfactantn saves it in ~/.surfactant in a serialized form
surfactant cli find --containerPath=^123* # Loads from serialized form and finds subset that matches args
surfactant cli add --installPath 123/ /bin/ # Adds new install path based on containerpath
surfactant cli merge # merges changes to the subset from find back into the main sbom
surfactant cli find --uuid 123 # Find one entry to edit based on uuid
surfactant cli edit --components="IsAGRAF" # Editing an array by picking the element, this one edits a specific component in this entry
Current Value: {"name": "IsAGRAF", "Vendor": "Rockwell Collins Automation"}
New Value: {"name": "IsAGRAF", "Vendor": ["Rockwell Collins Automation"], "version": "1.2.3"} 
surfactant cli edit --name # Edit a string value
Current Value: oldname.out
New Value: 1.2.3.CPO.out
surfactant cli merge # Merge changes back into the rest of the SBOM
surfactant cli save new_sbom.json # save edited sbom to a new file

@shaynakapadia shaynakapadia self-assigned this Feb 4, 2025
@shaynakapadia shaynakapadia marked this pull request as draft February 4, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant