{"id":38519851,"url":"https://github.com/farzadghanei/mute","last_synced_at":"2026-01-17T06:37:50.086Z","repository":{"id":69339813,"uuid":"220655245","full_name":"farzadghanei/mute","owner":"farzadghanei","description":"run other programs while suppressing the output under configured conditions","archived":false,"fork":false,"pushed_at":"2025-05-31T12:07:33.000Z","size":109,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-31T19:12:45.860Z","etag":null,"topics":["cli","go","utility"],"latest_commit_sha":null,"homepage":"","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/farzadghanei.png","metadata":{"files":{"readme":"README.rst","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":"2019-11-09T14:37:13.000Z","updated_at":"2025-05-31T12:07:17.000Z","dependencies_parsed_at":"2023-03-11T05:41:45.670Z","dependency_job_id":null,"html_url":"https://github.com/farzadghanei/mute","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/farzadghanei/mute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadghanei%2Fmute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadghanei%2Fmute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadghanei%2Fmute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadghanei%2Fmute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farzadghanei","download_url":"https://codeload.github.com/farzadghanei/mute/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farzadghanei%2Fmute/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"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":["cli","go","utility"],"created_at":"2026-01-17T06:37:50.025Z","updated_at":"2026-01-17T06:37:50.074Z","avatar_url":"https://github.com/farzadghanei.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"****\nMute\n****\n\n.. image:: https://github.com/farzadghanei/mute/workflows/tests/badge.svg\n    :target: https://github.com/farzadghanei/mute/actions\n\n\n``mute`` runs other programs and mutes the output under configured\nconditions. A good use case is to keep cron jobs silenced and avoid receiving\nemails for known conditions.\n\nIt's written in Go, has a small resource overhead with no runtime dependencies.\n\n\nUsage\n-----\n\n.. code-block::\n\n    # by default exit code \"0\" is muted\n    mute bash -c \"echo 'this is muted'\"\n    mute bash -c \"echo 'this is printed, exiting with 12'; exit 12\"\n\n    # configure mute with environment variables\n    env MUTE_EXIT_CODES=\"4,5\" mute bash -c \"echo 'muted'; exit 4\"\n    env MUTE_STDOUT_PATTERN=\".*OK.*\" mute bash -c \"echo 'warning but OK so muted'; exit 1\"\n\n``mute`` accepts a command with optional arguments to run. ``mute`` itself\nhas no arguments but can be configured with a file (in `TOML \u003chttps://github.com/toml-lang/toml\u003e`_),\nand environment variables. The configuration is validated before running the command.\n\nThe exit code of ``mute`` is the exit code of the command it runs.\nHowever ``mute`` exits with 127 (``mute.ExitErrExec``) when failed to execute the commnad,\nand with 126 (``mute.ExitErrConf``) when configuration is invalid.\n\n\nConfiguration\n-------------\n\n``mute`` can be configured with environment variables, or with a configuration file.\nIf the environment variables are set, they define the behavior and\nthe config file is not even checked. If no variables are defined or they are all empty,\nthen the configuration file is used.\n\nIf the configuration file does not exist, or is not accessible (permissions, etc.)\n``mute`` continues with the default configuration.\n\nAny accessible configuration should be valid, otherwise ``mute`` exits with ``mute.ExitErrConf``\n(also applies to environment variables).\n\n\nDefault Config\n==============\nWhen there is no config specified, ``mute`` suppresses output from successful runs, matching\nexit code 0 and any output pattern.\n\n\nEnvironment Variables\n=====================\n\n\n* ``MUTE_EXIT_CODES``: comma separated list of exit codes to mute (same as ``exit_codes`` in ``mute.default`` config)\n* ``MUTE_STDOUT_PATTERN``: regex pattern to suppress the output when stdout matches\n* ``MUTE_CONFIG``: absolute/relative path to the config file. default is ``/etc/mute.toml``, no file no issue. an empty value means no config file lookup.\n\n\nConfiguration File\n===================\n\nThe accessible configuration file should contain valid criteria defenitions in TOML format.\n\n\n.. code-block::\n\n    # When a command matched this criteria, the output will be muted.\n    # Exit codes and stdout patterns are grouped by \"AND\", requiring both to match.\n    # Multiple sections will be grouped by \"OR\", so matching any section will suppress the output.\n    # stdout is checked by matching with regular expression patterns.\n\n    [[ default ]]\n    exit_codes = [0]  # any of exit codes could match\n\n    # OR\n    [[ default ]]\n    stdout_patterns = [\".+ OK .+\"]  # stdout matches any listed regex patterns\n\n    # OR\n    [[ default ]]\n    exit_codes = [1, 2]  # any program that exits with either 1,2 AND prints OK\n    stdout_patterns = [\"OK\"]\n\n    [ commands ]\n    # Command specific settings, overriding default settings, not stacking with default.\n    # This applies to any command starting with 'user': 'user' and 'useradd' and 'userdel'\n\n      [[ commands.user ]]\n      exit_codes = [0]  # any command starting with \"user\" will match ONLY when exit code is 0\n\n      # Command specific settings can also be grouped with OR by repeating the settings\n      [[ commands.user ]]\n      stdout_patterns = [\"^$\"]  # now any command starting with \"user\" will match when output is empty regardless of exit code\n\n\n\nLicense\n-------\n\n``mute`` is an open source project released under the terms of the `MIT license \u003chttps://opensource.org/licenses/MIT\u003e`_.\nSee LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarzadghanei%2Fmute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarzadghanei%2Fmute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarzadghanei%2Fmute/lists"}