github.com/AiRISTAFlowInc/fs-cli@v0.2.6/README.md (about)

     1  <p align="center">
     2    <img src ="https://raw.githubusercontent.com/TIBCOSoftware/flogo/master/images/projectflogo.png" />
     3  </p>
     4  
     5  <p align="center" >
     6    <b>Serverless functions and edge microservices made painless</b>
     7  </p>
     8  
     9  <p align="center">
    10    <img src="https://travis-ci.org/TIBCOSoftware/flogo-cli.svg"/>
    11    <img src="https://img.shields.io/badge/dependencies-up%20to%20date-green.svg"/>
    12    <img src="https://img.shields.io/badge/license-BSD%20style-blue.svg"/>
    13    <a href="https://gitter.im/project-flogo/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link"><img src="https://badges.gitter.im/Join%20Chat.svg"/></a>
    14  </p>
    15  
    16  <p align="center">
    17    <a href="#Installation">Installation</a> | <a href="#getting-started">Getting Started</a> | <a href="#documentation">Documentation</a> | <a href="#contributing">Contributing</a> | <a href="#license">License</a>
    18  </p>
    19  
    20  <br/>
    21  Project Flogo is an open source framework to simplify building efficient & modern serverless functions and edge microservices and this is the cli that makes it all happen. 
    22  
    23  FLOGO CLI
    24  ======================
    25  
    26  The Flogo CLI is the primary tool to use when working with a Flogo application.  It is used to create, modify and build Flogo applications
    27  ## Installation
    28  ### Prerequisites
    29  To get started with the Flogo CLI you'll need to have a few things
    30  * The Go programming language version 1.11 or later should be [installed](https://golang.org/doc/install).
    31  * In order to simplify dependency management, we're using **go mod**. For more information on **go mod**, visit the [Go Modules Wiki](https://github.com/golang/go/wiki/Modules).
    32  
    33  ### Install the cli
    34  To install the CLI, simply open a terminal and enter the below command
    35  
    36  ```
    37  $ go get -u github.com/AiRISTAFlowInc/fs-cli/...
    38  ```
    39  
    40  _Note that the -u parameter automatically updates the cli if it exists_
    41  
    42  ### Build the CLI from source
    43  You can build the cli from source code as well, which is convenient if you're developing new features for it! To do that, follow these easy steps
    44  
    45  ```bash
    46  # Get the flogo CLI from GitHub
    47  $ git clone https://github.com/AiRISTAFlowInc/fs-cli.git
    48  
    49  # Go to the directory
    50  $ cd cli
    51  
    52  # Optionally check out the branch you want to use 
    53  $ git checkout test_branch
    54  
    55  # Run the install command
    56  $ go install ./... 
    57  ```
    58  
    59  ## Getting started
    60  Getting started should be easy and fun, and so is getting started with the Flogo cli. 
    61  
    62  First, create a file called `flogo.json` and with the below content (which is a simple app with an [HTTP trigger](https://tibcosoftware.github.io/flogo/development/webui/triggers/rest/))
    63  
    64  ```json
    65  {
    66    "name": "SampleApp",
    67    "type": "flogo:app",
    68    "version": "0.0.1",
    69    "appModel": "1.1.0",
    70    "imports": [
    71    	"github.com/AiRISTAFlowInc/fs-contrib/trigger/rest",
    72    	"github.com/AiRISTAFlowInc/fs-flow",
    73    	"github.com/AiRISTAFlowInc/fs-contrib/activity/log"
    74    ],
    75    "triggers": [
    76      {
    77        "id": "receive_http_message",
    78        "ref": "#rest",
    79        "name": "Receive HTTP Message",
    80        "description": "Simple REST Trigger",
    81        "settings": {
    82          "port": 9233
    83        },
    84        "handlers": [
    85          {
    86            "settings": {
    87              "method": "GET",
    88              "path": "/test"
    89            },
    90            "action": {
    91              "ref": "#fs-flow",
    92              "settings": {
    93                "flowURI": "res://flow:sample_flow"
    94              }
    95            }
    96          }
    97        ]
    98      }
    99    ],
   100    "resources": [
   101      {
   102        "id": "flow:sample_flow",
   103        "data": {
   104          "name": "SampleFlow",
   105          "tasks": [
   106            {
   107              "id": "log_message",
   108              "name": "Log Message",
   109              "description": "Simple Log Activity",
   110              "activity": {
   111                "ref": "#log",
   112                "input": {
   113                  "message": "Simple Log",
   114                  "addDetails": "false"
   115                }
   116              }
   117            }
   118          ]
   119        }
   120      }
   121    ]
   122  }
   123  ```
   124  
   125  Based on this file we'll create a new flogo app
   126  
   127  ```bash
   128  $ flogo create -f flogo.json myApp
   129  ```
   130  
   131  From the app folder we can build the executable
   132  
   133  ```bash
   134  $ cd myApp
   135  $ flogo build -e
   136  ```
   137  
   138  Now that there is an executable we can run it!
   139  
   140  ```bash
   141  $ cd bin
   142  $ ./myApp
   143  ```
   144  
   145  The above commands will start the REST server and wait for messages to be sent to `http://localhost:9233/test`. To send a message you can use your browser, or a new terminal window and run
   146  
   147  ```bash
   148  $ curl http://localhost:9233/test
   149  ```
   150  
   151  _For more tutorials check out the [Labs](https://tibcosoftware.github.io/flogo/labs/) section in our documentation_
   152  
   153  ## Documentation
   154  
   155  There is documentation also available for [CLI Commands](docs/commands.md) and [CLI Plugins](docs/plugins.md).
   156  
   157  ## Contributing
   158  Want to contribute to Project Flogo? We've made it easy, all you need to do is fork the repository you intend to contribute to, make your changes and create a Pull Request! Once the pull request has been created, you'll be prompted to sign the CLA (Contributor License Agreement) online.
   159  
   160  Not sure where to start? No problem, you can browse the Project Flogo repos and look for issues tagged `kind/help-wanted` or `good first issue`. To make this even easier, we've added the links right here too!
   161  * Project Flogo: [kind/help-wanted](https://github.com/TIBCOSoftware/flogo/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/TIBCOSoftware/flogo/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
   162  * flogo cli: [kind/help-wanted](https://github.com/AiRISTAFlowInc/fs-cli/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/AiRISTAFlowInc/fs-cli/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
   163  * flogo core: [kind/help-wanted](https://github.com/AiRISTAFlowInc/fs-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/AiRISTAFlowInc/fs-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
   164  * flogo contrib: [kind/help-wanted](https://github.com/AiRISTAFlowInc/fs-contrib/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/AiRISTAFlowInc/fs-contrib/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
   165  
   166  Another great way to contribute to Project Flogo is to check [flogo-contrib](https://github.com/AiRISTAFlowInc/fs-contrib). That repository contains some basic contributions, such as activities, triggers, etc. Perhaps there is something missing? Create a new activity or trigger or fix a bug in an existing activity or trigger.
   167  
   168  If you have any questions, feel free to post an issue and tag it as a question, email flogo-oss@tibco.com or chat with the team and community:
   169  
   170  * The [project-flogo/Lobby](https://gitter.im/project-flogo/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) Gitter channel should be used for general discussions, start here for all things Flogo!
   171  * The [project-flogo/developers](https://gitter.im/project-flogo/developers?utm_source=share-link&utm_medium=link&utm_campaign=share-link) Gitter channel should be used for developer/contributor focused conversations. 
   172  
   173  For additional details, refer to the [Contribution Guidelines](https://github.com/TIBCOSoftware/flogo/blob/master/CONTRIBUTING.md).
   174  
   175  ## License 
   176  Flogo source code in [this](https://github.com/AiRISTAFlowInc/fs-cli) repository is under a BSD-style license, refer to [LICENSE](https://github.com/AiRISTAFlowInc/fs-cli/blob/master/LICENSE)