Microservices toolkit
$ npm install -g @oleoneto/microkit
$ microkit COMMAND
running command...
$ microkit (-v|--version|version)
@oleoneto/microkit/0.1.0 darwin-x64 node-v12.18.4
$ microkit --help [COMMAND]
USAGE
$ microkit COMMAND
...
microkit help [COMMAND]
microkit utils
microkit utils:call DIALSTRING
microkit utils:db
microkit utils:db:read
microkit utils:kafka
microkit utils:kafka:listen
microkit utils:kafka:produce
microkit utils:rtp
microkit utils:transcribe
display help for microkit
USAGE
$ microkit help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
extra developer tools
USAGE
$ microkit utils
See code: src/commands/utils/index.ts
place a call using an asterisk server
USAGE
$ microkit utils:call DIALSTRING
OPTIONS
-a, --address=address [default: http://127.0.0.1:8088] asterisk server address
-e, --externalMediaHost=externalMediaHost [default: localhost:5554] RTP listening server address (external host)
-f, --format=format [default: ulaw] audio format
-m, --mode=mode [default: SIP] mode
-p, --password=password [default: asterisk] asterisk password
-t, --transcribe transcribe call in real-time
-u, --username=username [default: asterisk] asterisk user
--docker indicate whether asterisk server is running within a docker container
EXAMPLES
$ call 6001
$ call 6001 --mode SIP
$ call 6001 --transcribe
$ call 6001 --transcribe -e localhost:5554
$ call 6001 --transcribe -a http://127.0.0.1:8088 -u asterisk --docker
See code: src/commands/utils/call/index.ts
interact with SQL databases (only Postgres supported)
USAGE
$ microkit utils:db
See code: src/commands/utils/db/index.ts
read from a database table
USAGE
$ microkit utils:db:read
OPTIONS
-x, --extended show extra columns
--columns=columns only show provided columns (comma-separated)
--csv output is csv format [alias: --output=csv]
--database=database database name
--database-url=database-url database url
--filter=filter filter property by partial string matching, ex: name=foo
--limit=limit [default: 100] sql select limit
--no-header hide table header from output
--no-truncate do not truncate output to fit screen
--offset=offset sql select offset
--output=csv|json|yaml output in a more machine friendly format
--sort=sort property to sort by (prepend '-' for descending)
--table=table (required) database table
EXAMPLES
$ db:read --table friends
$ db:read --table friends --database people
$ db:read --table friends --limit 2
$ db:read --table friends --limit 10 --offset 2
See code: src/commands/utils/db/read.ts
produce and/or consume kafka messages
USAGE
$ microkit utils:kafka
See code: src/commands/utils/kafka/index.ts
listen for or consume Kafka events
USAGE
$ microkit utils:kafka:listen
OPTIONS
-g, --groupId=groupId [default: microkit] kafka consumer group identifier
-s, --scope=scope (required) kafka topic suffix [i.e -qa, -local]
-t, --topics=topics (required) kafka topic
--actions=actions [default: ] kafka actions to listen to
--host=host address of kafka host [i.e. https://example.com:9094]
--ignore=ignore [default: ] kafka actions to ignore
--listen-once stop listening once a message is received
--total=total maximum number of messages to consume
EXAMPLES
$ kafka:listen --topics user-registration user-login
$ kafka:listen --topics user-registration --scope -dev
$ kafka:listen --topics user-registration --listen-once
$ kafka:listen --topics user-registration --actions upload-profile-picture
$ kafka:listen --topics shopping-cart --ignore add-to-wishlist
See code: src/commands/utils/kafka/listen.ts
produce kafka messages
USAGE
$ microkit utils:kafka:produce
OPTIONS
-a, --action=action kafka topic action
-o, --object=object (required) [default: {"origin": "microkit"}] payload in JSON format
-t, --topic=topic (required) kafka topic
--host=host address of kafka host [i.e. https://example.com:9094]
--total=total [default: 1] number of messages to send
EXAMPLES
$ kafka:produce --topic user-registration
$ kafka:produce --topic user-registration
$ kafka:produce --topic user-registration --total 10
$ kafka:produce --topic user-registration --total 10 --object '{"id": 8897, "typeId": 43, "username": "lneto"}'
See code: src/commands/utils/kafka/produce.ts
starts an RTP server
USAGE
$ microkit utils:rtp
OPTIONS
--host=host [default: 127.0.0.1] RTP server host
--log log RTP server messages
--port=port [default: 5554] RTP client port
EXAMPLES
$ rtp
$ rtp --host localhost --port 5554
$ rtp --host localhost
$ rtp --port 5554
See code: src/commands/utils/rtp/index.ts
transcribe an audio stream
USAGE
$ microkit utils:transcribe
OPTIONS
-p, --port=port [default: 5554] RTP client port
-v, --vendor=(deepgram) [default: deepgram] transcription vendor
--host=host [default: 127.0.0.1] RTP server host
EXAMPLES
$ transcribe
$ transcribe --host localhost --port 5554
$ transcribe --host localhost
$ transcribe --port 5554
See code: src/commands/utils/transcribe/index.ts
display help for microkit
USAGE
$ microkit help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help