Skip to content

zhzLuke96/pbsb-cli

Repository files navigation

pbsb-cli

command-line interface for pbsb

how to use

pbsb-cli -h
  • windows: pbsb-cli.exe -h
  • linux: pbsb-cli.linux -h
  • macos: pbsb-cli.macos -h

help

help output
command-line interface for pbsb

Options: -V, --version output the version number -h, --help display help for command

Commands: call [options] simple call server pub [options] publish message sub [options] subcribe message req [options] request message consume [options] consume message from message queue produce [options] produce message to message queue share [options] share file sget [options] download files by subscribing channel (like wget) chat [options] simple chat via channels host [options] host http server based on script feeder [options] Feed tg bot-updates to MQ

feeder

help output
Feed tg bot-updates to MQ

Options: -T, --token bot token -s, --server [address] server address (default: "localhost:9292") -c, --channel mq namespace -a, --ack auto ack when message fetched -x, --proxy [address] http proxy for request -t, --ttl [second] message default ttl (s) (default: "900")

share

help output
share file

Arguments: filepath filepath of file to be share

Options: -w, --watch watch file changes and send a new file for each change -c, --channel channel name -s, --server [address] server address (default: "localhost:9292") -m, --multicast message multicast (default: true) -c, --cache message cache (default: false)

sget

help output
download files by subscribing channel (like wget)

Options: -c, --channel channel name -s, --server [address] server address (default: "localhost:9292") -o, --output [filename] write to file instead of stdout -w, --watch watch channel and downloading the latest file -i, --interval [ms] interval of each request (default: "1000") -r, --retry [number] maximum number of retries in case of request errors (default: "10") -S, --shell [string] a shell script will be executed after the file is changed

host

help output
host http server based on script

Arguments: filename server script filename

Options: -s, --server [address] server address (default: "localhost:9292") -r, --router host router -i, --instance [number] instance number (default: "1")

chat

help output
simple chat via channels

Arguments: channel channel path

Options: -u, --username [string] chat username -s, --server [address] server address (default: "localhost:9292") -c, --codecs [string] chat message codecs

call

help output
simple call server

Arguments: pathname pathname

Options: --json format response body to json (default: true) -s, --server [address] server address (default: "localhost:9292") -p, --payload [string] payload data -q, --query [string] query data

pub

help output
publish message

Arguments: string message body

Options: --json auto try format response body to json (default: true) -c, --channel channel name -s, --server [address] server address (default: "localhost:9292") -m, --multicast message multicast (default: true) -c, --cache message cache (default: false)

sub

help output
subcribe message

Options: --json auto try format response body to json (default: true) -c, --channel channel name -s, --server [address] server address (default: "localhost:9292") -m, --mime [string] custom mime type -p, --persist persist connect (default: false)

consume

help output
consume message from message queue

Arguments: filename consumer javascript filename

Options: -s, --server [address] server address (default: "localhost:9292") -c, --channel message queue namespace -a, --ack auto ack when message fetched -p, --priority [weight] The weight of the current consumer in the priority (default: "0") -d, --dead fetch messages from the dead letter queue

produce

help output
produce message to message queue

Arguments: filename producer javascript filename

Options: -s, --server [address] server address (default: "localhost:9292") -c, --channel message queue namespace

todo

  • Signature auth
  • Support typescript for worker
  • More features for a stable production environment

BTW

why vscode exclude /dist ?

issue

How to get permission to call service ?

contact me

Maintainers

@zhzluke96

Contributing

Feel free to dive in! Open an issue or submit PRs.

LICENSE

Code is licensed under the MIT License.