[GH-ISSUE #46] ntfy CLI #41

Closed
opened 2026-05-07 00:19:04 +02:00 by BreizhHardware · 2 comments

Originally created by @binwiederhier on GitHub (Dec 9, 2021).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/46

The CLI could consist of 3 features:

Server

Just like today, possibly rename command to ntfy serve

Subscribe to topics

Just like curl:

$ ntfy subscribe mytopic1,mytopic2 
{"id":"UiLWPRJAi1","time":1639044609,"event":"message","topic":"mytopic1","message":"It is Thu Dec 09 2021 17:10:09 GMT+0700 (Western Indonesia Time). This is a test."}
{"id":"idFle3ak4S","time":1639074191,"event":"message","topic":"mytopic2","message":"Test"}
...

With a hook:

$ ntfy subscribe mytopic1,mytopic2 --hook 'notify-send "{{.Message}}'

As part of the daemon

$ cat config.yml
subscribe:
   - 
     - topic: ntfy.sh/mytopic
     - hook: 'notify-send "{{.Message}}'

$ ntfy serve # runs daemon

Send messages

ntfy send mytopic "This is a message"
...
Originally created by @binwiederhier on GitHub (Dec 9, 2021). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/46 The CLI could consist of 3 features: ## Server Just like today, possibly rename command to `ntfy serve` ## Subscribe to topics Just like curl: ``` $ ntfy subscribe mytopic1,mytopic2 {"id":"UiLWPRJAi1","time":1639044609,"event":"message","topic":"mytopic1","message":"It is Thu Dec 09 2021 17:10:09 GMT+0700 (Western Indonesia Time). This is a test."} {"id":"idFle3ak4S","time":1639074191,"event":"message","topic":"mytopic2","message":"Test"} ... ``` With a hook: ``` $ ntfy subscribe mytopic1,mytopic2 --hook 'notify-send "{{.Message}}' ``` As part of the daemon ``` $ cat config.yml subscribe: - - topic: ntfy.sh/mytopic - hook: 'notify-send "{{.Message}}' $ ntfy serve # runs daemon ``` Send messages ``` ntfy send mytopic "This is a message" ... ```
Author
Owner

@binwiederhier commented on GitHub (Dec 19, 2021):

I am still working on this with great progress. It's just taking longer than expected.

<!-- gh-comment-id:997444440 --> @binwiederhier commented on GitHub (Dec 19, 2021): I am still working on this with great progress. It's just taking longer than expected.
Author
Owner

@binwiederhier commented on GitHub (Dec 22, 2021):

Done in 1.8.0

<!-- gh-comment-id:999946954 --> @binwiederhier commented on GitHub (Dec 22, 2021): Done in 1.8.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#41
No description provided.