Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] read topic, priority, etc from environment variables or config file #103

Closed
kzshantonu opened this issue Jan 17, 2022 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@kzshantonu
Copy link
Contributor

If a topic, priority, etc is not specified when using ntfy publish, the CLI tool could read value from config file or environment. Could be handy for users who push to one topic most of the time

@binwiederhier binwiederhier added enhancement New feature or request CLI labels Jan 18, 2022
@binwiederhier
Copy link
Owner

The syntax for the publish command is this: ntfy publish TOPIC [MESSAGE...], so you could write:

ntfy pub mytopic "my message"
ntfy pub mytopic my message
ntfy pub mytopic   # sends the message "triggered"

Since topic is the first argument, it's quite impossible to leave it blank, e.g. this:

ntfy pub "my message" 

would not work, because the first argument is the topic, not the message. The best I could do is this:

ntfy pub . "my message"  # where . means "use env"

# or this

ntfy pub -T "my message" # where -T means "use env"

but that's super ugly.

Thoughts?

@kzshantonu
Copy link
Contributor Author

I guess dot is easier to type

@binwiederhier
Copy link
Owner

Implemented in 1552d81 as

NTFY_TOPIC=mytopic ntfy pub -P "my message"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants