{"id":22351906,"url":"https://github.com/screwdriver-cd/meta-cli","last_synced_at":"2025-07-30T07:31:56.830Z","repository":{"id":16858682,"uuid":"80772002","full_name":"screwdriver-cd/meta-cli","owner":"screwdriver-cd","description":"CLI for reading/writing information from the metadata","archived":false,"fork":false,"pushed_at":"2024-04-20T07:10:14.000Z","size":218,"stargazers_count":8,"open_issues_count":0,"forks_count":9,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-06-19T02:05:58.590Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":"https://cd.screwdriver.cd/pipelines/67","language":"Go","has_issues":false,"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/screwdriver-cd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2017-02-02T21:49:08.000Z","updated_at":"2024-06-04T05:15:58.000Z","dependencies_parsed_at":"2024-03-14T07:43:48.578Z","dependency_job_id":"23b6a1a9-1ce9-44ab-84fc-f6f1c5905418","html_url":"https://github.com/screwdriver-cd/meta-cli","commit_stats":null,"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fmeta-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fmeta-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fmeta-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Fmeta-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/screwdriver-cd","download_url":"https://codeload.github.com/screwdriver-cd/meta-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228106386,"owners_count":17870438,"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":["golang"],"created_at":"2024-12-04T12:16:28.396Z","updated_at":"2024-12-04T12:16:29.140Z","avatar_url":"https://github.com/screwdriver-cd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metadata CLI\n[![Build Status][build-image]][build-url]\n[![Latest Release][version-image]][version-url]\n[![Go Report Card][goreport-image]][goreport-url]\n\n\u003e CLI for reading/writing project metadata\n\n## Usage\n\n```bash\n$ go get github.com/screwdriver-cd/meta-cli\n$ cd $GOPATH/src/github.com/screwdriver-cd/meta-cli\n$ go build -a -o meta\n$ ./meta --help\nNAME:\n   meta-cli - get or set metadata for Screwdriver build\n\nUSAGE:\n   meta command arguments [options]\n\nVERSION:\n   0.0.0\n\nCOMMANDS:\n     get      Get a metadata with key\n     set      Set a metadata with key and value\n     help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --meta-space value          Location of meta temporarily (default: \"/sd/meta\")\n   --loglevel value, -l value  Set the loglevel (default: \"info\")\n   --help, -h                  show help\n   --version, -v               print the version\n\nCOPYRIGHT:\n   (c) 2017 Yahoo Inc.\n\n---\nNAME:\n   meta get - Get a metadata with key\n\nUSAGE:\n   meta get [command options] [arguments...]\n\nOPTIONS:\n   --external value, -e value        MetaFile pipeline meta (default: \"meta\")\n   --skip-fetch, -F                  Used with --external to skip fetching from lastSuccessfulMeta when not triggered by external job\n   --json-value, -j                  Treat value as json. When false, set values are treated as string; get is value-dependent and strings are not json-escaped\n   --sd-token value, -t value        Set the SD_TOKEN to use in SD API calls [$SD_TOKEN]\n   --sd-api-url value, -u value      Set the SD_API_URL to use in SD API calls (default: \"https://api.screwdriver.cd/v4/\") [$SD_API_URL]\n   --sd-pipeline-id value, -p value  Set the SD_PIPELINE_ID of the job for fetching last successful meta (default: 0) [$SD_PIPELINE_ID]\n   --skip-store                      Used with --external to skip storing external metadata in the local meta\n   --cache-local                     Used with external, this flag saves a copy of the key/value pair in the local meta\n\n---\nNAME:\n   meta set - Set a metadata with key and value\n\nUSAGE:\n   meta set [command options] [arguments...]\n\nOPTIONS:\n   --json-value, -j  Treat value as json. When false, set values are treated as string; get is value-dependent and strings are not json-escaped\n\n$ ./meta set aaa bbb\n$ ./meta get aaa\nbbb\n$ ./meta set foo[2].bar[1] baz\n[null,null,{\"bar\":[null,\"baz\"]}]\n$ ./meta set foo '{\"bar\": \"baz\", \"buz\": 123}' --json-value\n$ ./meta get foo --json-value\n{\"bar\":\"baz\",\"buz\":123}\n$ ./meta get foo.bar\nbaz\n$ ./meta get foo.bar --json-value\n\"baz\"\n$ ./meta get meta --external sd@123:other-job\n$ # For scheduled jobs, e.g. that trigger things normally triggered by component:\n  if [[ \"$(./meta get -j meta)\" == null ]]; then\n      ./meta set -j meta \"$(meta get meta -j --external component)\"\n  fi\n---\nNAME:\n   meta lua - Run a lua script\n\nUSAGE:\n   meta lua [command options] [arguments...]\n\nOPTIONS:\n   --evaluate value, -E value        lua text to evaluate; when not set, the first argument is treated as a filename\n   --external value, -e value        MetaFile pipeline meta (default: \"meta\")\n   --skip-fetch, -F                  Used with --external to skip fetching from lastSuccessfulMeta when not triggered by external job\n   --json-value, -j                  Treat value as json. When false, set values are treated as string; get is value-dependent and strings are not json-escaped\n   --sd-token value, -t value        Set the SD_TOKEN to use in SD API calls [$SD_TOKEN]\n   --sd-api-url value, -u value      Set the SD_API_URL to use in SD API calls (default: \"https://api.screwdriver.cd/v4/\") [$SD_API_URL]\n   --sd-pipeline-id value, -p value  Set the SD_PIPELINE_ID of the job for fetching last successful meta (default: 0) [$SD_PIPELINE_ID]\n   --skip-store                      Used with --external to skip storing external metadata in the local meta\n   --cache-local                     Used with external, this flag saves a copy of the key/value pair in the local meta\n\n$ # Atomically increment a key that may or may not exist\n$ meta lua -E 'meta.set(\"num\", (meta.get(\"num\") or 0) + 1)'\n\n$ # Append image metadata and output the index\n$ meta lua -E 'images = meta.get(\"images\") or {}; print(#images); table.insert(images, {org=\"foo\", repo=\"bar\", tag=\"7.8.2-202101041200\"}); meta.set(\"images\", images)'\n0\n$ meta lua -E 'images = meta.get(\"images\") or {}; print(#images); table.insert(images, {org=\"foo\", repo=\"baz\", tag=\"7.8.2-202101041200\"}); meta.set(\"images\", images)'\n1\n```\n\n## Testing\n\n```bash\n$ go get github.com/screwdriver-cd/meta-cli\n$ go test -cover github.com/screwdriver-cd/meta-cli/...\n```\n\n## License\n\nCode licensed under the BSD 3-Clause license. See LICENSE file for terms.\n\n[version-image]: https://img.shields.io/github/tag/screwdriver-cd/meta-cli.svg\n[version-url]: https://github.com/screwdriver-cd/meta-cli/releases\n[build-image]: https://cd.screwdriver.cd/pipelines/67/badge\n[build-url]: https://cd.screwdriver.cd/pipelines/67\n[goreport-image]: https://goreportcard.com/badge/github.com/Screwdriver-cd/meta-cli\n[goreport-url]: https://goreportcard.com/report/github.com/Screwdriver-cd/meta-cli\n\n## Installing locally using homebrew\n\n* prerequisite: install [homebrew](https://homebrew.sh/)\n* Tap meta-cli:\n    ```bash\n    brew tap screwdriver-cd/meta-cli https://github.com/screwdriver-cd/meta-cli.git\n    ```\n* Install meta-cli\n    ```bash\n    brew install meta-cli\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fmeta-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrewdriver-cd%2Fmeta-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Fmeta-cli/lists"}