Skip to content

Commit

Permalink
KTOR-4631 document CLI tools (#7)
Browse files Browse the repository at this point in the history
* KTOR-4631 document CLI tools
  • Loading branch information
andreyaksenov authored and Ololoshechkin committed Jul 28, 2022
1 parent 7583dc8 commit e6a62cf
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,56 @@
# ktor-cli
Command-line tool for creating Ktor projects
# Ktor CLI
Ktor CLI is a command-line tool that brings the capability to create and run [Ktor](https://ktor.io/) applications from the command line.

## Install CLI tools

### macOS

You can install Ktor CLI tools on macOS using [Homebrew](https://brew.sh/) as follows:
1. Add a Ktor repository using the `brew tap` command:
```
brew tap ktorio/ktor
```
2. Install Ktor CLI tools using `brew install`:
```
brew install --build-from-source ktor\
```

### Linux

On Linux, you can install Ktor CLI tools using [snap](https://snapcraft.io/):

```
snap install --beta --classic ktor
```

### Available commands
You can get a list of Ktor commands available to you by typing `ktor --help`.


## Create a project

To create a new Ktor project, pass a project name to the `ktor generate` command:

```
ktor generate ktor-sample
```

This command generates a simple Ktor project that uses the Gradle build system with Kotlin DSL.


## Run a project

To run the existing Ktor application, use the `ktor start` command.
This command accepts the name of the directory where the project is placed:

```
ktor start ktor-sample
```

With the default configuration, the terminal should show the following message:

```
[main] INFO ktor.application - Responding at http://0.0.0.0:8080
```

This means that the server is ready to accept requests at the http://0.0.0.0:8080 address.

0 comments on commit e6a62cf

Please sign in to comment.