{"id":25649795,"url":"https://github.com/openchami/ochami","last_synced_at":"2026-05-14T06:04:36.221Z","repository":{"id":261693595,"uuid":"884998997","full_name":"OpenCHAMI/ochami","owner":"OpenCHAMI","description":"OpenCHAMI command line interface","archived":false,"fork":false,"pushed_at":"2025-02-13T01:13:12.000Z","size":419,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-13T01:26:22.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","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-11-07T19:10:46.000Z","updated_at":"2025-01-31T19:49:20.000Z","dependencies_parsed_at":"2024-11-07T23:25:05.946Z","dependency_job_id":"25dea849-ac50-4fa5-b6d2-6a35f3c9a889","html_url":"https://github.com/OpenCHAMI/ochami","commit_stats":null,"previous_names":["openchami/ochami"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenCHAMI%2Fochami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenCHAMI","download_url":"https://codeload.github.com/OpenCHAMI/ochami/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240329409,"owners_count":19784449,"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:55.057Z","updated_at":"2026-05-14T06:04:36.215Z","avatar_url":"https://github.com/OpenCHAMI.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: © 2024-2025 Triad National Security, LLC. All rights reserved.\nSPDX-FileCopyrightText: © 2025 OpenCHAMI a Series of LF Projects, LLC\n\nSPDX-License-Identifier: MIT\n--\u003e\n\n# ochami: OpenCHAMI Command Line Interface\n\n\u003c!-- Text width is 80, only use spaces and use 4 spaces instead of tabs --\u003e\n\u003c!-- vim: set et sta tw=80 ts=4 sw=4 sts=0: --\u003e\n\n`ochami` is the command line interface to interact with the API of OpenCHAMI\nservices, especially the [State Management Database\n(SMD)](https://github.com/OpenCHAMI/smd) and the [Boot Script Service\n(BSS)](https://github.com/OpenCHAMI/bss). The tool is meant to ease interaction\nwith the API so one need not be proficient in `curl`.\n\n## Documentation\n\nThere are manual pages in the [man directory](/man), which contain the most\ncomplete usage documentation available. While they are quite readable on the\nweb, they are in [scdoc format](https://man.archlinux.org/man/scdoc.5.en) and\nrequire [scdoc](https://git.sr.ht/~sircmpwn/scdoc) to build. There is a `make`\ntarget to do build them:\n\n```\nmake man\nman man/ochami.1\n```\n\n## Getting Started\n\nSee [**Building**](#building) for instructions on how to build `ochami`. Then,\ncontinue here with how to use it.\n\n### 1. Creating a Configuration File\n\nThere are two configuration files in YAML format that `ochami` reads, in order:\n\n1. System-Wide: `/etc/ochami/config.yaml`\n2. User: `${HOME}/.config/ochami/config.yaml`\n\nIf neither exist, it will use compiled defaults. Configuration in the second\nfile override configuration in the first. Alternatively, the `-c`/`--config`\nflag can be used to manually specify a config file path.\n\nLet's generate a user-level configuration:\n\n```bash\nmkdir -p ~/.config/ochami/\nochami config show \u003e ~/.config/ochami/config.yaml\n```\n\nThis will generate a default configuration at `~/.config/ochami/config.yaml`.\n\n\u003e [!NOTE]\n\u003e The `ochami config show` command will read in any existing config files. If it\n\u003e is desired to use only the compiled defaults, use the `--ignore-config` flag.\n\n### 2. Adding a Cluster\n\nNext, `ochami` needs to be told how to contact the Ochami services. The\nconfiguration file could be edited to do this, but `ochami` provides the\n`cluster config` command to edit cluster configuration.\n\n\u003e [!NOTE]\n\u003e `ochami cluster config` is specific to configuring clusters in the config\n\u003e files. If global configuration in these files need to be managed, use `ochami\n\u003e config set/unset`.\n\n\nRun the following command to add a default cluster configuration to the user\nconfiguration file called `foobar` whose base URI is\n`https://foobar.openchami.cluster`:\n\n```bash\nochami config cluster set --user --default foobar cluster.uri https://foobar.openchami.cluster:8443\n```\n\n\u003e [!NOTE]\n\u003e Since `ochami` supports multiple cluster configurations, `--default` makes\n\u003e this cluster the default, meaning if `--cluster` is not specified on the\n\u003e command line, this cluster's configuration will be used.\n\nNow, when the configuration is shown, we should see the new cluster's details:\n\n```bash\n$ ochami config show\nclusters:\n    - cluster:\n        uri: https://foobar.openchami.cluster:8443\n      name: foobar\ndefault-cluster: foobar\nlog:\n    format: rfc3339\n    level: warning\ntimeout: 30s\n\n```\n\n### 3. Testing Unauthenticated Cluster Access\n\nTest access by contacting an API endpoint not requiring an access token:\n\n```bash\n$ ochami bss service status\n{\"bss-status\":\"running\"}\n\n```\n\n### 4. Setting Access Token for Cluster\n\nSince `ochami` supports multiple cluster configurations, it supports reading\nenvironment variables corresponding to the cluster for the access token. This\ncan be overridden by using `--token`. Since our cluster is named \"foobar\", we\nneed to set `FOOBAR_ACCESS_TOKEN` to the value of the token so `ochami` can read\nit when communicating with this cluster.\n\n```bash\nexport FOOBAR_ACCESS_TOKEN=eyJhbGc...\n```\n\nNote that the format of the environment variable that `ochami` reads for the\naccess token is `\u003cCLUSTER_NAME\u003e_ACCESS_TOKEN` where `\u003cCLUSTER_NAME\u003e` is the\nvalue of the cluster name (`name` in the config file specified with `--cluster`,\nor `default-cluster` in the config file, the former taking precedence over the\nlatter) in all capitals and with dashes (-) and spaces substituted with\nunderscores (_).\n\n### 5. Testing Authenticated Cluster Access\n\nNow, we should be able to contact the API on an endpoint that requires\nauthentication:\n\n```bash\n$ ochami bss boot params get\nnull\n\n```\n\n## Building\n\n### Goreleaser\n\nGoreleaser is the way ochami gets built for releases, and is the officially\nsupported build method for troubleshooting.\n\n```bash\nexport GOVERSION=$(go env GOVERSION)\nexport BUILD_HOST=$(hostname)\nexport BUILD_USER=$(whoami)\ngoreleaser build --clean --snapshot --single-target\n```\n\nRemove `--single-target` to build for all targets.\n\nThere is also a `goreleaser-build` make target that sets variables\nautomatically:\n\n```bash\nmake GORELEASER_OPTS='--clean --snapshot --single-target' goreleaser-build\n```\n\n### Make\n\nMake provides convenient and quick building for fast iteration and development.\n\nRun `make help` to see available targets.\n\nLinker flags are used to embed build metadata into the binary. Building can\nsimply be done via:\n\n```bash\nmake\n```\n\nOn Unix-like systems, one can also install the binary, man pages, and\ncompletions:\n\n```bash\nsudo make install\n```\n\n## Container\n\n### Pulling\n\n```bash\ndocker pull ghcr.io/openchami/ochami:latest\n```\n\n### Building\n\nThere are two dockerfiles for two different purposes.\n\n- **Dockerfile** is for manual building and is intended for building locally. It\n  uses a multi-stage build, the first stage building from source and the second\n  stage copying the binary from the first stage.\n- **goreleaser.dockerfile** is used by Goreleaser for CI. It assumes the binary\n  has already been built and copies it into the container.\n\nTo build the ochami container (with `dirty` tag):\n\n```bash\ndocker build . --tag ochami:dirty\n```\n\n### Running\n\n```bash\ndocker run ghcr.io/openchami/ochami:latest ochami --ignore-config help\n```\nThe above incantation will print out the command line's help message.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenchami%2Fochami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenchami%2Fochami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenchami%2Fochami/lists"}