directbot command line
This project is for illustrative purposes only and should not be used in production.
The aim is to provide a command line for easy communication with a Bot. To do this, you simply need to install the command by downloading the package and installing it. Next, you’ll have a command line for communicating interactively (via the Console) or by specifying a request/response text file to automate the process (in this case, a Log file is automatically created).
Once installed, you can simply use the directbot command (without parameters) to display help.
How to install?
First, download the latest version of the SampleBotConnection.1.0.0.2.zip package. Extract it in a folder, and from this folder, run this command.
dotnet tool install --global --add-source . SampleBotConnection
How to use?
- Run the following command to start the bot using the interactive mode (console).
directbot https://<token-endpoint>token-endpoint: The endpoint to retrieve the Direct Line token from. See this page to publish an agent and to retrieve your token endpoint. tps://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-connect-bot-to-custom-application
- Run the following command to start the bot using the automatic mode.
directbot https://<token-endpoint> <exchange-file>exchange-file: File name containing the message to send and to received from the bot. If this file is not provided, the bot will start in interactive mode.
Example of exchange file: The first file contain the number of times to repeat the conversation and the number of characters to ignore to all message exchanged. The following lines contain the messages to send and to receive from the bot. A
<null>value means that the bot will not verify the message. The keywordquitis used to stop the conversation.# Repeat: 10; IgnoreFirstMessageChar: 5 - S: hello - R: Hello, how can I help you today? - S: thanks - R: You're welcome. - S: quit
How to uninstall?
dotnet tool uninstall -g SampleBotConnection