info
It is also possible to use the wildcard when specifying event types. For example event.user.*.0
this will stream all events that start with event.user.
.
The Flowcore CLI allows you to stream data from Flowcore to your local machine. This is useful for debugging, development and local exploration of your data.
menu
icon and select
flowcore-cli stream command
.To stream all events from a Data Core, you can use the *
wildcard to stream all events from the Data Core.
or to stream all events from a Flow Type, you can use the *
wildcard to stream all events from the Flow Type.
info
It is also possible to use the wildcard when specifying event types. For example event.user.*.0
this will stream all events that start with event.user.
.
The default command will log out the data to the terminal. If you want to send data to a different location, you can use the subcommand http
and specify a -d
flag to specify the http endpoint to send the data to.
To specify how many hours, days, weeks, months or years of data you want to stream, you can use the -s
flag to sepecify
the start time to fetch events. The -s
flag accepts a string in the format 1h
, 1d
, 1w
, 1m
or 1y
.
JSON
You can also pipe the output to a file or another command by using the >
operator.
If you have a development defined in the flowcore manifest, you can use the local
command to start a stream thread for
each of the proxy endpoints. This is useful for local development and debugging.
This will start a stream thread for each of the endpoints specified and send the data to the specified endpoint.
info
This is especally useful when you are development an application using for example Next.js and you deploy the transformers as api endpoints.
If you only want the payload of the event, you can use the --payload
flag to only stream the payload of the event.
This will only log the payload of the event to the terminal.
If you only want to stream live data and not data in the past, you can use the -s
flag with now
as the value to only stream live data.
This will only stream data from the time you run the command and not any data in the past.
If you only want to stream a certain number of events, you can use the -m
flag to specify the maximum number of events to stream.
This will only stream 100 events and then stop the stream.
If you want to stream the data in JSON format, you can use the --json
flag to stream the data and output it in JSONL format.
This will stream the data and output it in JSONL format, which is useful for piping the output to another command or file.
If you want to send the data to a different location, you can use the http
subcommand and specify a -d
flag to specify the http endpoint to send the data to.
This will send the data to the specified endpoint.
info
If you want to stream the data to a different Data Core, then you need to use the --payload
flag to only stream the payload of the event to the webhook endpoint.
info
The default output is http
so you don’t have to specify the -o
flag if you want to send the data to a different location. And the default endpoint is http://localhost:3000/transform
so you don’t have to specify the -d
flag either if you want to send the data to the default endpoint.
If you want to send headers with the data, you can use the -H
flag to specify the headers to send with the data.
This will send the data with the specified headers, you can specify multiple headers by using the -H
flag multiple times.
If you only want to stream what is currently in the Data Core and not switch to live data, you can use the --no-live
flag to only stream what is currently in the Data Core.
This will only stream what is currently in the Data Core and not switch to live data after reaching the end of the data stream.
If you want to stream data from a specific time, you can use the -s
flag to specify the start time to fetch events. The -s
flag accepts a string in the format ISO date
, 1h
, 1d
, 1w
, 1m
or 1y
.
This will stream data from the last hour and then stop the stream.
If you want to stream data from a specific time to a specific time, you can use the -s
and -e
flags to specify the start and end time to fetch events. The -s
and -e
flags accept a string in the format ISO date
, 1h
, 1d
, 1w
, 1m
or 1y
.
This will stream data from the 1st of January 2022 to the 2nd of January 2022 and then stop the stream.
info
When using the -s
and -e
flags, the stream will stop when it reaches the end time specified.