{"id":15694255,"url":"https://github.com/pawamoy/failprint","last_synced_at":"2026-02-07T19:08:36.420Z","repository":{"id":48339489,"uuid":"255636006","full_name":"pawamoy/failprint","owner":"pawamoy","description":"Run a command, print its output only if it fails.","archived":false,"fork":false,"pushed_at":"2025-08-15T13:49:03.000Z","size":2599,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T05:57:58.266Z","etag":null,"topics":["failure","make","output","stderr","stdout","success"],"latest_commit_sha":null,"homepage":"https://pawamoy.github.io/failprint","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pawamoy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"pawamoy","polar":"pawamoy"}},"created_at":"2020-04-14T14:42:04.000Z","updated_at":"2025-08-15T13:48:49.000Z","dependencies_parsed_at":"2024-01-18T21:36:22.383Z","dependency_job_id":"2b8f41c7-3f5b-4f7d-af23-01f372840b87","html_url":"https://github.com/pawamoy/failprint","commit_stats":{"total_commits":98,"total_committers":1,"mean_commits":98.0,"dds":0.0,"last_synced_commit":"f052240898e83a153731494e4a0a8238ff183359"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/pawamoy/failprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Ffailprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Ffailprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Ffailprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Ffailprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawamoy","download_url":"https://codeload.github.com/pawamoy/failprint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Ffailprint/sbom","scorecard":{"id":112999,"data":{"date":"2025-08-04","repo":{"name":"github.com/pawamoy/failprint","commit":"3904d53f42818c86e45a084e68f2f9a82e55ce09"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":3.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/release.yml:5","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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:118: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/pawamoy/failprint/release.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction 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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T15:42:33.471Z","repository_id":48339489,"created_at":"2025-08-15T15:42:33.472Z","updated_at":"2025-08-15T15:42:33.472Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29205178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"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":["failure","make","output","stderr","stdout","success"],"created_at":"2024-10-03T18:55:17.273Z","updated_at":"2026-02-07T19:08:36.415Z","avatar_url":"https://github.com/pawamoy.png","language":"Python","readme":"# failprint\n\n[![ci](https://github.com/pawamoy/failprint/workflows/ci/badge.svg)](https://github.com/pawamoy/failprint/actions?query=workflow%3Aci)\n[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://pawamoy.github.io/failprint/)\n[![pypi version](https://img.shields.io/pypi/v/failprint.svg)](https://pypi.org/project/failprint/)\n[![gitter](https://img.shields.io/badge/matrix-chat-4DB798.svg?style=flat)](https://app.gitter.im/#/room/#failprint:gitter.im)\n\nRun a command, print its output only if it fails.\n\nTired of searching the `quiet` options of your programs\nto lighten up the output of your `make check` or `make lint` commands?\n\nTired of finding out that standard output and error are mixed up in some of them?\n\nSimply run your command through `failprint`.\nIf it succeeds, nothing is printed.\nIf it fails, standard error is printed.\nPlus other configuration goodies :wink:\n\n## Example\n\nYou don't want to see output when the command succeeds.\n\n![demo](demo.svg)\n\nThe task runner [`duty`](https://github.com/pawamoy/duty) uses `failprint`,\nallowing you to define tasks in Python and run them with minimalist and beautiful output:\n\n![demo_duty](demo_duty.svg)\n\n## Requirements\n\nfailprint requires Python 3.8 or above.\n\n\u003cdetails\u003e\n\u003csummary\u003eTo install Python 3.8, I recommend using \u003ca href=\"https://github.com/pyenv/pyenv\"\u003e\u003ccode\u003epyenv\u003c/code\u003e\u003c/a\u003e.\u003c/summary\u003e\n\n```bash\n# install pyenv\ngit clone https://github.com/pyenv/pyenv ~/.pyenv\n\n# setup pyenv (you should also put these three lines in .bashrc or similar)\nexport PATH=\"${HOME}/.pyenv/bin:${PATH}\"\nexport PYENV_ROOT=\"${HOME}/.pyenv\"\neval \"$(pyenv init -)\"\n\n# install Python 3.8.17\npyenv install 3.8.17\n\n# make it available globally\npyenv global system 3.8.17\n```\n\u003c/details\u003e\n\n## Installation\n\n```bash\npip install failprint\n```\n\nWith [`uv`](https://docs.astral.sh/uv/):\n\n```bash\nuv tool install failprint\n```\n\n## Usage\n\n```console\n% poetry run failprint -h\nusage: failprint [-h] [-c {stdout,stderr,both,none}] [-f {pretty,tap}] [-y | -Y] [-p | -P] [-q | -Q] [-s | -S] [-z | -Z] [-n NUMBER]\n                 [-t TITLE]\n                 COMMAND [COMMAND ...]\n\npositional arguments:\n  COMMAND\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c {stdout,stderr,both,none}, --capture {stdout,stderr,both,none}\n                        Which output to capture. Colors are supported with 'both' only, unless the command has a 'force color'\n                        option.\n  -f {pretty,tap}, --format {pretty,tap}\n                        Output format. Pass your own Jinja2 template as a string with '-f custom=TEMPLATE'. Available variables:\n                        command, title (command or title passed with -t), code (exit status), success (boolean), failure (boolean),\n                        number (command number passed with -n), output (command output), nofail (boolean), quiet (boolean), silent\n                        (boolean). Available filters: indent (textwrap.indent).\n  -y, --pty             Enable the use of a pseudo-terminal. PTY doesn't allow programs to use standard input.\n  -Y, --no-pty          Disable the use of a pseudo-terminal. PTY doesn't allow programs to use standard input.\n  -p, --progress        Print progress while running a command.\n  -P, --no-progress     Don't print progress while running a command.\n  -q, --quiet           Don't print the command output, even if it failed.\n  -Q, --no-quiet        Print the command output when it fails.\n  -s, --silent          Don't print anything.\n  -S, --no-silent       Print output as usual.\n  -z, --zero, --nofail  Don't fail. Always return a success (0) exit code.\n  -Z, --no-zero, --strict\n                        Return the original exit code.\n  -n NUMBER, --number NUMBER\n                        Command number. Useful for the 'tap' format.\n  -t TITLE, --title TITLE\n                        Command title. Default is the command itself.\n```\n\n```python\nfrom failprint import run\n\ncmd = \"echo hello\"\n\nexit_code = run(\n    cmd,            # str, list of str, or Python callable\n    args=None,      # args for callable\n    kwargs=None,    # kwargs for callable\n    number=1,       # command number, useful for tap format\n    capture=None,   # stdout, stderr, both, none, True or False\n    title=None,     # command title\n    fmt=None,       # pretty, tap, or custom=\"MY_CUSTOM_FORMAT\"\n    pty=False,      # use a PTY\n    progress=True,  # print the \"progress\" template before running the command\n    nofail=False,   # always return zero\n    quiet=False,    # don't print output when the command fails\n    silent=False,   # don't print anything\n)\n```\n\n## Sponsors\n\n\u003c!-- sponsors-start --\u003e\n\u003c!-- sponsors-end --\u003e\n","funding_links":["https://github.com/sponsors/pawamoy","https://polar.sh/pawamoy"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawamoy%2Ffailprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawamoy%2Ffailprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawamoy%2Ffailprint/lists"}