{"id":40013748,"url":"https://github.com/mackerelio/mkr","last_synced_at":"2026-05-14T03:06:46.428Z","repository":{"id":22425553,"uuid":"25763415","full_name":"mackerelio/mkr","owner":"mackerelio","description":"Command Line Tool for Mackerel","archived":false,"fork":false,"pushed_at":"2026-02-03T01:51:47.000Z","size":2028,"stargazers_count":114,"open_issues_count":3,"forks_count":32,"subscribers_count":15,"default_branch":"master","last_synced_at":"2026-02-03T15:54:10.084Z","etag":null,"topics":["go","mackerel","mackerel-agent","mkr"],"latest_commit_sha":null,"homepage":"https://github.com/mackerelio/mkr","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mackerelio.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-10-26T08:21:00.000Z","updated_at":"2026-02-03T01:51:50.000Z","dependencies_parsed_at":"2023-12-22T03:13:21.818Z","dependency_job_id":"e30aecab-23f6-441c-94a8-0690d4cc20c8","html_url":"https://github.com/mackerelio/mkr","commit_stats":null,"previous_names":["y-uuki/gomkr"],"tags_count":125,"template":false,"template_full_name":null,"purl":"pkg:github/mackerelio/mkr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackerelio%2Fmkr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackerelio%2Fmkr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackerelio%2Fmkr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackerelio%2Fmkr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mackerelio","download_url":"https://codeload.github.com/mackerelio/mkr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackerelio%2Fmkr/sbom","scorecard":{"id":609677,"data":{"date":"2025-08-11","repo":{"name":"github.com/mackerelio/mkr","commit":"6b5ea7fca61df736ae1035e8f024ab005894d567"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: topLevel 'contents' permission set to 'write': .github/workflows/ci.yml:4","Warn: topLevel 'packages' permission set to 'write': .github/workflows/ci.yml:6","Warn: no topLevel permission defined: .github/workflows/create-release-pr.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:108: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:114: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:120: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:137: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/create-release-pr.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/create-release-pr.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/create-release-pr.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/create-release-pr.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/create-release-pr.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/mackerelio/mkr/create-release-pr.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:7: pin your Docker image by updating alpine:3.20.3 to alpine:3.20.3@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  15 third-party GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.61.0 not signed: https://api.github.com/repos/mackerelio/mkr/releases/218993191","Warn: release artifact v0.60.0 not signed: https://api.github.com/repos/mackerelio/mkr/releases/209265054","Warn: release artifact v0.59.2 not signed: https://api.github.com/repos/mackerelio/mkr/releases/203473759","Warn: release artifact v0.59.1 not signed: https://api.github.com/repos/mackerelio/mkr/releases/197082887","Warn: release artifact v0.59.0 not signed: https://api.github.com/repos/mackerelio/mkr/releases/187461503","Warn: release artifact v0.61.0 does not have provenance: https://api.github.com/repos/mackerelio/mkr/releases/218993191","Warn: release artifact v0.60.0 does not have provenance: https://api.github.com/repos/mackerelio/mkr/releases/209265054","Warn: release artifact v0.59.2 does not have provenance: https://api.github.com/repos/mackerelio/mkr/releases/203473759","Warn: release artifact v0.59.1 does not have provenance: https://api.github.com/repos/mackerelio/mkr/releases/197082887","Warn: release artifact v0.59.0 does not have provenance: https://api.github.com/repos/mackerelio/mkr/releases/187461503"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3605 / GHSA-7vpp-9cxj-q8gv","Warn: Project is vulnerable to: GO-2024-2698 / GHSA-rhh4-rh7c-7r5v","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:93"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}}]},"last_synced_at":"2025-08-21T02:20:20.354Z","repository_id":22425553,"created_at":"2025-08-21T02:20:20.354Z","updated_at":"2025-08-21T02:20:20.354Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","mackerel","mackerel-agent","mkr"],"created_at":"2026-01-19T03:00:41.143Z","updated_at":"2026-02-16T04:05:35.417Z","avatar_url":"https://github.com/mackerelio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"mkr\n===\n[![Latest Version](https://img.shields.io/github/release/mackerelio/mkr.svg?style=flat-square)][release]\n[![Build Status](https://github.com/mackerelio/mkr/workflows/Build/badge.svg)][actions]\n[![Go Documentation](https://pkg.go.dev/badge/github.com/mackerelio/mkr)][godocs]\n\n[release]: https://github.com/mackerelio/mkr/releases\n[actions]: https://github.com/mackerelio/mkr/actions?workflow=Build\n[godocs]: https://pkg.go.dev/github.com/mackerelio/mkr\n\nmkr - Command Line Tool For Mackerel written in Go.\n\n# DESCRIPTION\n\nmkr is a command-line interface tool for the [Mackerel API](https://mackerel.io/api-docs/) written in Go.\nmkr helps to automate tedious daily server operations to best leverage Mackerel's and Unix's tools.\nmkr output format is JSON, so it can be filtered with a JSON processor such as [jq](http://stedolan.github.io/jq/).\n\n# INSTALLATION\n\n## apt / yum (for Linux)\n\n### CentOS 7 (or later)\n\n```bash\ncurl -fsSL https://mackerel.io/file/script/setup-yum-v2.sh | sh\nyum install mkr\n```\n\n### Debian / Ubuntu\n\n```bash\ncurl -fsSL https://mackerel.io/file/script/setup-apt-v2.sh | sh\napt-get install mkr\n```\n\n### Amazon Linux 2 LTS\n\n```bash\ncurl -fsSL https://mackerel.io/file/script/amznlinux/setup-yum-v2.sh | sh\nyum install mkr\n```\n\n### Amazon Linux\n\n```bash\ncurl -fsSL https://mackerel.io/file/script/amznlinux/setup-yum.sh | sh\nyum install mkr\n```\n\n## Homebrew (for macOS)\n\nYou can also install from the brew rule we maintain, but we don't officially support the environment.\n\n```bash\nbrew tap mackerelio/mackerel-agent\nbrew install mkr\n```\n\n## Build from source\n\n```bash\n$ go install github.com/mackerelio/mkr@latest\n```\n\n# USAGE\n\nFirst the MACKEREL_APIKEY environment variable must be set. It is not necessary to set the MACKEREL_APIKEY on hosts running [mackerel-agent](https://github.com/mackerelio/mackerel-agent). For more details, see below.\n\n```bash\nexport MACKEREL_APIKEY=\u003cPut your API key\u003e\n```\n\n## EXAMPLES\n\n```\nmkr status \u003chostId\u003e\n{\n    \"id\": \"2eQGEaLxiYU\",\n    \"name\": \"myproxy001\",\n    \"status\": \"standby\",\n    \"roleFullnames\": [\n        \"My-Service:proxy\"\n    ],\n    \"isRetired\": false,\n    \"createdAt\": \"2014-11-15T21:41:00+09:00\"\n}\n```\n\n```\nmkr hosts --service My-Service --role proxy\n[\n    {\n        \"id\": \"2eQGEaLxiYU\",\n        \"name\": \"myproxy001\",\n        \"status\": \"standby\",\n        \"roleFullnames\": [\n            \"My-Service:proxy\"\n        ],\n        \"isRetired\": false,\n        \"createdAt\": \"2014-11-15T21:41:00+09:00\"\n    },\n    {\n        \"id\": \"2eQGDXqtoXs\",\n        \"name\": \"myproxy002\",\n        \"status\": \"standby\",\n        \"roleFullnames\": [\n            \"My-Service:proxy\"\n        ],\n        \"isRetired\": false,\n        \"createdAt\": \"2014-11-15T21:41:00+09:00\"\n    },\n]\n```\n\nThe format of `createdAt` uses ISO-8601 in the current time zone.\n\nThe `mkr hosts` command has an '-f' option to format the output.\n\n```\nmkr hosts -f '{{range .}}{{if (len .Interfaces)}}{{(index .Interfaces 0).IPAddress}}{{end}}{{\"\\t\"}}{{.Name}}{{\"\\n\"}}{{end}}'\n10.0.1.1  myproxy001\n10.0.1.2  myproxy002\n...\n```\n\n```\nmkr create --status working -R My-Service:db-master mydb001\nmkr update --status maintenance --roleFullname My-Service:db-master \u003chostId\u003e\n```\n\n```\ncat \u003c\u003cEOF | mkr throw --host \u003chostId\u003e\n\u003cname\u003e  \u003cvalue\u003e \u003ctime\u003e\n\u003cname\u003e  \u003cvalue\u003e \u003ctime\u003e\nEOF\n...\n\ncat \u003c\u003cEOF | mkr throw --service My-Service\n\u003cname\u003e  \u003cvalue\u003e \u003ctime\u003e\n\u003cname\u003e  \u003cvalue\u003e \u003ctime\u003e\nEOF\n...\n```\n\n```\nmkr fetch --name loadavg5 2eQGDXqtoXs\n{\n    \"2eQGDXqtoXs\": {\n        \"loadavg5\": {\n            \"time\": 1416061500,\n            \"value\": 0.025\n        }\n    }\n}\n```\n\n```\nmkr retire \u003chostId\u003e ...\n```\n\n### Examples (on hosts running mackerel-agent)\n\nSpecifying the \u003chostId\u003e and MACKEREL_APIKEY is not necessary because mkr refers to /var/lib/mackerel-agent/id and /etc/mackerel-agent/mackerel-agent.conf instead of specifying manually.\n\n```\nmkr status\n```\n\n```\nmkr update --status maintenance \u003chostIds\u003e...\n```\n\n```\nmkr fetch --name loadavg5 \u003chostId\u003e\n```\n\n```bash\ncat \u003c\u003cEOF | mkr throw --host \u003chostId\u003e\n\u003cname\u003e  \u003cvalue\u003e \u003ctime\u003e\nEOF\n```\n\n```\nmkr retire\n```\n\n## ADVANCED USAGE\n\n```bash\n$ mkr update --st working $(mkr hosts -s My-Service -r proxy | jq -r '.[].id')\n```\n\n## Using Docker Image\n\nhttps://hub.docker.com/r/mackerel/mkr/\n\n```bash\n$ docker run --rm --env MACKEREL_APIKEY=\u003cAPI key\u003e mackerel/mkr help\n```\n\n# CONTRIBUTION\n\n1. Fork ([https://github.com/mackerelio/mkr/fork](https://github.com/mackerelio/mkr/fork))\n2. Create a feature branch\n3. Commit your changes\n4. Rebase your local changes against the master branch\n5. Run test suite with the `go test ./...` command and confirm that it passes\n6. Run `gofmt -s`\n7. Create new Pull Request\n\n\nLicense\n----------\n\nCopyright 2014 Hatena Co., Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackerelio%2Fmkr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmackerelio%2Fmkr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackerelio%2Fmkr/lists"}