{"id":25649783,"url":"https://github.com/openchami/ochami-cmdline","last_synced_at":"2026-06-28T06:30:18.099Z","repository":{"id":221562896,"uuid":"754740315","full_name":"OpenCHAMI/ochami-cmdline","owner":"OpenCHAMI","description":"A temporary command line utility for interacting with SMD and BSS","archived":false,"fork":false,"pushed_at":"2025-02-04T14:55:45.000Z","size":102,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-04T15:44:18.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenCHAMI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-08T17:17:05.000Z","updated_at":"2024-10-09T15:51:18.000Z","dependencies_parsed_at":"2024-02-08T18:41:30.780Z","dependency_job_id":"a6c0ae73-b3bd-4134-8255-d420d26a5d26","html_url":"https://github.com/OpenCHAMI/ochami-cmdline","commit_stats":null,"previous_names":["openchami/ochami-cmdline"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami-cmdline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami-cmdline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami-cmdline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami-cmdline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenCHAMI","download_url":"https://codeload.github.com/OpenCHAMI/ochami-cmdline/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240329459,"owners_count":19784452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-23T14:33:49.617Z","updated_at":"2026-06-28T06:30:18.065Z","avatar_url":"https://github.com/OpenCHAMI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCHAMI Command-Line Utility\n\n## Archived\nThis tool is no longer updated or maintained. This tool is no longer guaranteed to work with OpenCHAMI resources. \nThe official OpenCHAMI command-line tool is [here](https://github.com/OpenCHAMI/ochami)\n\n\n## Description\nThe `ochami-cli` tool provides a simple, and direct way to interact with OpenCHAMI services. It is capable of initiating logins for access tokens, managing nodes with SMD, and managing boot scripts/parameters with BSS. The tool is written and Python 3 and requires an interpreter to run.\n\nThe tool comes with two other sub-commands `smd` and `bss` to interact with SMD and BSS respectively. \n\n## Installing Dependencies\n\n```\npip install -r requirements.txt\n```\n\n## Managing Nodes\n\n### SMD\nYou can skip specifying the `--smd-url` for each command by setting\n```bash\nexport SMD_URL=http://smd:27779/hsm/v2\n```\n\nNodes can be added to SMD with a config file using the following command pointing to an instance of SMD:\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --config config.yml\n```\nThis will create the Node Components and Ethernet Interfaces. If `--fake-discovery` is added to the above and a `bmc_ipaddr` is defined for each node in the config, Redfish Endpoints and ComponentEndpoints will also be created. This will \"simulate\" hardware discovery. \n\nNodes can be added manually with\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --add-node --xname \u003cxname\u003e --nid \u003cnid\u003e\n```\nand deleted with\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --delete-node --xname \u003cxname\u003e\n```\nYou can also get the components in SMD with. You can specify the format with `--format`. The options are `json` and `yaml`. If not specified the output will be condensed. \n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --get-components --format {json|yaml}\n```\nor specify an `xname` or `nid`\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --get-components --xname \u003cxname\u003e\n```\n\nEthernet Interfaces can also be added manually with:\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --add-interface --name \u003cname\u003e --xname \u003cxname\u003e --mac \u003cmac\u003e --ipaddr \u003cipaddr\u003e\n```\nand deleted with\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --delete-interface --xname \u003cxname\u003e\n```\nGet all the EthernetInterfaces:\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --get-interfaces --format {json|yaml}\n```\nor specify an xname\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --get-interfaces --xname \u003cxname\u003e\n```\n\nYou can dump SMD into yaml format that can then be read back into SMD. Useful for saving as a backup or saving updates done with the cmdline.\n```bash\n./ochami-cli --smd-url http://smd:27779/hsm/v2 smd --dump \u003e nodes.yaml\n```\n\nHere is an example nodes.yaml file:\n```yaml\nnodes:\n  - name: cg01\n    xname: x1000c1s7b0n0\n    mac: b4:...\n    ipaddr: 172.16.0.1\n    bmc_ipaddr: 172.16.100.1\n  - name: cg02\n    xname: x1000c1s7b1n0\n    mac: b4:...\n    ipaddr: 172.16.0.2\n    bmc_ipaddr: 172.16.100.1\n```\n### BSS\nYou can skip specifying `--bss-url` by setting\n```bash\nexport BSS_URL=http://bss:27778/boot/v1\n```\n\nBSS can be populated with a config file:\n```bash\n./ochami-cli --bss-url http://bss:27778/boot/v1 bss --config bss.yml --add-bootparams\n```\nor updated\n```bash\n./ochami-cli --bss-url http://bss:27778/boot/v1 bss --config bss.yml --update-bootparams\n```\n\nIndividual components can be updates as well, you can choose one or more of the following after specifying `--update-bootparams`; `--kernel`, `--initrd`, `--image`, `--params`.\nUpdating the `--image` and `--params` at the same time will result in the `--params` overwriting what is specified in `--image`\n```bash\n./ochami-cli --bss-url http://bss:27778/boot/v1 bss --update-bootparams --image \u003cimage\u003e\n./ochami-cli --bss-url http://bss:27778/boot/v1 bss --update-bootparams --kernel \u003ckernel\u003e --initrd \u003cinitrd\u003e\n```\nIf no `--xname` or `--nid` is specified this will update all the nodes.\n\nYou can get the state of BSS with\n```bash\n./ochami-cli --bss-url http://bss:27778/boot/v1 bss --get-bootparams --format {json|yaml}\n```\nYou can specify the format with `--format`. The options are `json` and `yaml`. If not specified the output will be condensed.\n\nHere is an example BSS config file:\n```yaml\nmacs:\n  - a4:bf:01:11:da:b9\n  - a4:bf:01:4c:16:4a\ninitrd: 'http://10.100.0.1/boot-images/initramfs.img'\nkernel: 'http://10.100.0.1/boot-images/compute/vmlinuz'\nparams: 'nomodeset ro root=nfs:10.100.0.1:/exports/netroot/almalinux8.9:ro,vers=4.2,sec=sys,nolock ip=dhcp console=ttyS0,115200'\n```\n\n## Get an Access Token\n\nThe `ochami-cli` is able to initiate the login process with the following command:\n\n```\n./ochami-cli login\n```\n \nAfter this command is ran, the `ochami-cli` will first check if you have a valid token either by supplying it with the `--access-token` or `--access-token-file` flags, setting it in the config file, or by setting the `ACCESS_TOKEN` environment variable. If the token is expired, it will try to fetch a new one by initiating a login flow and open a browser to the login page. You will then be require to sign in with the options available. By default, the tool will save the token to a `.ochami-token` file.\n\nYou can include the token when performing actions that require it:\n\n```bash\n./ochami-cli --access-token eyJhbGciOiJ... smd --config config.yml --url http://smd:27779/hsm/v2\n```\n\n## Configuration\nIf SMD and/or BSS are configured to use cacerts and JWTs you can specify these with\n```bash\n./ochami-cli --ca-cert --access-token ...\n```\nyou can also set environemnt variables for BOTH of these:\n```bash\nexport CACERT=/path/to/cacert\nexport ACCESS_TOKEN=eyJhbGciOiJ\n```\n\nHelpful environment variables:\nSkip having to specify `--smd-url`\n```bash\nexport SMD_URL=http://smd:27779/hsm/v2\n```\nSkip having to specify `--bss-url`\n```bash\nexport BSS_URL=http://bss:27778/boot/v1\n```\nSet NID name prefix (i.e. `nid001`). useful is you want to use something specific to your cluster. Only used on outputing SMD and BSS data.\n```bash\nexport CLUSTER_PREFIX=\"nid\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenchami%2Fochami-cmdline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenchami%2Fochami-cmdline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenchami%2Fochami-cmdline/lists"}