{"id":18747648,"url":"https://github.com/quantum5/ntfy-run","last_synced_at":"2025-08-03T00:38:51.726Z","repository":{"id":257826915,"uuid":"872221324","full_name":"quantum5/ntfy-run","owner":"quantum5","description":"Tool to run a command, capture its output, and send it to ntfy.","archived":false,"fork":false,"pushed_at":"2024-10-15T06:32:23.000Z","size":154,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T11:02:15.213Z","etag":null,"topics":["cron","error-reporting","logging","notifications","ntfy","ntfysh"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quantum5.png","metadata":{"files":{"readme":"README.md","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":"2024-10-14T03:52:51.000Z","updated_at":"2025-07-22T00:58:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"0cc4e6e9-48f7-49af-9d44-ee33f90a40a3","html_url":"https://github.com/quantum5/ntfy-run","commit_stats":null,"previous_names":["quantum5/ntfy-run"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/quantum5/ntfy-run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantum5%2Fntfy-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantum5%2Fntfy-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantum5%2Fntfy-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantum5%2Fntfy-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quantum5","download_url":"https://codeload.github.com/quantum5/ntfy-run/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantum5%2Fntfy-run/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268479862,"owners_count":24256886,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cron","error-reporting","logging","notifications","ntfy","ntfysh"],"created_at":"2024-11-07T16:30:47.973Z","updated_at":"2025-08-03T00:38:51.672Z","avatar_url":"https://github.com/quantum5.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `ntfy-run`\n\n`ntfy-run` is a tool to run a command, capture its output, and send it to a\n`ntfy` server.\n\nIt's designed to be similar to `cron`'s `MAILTO` feature, sending an email if\nthe command running under `ntfy-run` generated any output, but this behaviour\ncan be changed with flags.\n\n## Installation\n\nYou can download a binary from GitHub releases:\n\n```bash\nsudo wget https://github.com/quantum5/ntfy-run/releases/latest/download/ntfy-run-amd64 -O /usr/local/bin/ntfy-run\nsudo chmod a+x /usr/local/bin/ntfy-run\n```\n\nYou can also install the latest release with `cargo`:\n\n```bash\ncargo install ntfy-run\n```\n\nFinally, you can build the latest Git version yourself:\n\n```bash\ngit clone https://github.com/quantum5/ntfy-run.git\ncd ntfy-run\ncargo build --release\nsudo cp target/release/ntfy-run /usr/local/bin\n```\n\n## Usage\n\nAll options can be specified on the command line, as both short and long\noptions, but also as environment variables.\n\n### Basic Example\n\nSimple notification to an `ntfy.sh` URL:\n\n```bash\nNTFY_URL=https://ntfy.sh/hello ntfy-run echo 'Hello, world!'\nntfy-run --ntfy-url https://ntfy.sh/hello echo 'Hello, world!'\nntfy-run -n https://ntfy.sh/hello echo 'Hello, world!'\n```\n\nThis will generate a notification with title `Success: echo 'Hello, world!'`\nand the following body:\n\n```\nexit status: 0\n==================== STDOUT ====================\nHello, world!\n```\n\nFor simplicity's sake, all subsequent commands will assume you have the\nenvironment variable `NTFY_URL=https://ntfy.sh/hello` set.\n\n### Authentication\n\nYou can use the `-t` or `--token` flag (or the `NTFY_TOKEN` environment\nvariable) to pass an access token to `ntfy`:\n\n```bash\nNTFY_TOKEN=tk_example ntfy-run echo 'Hello, world!'\nntfy-run -t tk_example echo 'Hello, world!'\n```\n\nYou can also use the `-u` or `--user` flag in combination with the `-p` or\n`--password` flag (or the `NTFY_USER` and `NTFY_PASSWORD` environment variables)\nto pass a user and password combination:\n\n```bash\nNTFY_USER=example NTFY_PASSWORD=hunter2 ntfy-run echo 'Hello, world!'\nntfy-run -u example -p hunter2 echo 'Hello, world!'\n```\n\n### Filtering notifications\n\nBy default, nothing is generated on successful executions that generate no\noutput. For example, the following command generates no notification:\n\n```bash\nntfy-run true\n```\n\nYou can pass the `-N` or `--always-notify` flags, or `NTFY_ALWAYS_NOTIFY=true`\nenvironment variable to force a notification anyway:\n\n```bash\nntfy-run -N true\n```\n\nYou can also use the `-o` or `--only-failures` flags, or `NTFY_FAILURE_ONLY=true`\nenvironment variable to only notify on successful executions:\n\n```bash\n# No notification:\nntfy-run -o echo 'Hello, world!'\n\n# Will generate a notifications:\nntfy-run -o false\nntfy-run -o sh -c 'echo \"Hello, world!\"; false'\n```\n\n### Message titles\n\nBy default, the message title is `Success:` or `Failure:` followed by the\ncommand line. You can change the command line portion with the `-T` or `--title`\nflag, or the `NTFY_TITLE` environment variable:\n\n```bash\n# Title: Success: echo 'Hello, world!'\nntfy-run echo 'Hello, world!'\n\n# Title: Success: my title\nntfy-run -T 'my title' echo 'Hello, world!'\n```\n\nYou can override the title on success or failure with the following flags:\n\n* `-s`, `--success-title` or `NTFY_SUCCESS_TITLE` environment variable; and\n* `-f`, `--failure-title` or `NTFY_FAILURE_TITLE` environment variable.\n\n```bash\n# Title: My action succeeded\nntfy-run -s 'My action succeeded' echo 'Hello, world!'\n\n# Title: My action failed\nntfy-run -f 'My action failed' false\n```\n\n### Message priorities and tags\n\nYou can override the message priority on success or failure with the following\nflags:\n\n* `-S`, `--success-priority` or `NTFY_SUCCESS_PRIORITY` environment variable;\n  and\n* `-F`, `--failure-priority` or `NTFY_FAILURE_PRIORITY` environment variable.\n\nYou can override the message tags on success or failure with the following\nflags:\n\n* `-a`, `--success-tags` or `NTFY_SUCCESS_TAGS` environment variable; and\n* `-A`, `--failure-tags` or `NTFY_FAILURE_TAGS` environment variable.\n\n```bash\nntfy-run -S min -F max -a tada -A sob echo 'Hello, world!'\nntfy-run -S min -F max -a tada -A sob false\nntfy-run -S min -F max -a tada -A sob does-not-exist\n```\n\nResult:\n![example ntfy output for the above command](demo.png)\n\n### Email\n\nYou can get `ntfy` to send an email alongside the notification by passing the\n`-e` or `--email` flag, or with the `NTFY_EMAIL` environment variable.\n\n### Icon\n\nYou can get `ntfy` to display an icon by passing its URL as the `-i` or `--icon`\nflag, or with the `NTFY_ICON` environment variable.\n\n### `crontab`\n\nIn `vixie-cron` and similar implementations, you can use `ntfy-run` as follows:\n\n```crontab\nNTFY_URL=https://ntfy.sh/hello\nNTFY_TOKEN=tk_example\nNTFY_ALWAYS_NOTIFY=true\n0 0 * * * ntfy-run backup-server\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum5%2Fntfy-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantum5%2Fntfy-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantum5%2Fntfy-run/lists"}