github.com/project-flogo/cli@v0.12.0/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 install github.com/project-flogo/cli/...@latest 38 ``` 39 40 ### Build the CLI from source 41 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 42 43 ```bash 44 # Get the flogo CLI from GitHub 45 $ git clone https://github.com/project-flogo/cli.git 46 47 # Go to the directory 48 $ cd cli 49 50 # Optionally check out the branch you want to use 51 $ git checkout test_branch 52 53 # Run the install command 54 $ go install ./... 55 ``` 56 57 ## Getting started 58 Getting started should be easy and fun, and so is getting started with the Flogo cli. 59 60 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/)) 61 62 ```json 63 { 64 "name": "SampleApp", 65 "type": "flogo:app", 66 "version": "0.0.1", 67 "appModel": "1.1.0", 68 "imports": [ 69 "github.com/project-flogo/contrib/trigger/rest", 70 "github.com/project-flogo/flow", 71 "github.com/project-flogo/contrib/activity/log" 72 ], 73 "triggers": [ 74 { 75 "id": "receive_http_message", 76 "ref": "#rest", 77 "name": "Receive HTTP Message", 78 "description": "Simple REST Trigger", 79 "settings": { 80 "port": 9233 81 }, 82 "handlers": [ 83 { 84 "settings": { 85 "method": "GET", 86 "path": "/test" 87 }, 88 "action": { 89 "ref": "#flow", 90 "settings": { 91 "flowURI": "res://flow:sample_flow" 92 } 93 } 94 } 95 ] 96 } 97 ], 98 "resources": [ 99 { 100 "id": "flow:sample_flow", 101 "data": { 102 "name": "SampleFlow", 103 "tasks": [ 104 { 105 "id": "log_message", 106 "name": "Log Message", 107 "description": "Simple Log Activity", 108 "activity": { 109 "ref": "#log", 110 "input": { 111 "message": "Simple Log", 112 "addDetails": "false" 113 } 114 } 115 } 116 ] 117 } 118 } 119 ] 120 } 121 ``` 122 123 Based on this file we'll create a new flogo app 124 125 ```bash 126 $ flogo create -f flogo.json myApp 127 ``` 128 129 From the app folder we can build the executable 130 131 ```bash 132 $ cd myApp 133 $ flogo build -e 134 ``` 135 136 Now that there is an executable we can run it! 137 138 ```bash 139 $ cd bin 140 $ ./myApp 141 ``` 142 143 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 144 145 ```bash 146 $ curl http://localhost:9233/test 147 ``` 148 149 _For more tutorials check out the [Labs](https://tibcosoftware.github.io/flogo/labs/) section in our documentation_ 150 151 ## Documentation 152 153 There is documentation also available for [CLI Commands](docs/commands.md) and [CLI Plugins](docs/plugins.md). 154 155 ## Contributing 156 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. 157 158 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! 159 * 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) 160 * flogo cli: [kind/help-wanted](https://github.com/project-flogo/cli/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/project-flogo/cli/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 161 * flogo core: [kind/help-wanted](https://github.com/project-flogo/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/project-flogo/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 162 * flogo contrib: [kind/help-wanted](https://github.com/project-flogo/contrib/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/project-flogo/contrib/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 163 164 Another great way to contribute to Project Flogo is to check [flogo-contrib](https://github.com/project-flogo/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. 165 166 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: 167 168 * 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! 169 * 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. 170 171 For additional details, refer to the [Contribution Guidelines](https://github.com/TIBCOSoftware/flogo/blob/master/CONTRIBUTING.md). 172 173 ## License 174 Flogo source code in [this](https://github.com/project-flogo/cli) repository is under a BSD-style license, refer to [LICENSE](https://github.com/project-flogo/cli/blob/master/LICENSE)