{"id":15150133,"url":"https://github.com/opentdf/otdfctl","last_synced_at":"2025-07-30T09:45:31.884Z","repository":{"id":232216491,"uuid":"742186864","full_name":"opentdf/otdfctl","owner":"opentdf","description":"OpenTDF command line interface","archived":false,"fork":false,"pushed_at":"2024-10-29T10:21:34.000Z","size":16224,"stargazers_count":7,"open_issues_count":57,"forks_count":1,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-10-29T22:47:43.358Z","etag":null,"topics":["data-encryption","data-tagging","drm","end-to-end-encryption","file-encryption","go","golang","open-source","opensource","opentdf","tdf","zero-trust","zero-trust-security"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opentdf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-11T23:41:59.000Z","updated_at":"2024-10-29T10:20:05.000Z","dependencies_parsed_at":"2024-04-19T16:34:49.637Z","dependency_job_id":"33a19510-bcda-444d-b673-ae08e33aab3d","html_url":"https://github.com/opentdf/otdfctl","commit_stats":{"total_commits":195,"total_committers":14,"mean_commits":"13.928571428571429","dds":0.6358974358974359,"last_synced_commit":"cdaae409c98fe54b58d6d35dba9c990929d8145a"},"previous_names":["opentdf/otdfctl"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentdf%2Fotdfctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentdf%2Fotdfctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentdf%2Fotdfctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentdf%2Fotdfctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentdf","download_url":"https://codeload.github.com/opentdf/otdfctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230098769,"owners_count":18172740,"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":["data-encryption","data-tagging","drm","end-to-end-encryption","file-encryption","go","golang","open-source","opensource","opentdf","tdf","zero-trust","zero-trust-security"],"created_at":"2024-09-26T14:02:02.181Z","updated_at":"2025-07-30T09:45:31.843Z","avatar_url":"https://github.com/opentdf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# otdfctl: cli to manage OpenTDF Platform\n\nThis command line interface is used to manage OpenTDF Platform.\n\nThe main goals are to:\n\n- simplify setup\n- facilitate migration\n- aid in configuration management\n\n## TODO list\n\n- [ ] Add support for json input as piped input\n- [ ] Add help level handler for each command\n- [ ] Add support for `--verbose` persistent flag\n- [ ] Helper functions to support common tasks like pretty printing and json output\n\n## Usage\n\nThe CLI is configured via the `otdfctl.yaml`. There is an example provided in `otdfctl-example.yaml`.\n\nRun `cp otdfctl-example.yaml otdfctl.yaml` to copy the example config when running the CLI.\n\nLoad up the platform (see its [README](https://github.com/opentdf/platform?tab=readme-ov-file#run) for instructions).\n\n## Development\n\n### CLI\n\nThe CLI is built using [cobra](https://cobra.dev/).\n\nThe primary function is to support CRUD operations using commands as arguments and flags as the values.\n\nThe output format (currently `styled` or `json`) is configurable in the `otdfctl.yaml` or via CLI flag.\n\n#### To add a command\n\n1. Capture the flag value and validate the values\n   1. Alt support JSON input as piped input\n2. Run the handler which is located in `pkg/handlers` and pass the values as arguments\n3. Handle any errors and return the result in a lite TUI format\n\n### TUI\n\n\u003e [!CAUTION]\n\u003e This is a work in progress please avoid touching until framework is defined\n\nThe TUI will be used to create an interactive experience for the user.\n\n## Documentation\n\nDocumentation drives the CLI in this project. This can be found in `/docs/man` and is used in the\nCLI via the `man.Docs.GetDoc()` function.\n\n## Testing\n\nThe CLI is equipped with a test mode that can be enabled by building the CLI with `config.TestMode = true`.\nFor convenience, the CLI can be built with `make build-test`.\n\n**Test Mode features**:\n\n- Use the in-memory keyring provider for user profiles\n- Enable provisioning profiles for testing via `OTDFCTL_TEST_PROFILE` environment variable\n\n### BATS\n\n\u003e [!NOTE]\n\u003e Bat Automated Test System (bats) is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected.\n\nBATS is used to test the CLI from an end-to-end perspective. To run the tests you will need to ensure the following\nprerequisites are met:\n\n- bats is installed on your system\n  - Follow bats-core advice [here](https://github.com/bats-core/homebrew-bats-core?tab=readme-ov-file#homebrew-bats-core)\n- The platform is running and provisioned with basic keycloak clients/users\n  - See the [platform README](https://github.com/opentdf/platform) for instructions\n\nTo run the tests you can either run `make test-bats` or execute specific test suites with `bats e2e/\u003ctest\u003e.bats`.\n\n#### Terminal Size\n\nSome tests for output rendered in the terminal will vary in behavior depending on terminal size.\n\nTerminal size when testing:\n\n1. set to standard defaults if running `make test-bats`\n2. can be set manually by mouse in terminal where tests are triggered\n3. can be set by argument `./e2e/resize_terminal.sh \u003c rows height \u003e \u003c columns width \u003e`\n4. can be set by environment variable, i.e. `export TEST_TERMINAL_WIDTH=\"200\"` (200 is columns width)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentdf%2Fotdfctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentdf%2Fotdfctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentdf%2Fotdfctl/lists"}