Show / Hide Table of Contents

    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.

    Setup

    To get started, install the pbm client as a .NET Core global tool.

    > dotnet tool install -g pbm
    

    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.

    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:

    Petabridge.Cmd.Host quick start

    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 localhost.

    Now we're ready to execute some commands against the host!

    Run

    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:

    pbm client connected to quick start host

    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
    

    pbm help output for quick start host

    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!"
    

    pbm 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 msg view -m 5m

    With pbm you can type complete commands solely through autocomplete. Even the 5m value was suggested via the autocomplete system built into pbm.

    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.

    Back to top Generated by DocFX