Quick Start Tutorial
As part of this quick start tutorial, you will need to install Chocolatey, as this is the primary distribution tool for distributing the Petabridge.Cmd binaries. However, you can also follow the manual installation instructions if you aren't able to use Chocolatey.
To get started, install the
> choco install petabridge-cmd
Next, clone the Petabridge.Cmd quick start source to your local machine. This project features a very simple
Petabridge.Cmd.Host plus some custom commands.
NOTE: You will need Visual Studio 2015 or later installed on your local system in order to build the quick start host.
In the directory where you extracted the quick start source, execute the
run.cmd file to automatically compile and launch the host. If the script ran successfully, you'll see the following output on screen:
This indicates that the
Petabridge.Cmd.Host is bound to
0.0.0.0:9110 (or the IPV6 equivalent) which means that you can connect to it via any assignable IP address on the machine, including
Now we're ready to execute some commands against the host!
In order for
pbm to manage an Akka.NET application, it must be connected to the
Petabridge.Cmd.Host. Connect the client via the following command:
> pbm 127.0.0.1:9110
You'll see the following output, indicating that the connection was successful:
From there we're ready to begin executing some commands. Execute the following to see which commands are exposed by the server:
pbm [127.0.0.1:9110]> help
This will provide a listing of all of the available commands supported by the host application. The
pbm client is a dumb terminal, in essence. It downloads the range of commands supported by the server and is able to automatically provide the end-user with tab autocompletion, help documentation, and suggestions based on the information provided via the server.
Let's try one of the custom commands that we implemented just for this quick start. Try the following:
pbm [127.0.0.1:9110]> msg write -m "Hello, world!"
Looks like that command went through ok... Now we can use another one of the custom commands to check the output.
pbm [127.0.0.1:9110]> msg view -s 5m
While you're at it, give the tab autocomplete a try.
pbm you can type complete commands solely through autocomplete. Even the
5m value was suggested via the autocomplete system built into
And now you're off and running! If you wish, you can install additional command modules into
Petabridge.Cmd.Host and bring additional capabilities to the
pbm client included in this example.