# Your First App with the CLI — .NET Core: Build, Test and Ship Web APIs

Source: https://www.geekswithgeeks.com/en/dotnet-core/dotnet-cli-first-app

> Create, run and publish a console app using only the dotnet command line.

## The dotnet CLI

Every task has a verb: `dotnet new` creates a project, `dotnet run` builds and runs it, `dotnet build` only compiles, and `dotnet publish` prepares it for deployment.

## Create and run

These three commands scaffold a console project, move into it and run it. `dotnet new console` creates a `.csproj` and a `Program.cs`.

```bash
dotnet new console -o HelloApp
cd HelloApp
dotnet run
```

Output:

```
Hello, World!
```

## Check your version

Run `dotnet --info` when something behaves oddly. It shows which SDK you are using; a `global.json` file in a parent folder can pin a different one than you expect.

**Quiz:** Which command builds the project and then starts it?

- [ ] dotnet new
- [x] dotnet run
- [ ] dotnet add
- [ ] dotnet restore

*Answer:* dotnet run. `dotnet run` restores, builds and launches the app in one step.
