Skip to content

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
@nightlark nightlark added the enhancement New feature or request label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants