Skip to content

Instantly share code, notes, and snippets.

View alanssitis's full-sized avatar

Alan Chung Ma alanssitis

View GitHub Profile
@alanssitis
alanssitis / cobra_command_tree.py
Last active October 16, 2025 11:39
Python script to print command tree of cobra CLIs in the format of the command `tree`.
#!/bin/python3
from functools import reduce
import subprocess
import operator
def getFromDict(dataDict, mapList):
return reduce(operator.getitem, mapList, dataDict)
def setInDict(dataDict, mapList, value):