https://github.com/electrofocus/stan
CLI for STAN messaging
https://github.com/electrofocus/stan
Last synced: 5 months ago
JSON representation
CLI for STAN messaging
- Host: GitHub
- URL: https://github.com/electrofocus/stan
- Owner: electrofocus
- License: mit
- Created: 2023-03-11T08:30:22.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-20T07:17:38.000Z (about 3 years ago)
- Last Synced: 2025-01-26T08:18:33.529Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stan
## About
Command line client for [STAN](https://docs.nats.io/legacy/stan/intro) messaging.
## Download
Donwload CLI executable for your OS from [latest release assets](https://github.com/electrofocus/stan/releases).
## Usage
### Publishing message with `--pub`
Flag `--pub` is used to publish message. Run following command in terminal, but with required STAN subject instead of `here.is.some.subject`
```
./stan --pub --subject=here.is.some.subject
```
after that type or paste your message body. Finally, to publish message hit `Enter`/`Return` and then `Ctrl-D` to interrupt typing.
### Subscribing subject with `--sub`
```
./stan --sub --subject=here.is.some.subject
```
## Configuration
To connect to specific Nats MQ, you need to specify configuration.
You can specify connection config using `--url` and `--cluster-id` flags. For expample:
```
./stan
--sub
--subject=here.is.some.subject
--url=nats://our-nats.dev.cloud:1234
--cluster-id=our-cluster
```
If you omit these flags, default values are used. Default values are `nats://0.0.0.0:4222` for `--url` and `test-cluster` for `cluster-id`.