You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: An overview of what the Command-Line Interface (CLI) is and its main features
4
+
keywords: CLI, CLI tools, .NET, .NET Core
5
5
author: mairaw
6
6
manager: wpickett
7
-
ms.date: 06/20/2016
7
+
ms.date: 10/06/2016
8
8
ms.topic: article
9
9
ms.prod: .net-core
10
10
ms.technology: .net-core-technologies
11
11
ms.devlang: dotnet
12
12
ms.assetid: b70e9ac0-c8be-49f7-9332-95ab93e0e7bc
13
13
---
14
14
15
-
# .NET Core CommandLine Tools
15
+
# .NET Core Command-Line Interface Tools
16
16
17
-
## What is the .NET Core Command Line Interface (CLI)?
18
-
The .NET Core CLI is a new foundational cross-platform toolchain for developing
17
+
By [Zlatko Knezevic](https://github.com/blackdwarf) and [Maira Wenzel](https://github.com/mairaw)
18
+
19
+
The .NET Core Command-Line Interface (CLI) is a new foundational cross-platform toolchain for developing
19
20
.NET Core applications. It is "foundational" because it is the primary layer on which other,
20
21
higher-level tools, such as Integrated Development Environments (IDEs), editors and
21
22
build orchestrators can build on.
@@ -38,11 +39,11 @@ prerequisites on the machine; you need to install all of the prerequisites manua
38
39
setting up build servers or when you wish to install the tools without administrative privileges (do note the prerequisites
39
40
caveat above). You can find more information on the [install script reference topic](dotnet-install-script.md). If you are
40
41
interested in how to set up CLI on your continuous integration (CI) build server you can take a look at the
41
-
[CLI with CI servers](using-ci-with-cli.md)document.
42
+
[CLI with CI servers](using-ci-with-cli.md)topic.
42
43
43
44
By default, the CLI will install in a side-by-side (SxS) manner. This means that multiple versions of the CLI tools
44
45
can coexist at any given time on a single machine. How the correct version gets used is explained in more detail in
45
-
the [driver section](#driver)below.
46
+
the [driver](#driver)section.
46
47
47
48
### What commands come in the box?
48
49
The following commands are installed by default:
@@ -60,9 +61,8 @@ explained in greater detail in the [extensibility section](#extensibility).
60
61
61
62
## Working with the CLI
62
63
63
-
### A short sample
64
64
Before we go into any more details, let's see how working with the CLI looks like from a 10,000-foot view.
65
-
The sample below utilizes several commands from the CLI standard install to initialize a new simple console application,
65
+
The following example utilizes several commands from the CLI standard install to initialize a new simple console application,
66
66
restore the dependencies, build the application and then run it.
67
67
68
68
```console
@@ -72,64 +72,59 @@ dotnet build --output /stuff
72
72
dotnet /stuff/new.dll
73
73
```
74
74
75
-
### How does it work?
76
-
As we saw in the short sample [above](#a-short-sample), there is a pattern in the way you use the CLI tools. Within that pattern, we can
75
+
As you can see in the previous example, there is a pattern in the way you use the CLI tools. Within that pattern, we can
77
76
identify three main pieces of each command:
78
77
79
-
1. The driver ("dotnet")
80
-
2. The command, or "verb"
81
-
3. Command arguments
82
-
83
-
Let's dig into more details on each of the above.
78
+
1.[The driver ("dotnet")](#driver)
79
+
2.[The command, or "verb"](#the-verb)
80
+
3.[Command arguments](#the-arguments)
84
81
85
82
### Driver
86
-
The driver is named `dotnet`. It is the first part of what you invoke. The driver has two responsibilities:
83
+
The driver is named [dotnet](dotnet.md). It is the first part of what you invoke. The driver has two responsibilities:
87
84
88
-
1.Executing IL code
85
+
1.Running portable apps
89
86
2. Executing the verb
90
87
91
-
Which of the two things it does is dependent on what is specified on the command line. In the first case, you would
92
-
specify an IL assembly that `dotnet` would run similar to this: `dotnet /path/to/your.dll`.
88
+
What it does depends on what is specified on the command line. In the first case, you would
89
+
specify a portable app DLL that `dotnet` would run similar to this: `dotnet /path/to/your.dll`.
93
90
94
-
In the second case, the driver attempts to invoke the specified command. This will start the CLI command execution
95
-
process. First, the driver will determine the version of the tooling that you want. You can specify the version in the
96
-
`global.json` file using the `sdkVersion` property. If that is not available, the driver will find the latest version
97
-
of the tools that is installed on disk and will use that version. Once the version is determined, it will execute the
91
+
In the second case, the driver attempts to invoke the specified command. This starts the CLI command execution
92
+
process. First, the driver determines the version of the tooling that you want. You can specify the version in the
93
+
[global.json](global-json.md) file using the [sdkVersion](global-json.md#sdkversion) property. If that is not available, the driver finds the latest version
94
+
of the tools that is installed on disk and uses that version. Once the version is determined, it executes the
98
95
command.
99
96
100
97
### The "verb"
101
-
The verb is simply a command that performs an action. `dotnet build`will build your code. `dotnet publish`will publish
98
+
The verb is simply a command that performs an action. `dotnet build`builds your code. `dotnet publish`publishes
102
99
your code. The verb is implemented as a console application that is named per convention: `dotnet-{verb}`. All of the
103
100
logic is implemented in the console application that represents the verb.
104
101
105
102
### The arguments
106
-
The arguments that you pass on the commandline are the arguments to the actual verb/command being invoked.
107
-
For example, when you type `dotnet publish --output publishedapp` the `--output` argument is passed to the
103
+
The arguments that you pass on the command-line are the arguments to the actual verb/command being invoked.
104
+
For example, when you type `dotnet publish --output publishedapp`, the `--output` argument is passed to the
108
105
`publish` command.
109
106
110
107
## Types of application portability
111
108
CLI enables applications to be portable in two main ways:
112
109
113
-
1. Completely portable application that can run anywhere .NET Core is installed
114
-
2. Self-contained applications
110
+
1. Completely portable applications that can run anywhere .NET Core is installed
111
+
2. Self-contained deployments
115
112
116
-
You can learn more about both of these in the [application types overview](../app-types.md) topic.
113
+
You can learn more about both of these in the [.NET Core application deployment](../deploying/index.md) topic.
117
114
118
115
## Migration from DNX
119
-
If you used DNX in RC1 of .NET Core, you may be wondering what happened to it and how do these new tools
116
+
If you used DNX in .NET Core 1.0 RC1, you may be wondering what happened to it and how do these new tools
120
117
relate to the DNX tools. In short, the DNX tools have been replaced with the .NET Core CLI tools.
121
118
If you have existing projects or are just wondering how the commands map, you
122
-
can use the [DNX to CLI migration document](../migrating-from-dnx.md) to get all of the details.
119
+
can use the [DNX to CLI migration](../migrating-from-dnx.md)topic to get all the details.
123
120
124
121
## Extensibility
125
-
Of course, not every tool that you could use in your workflow will be a part of the core CLI tools. However, .NET Core
122
+
Of course, not every tool that you could use in your workflow will be part of the core CLI tools. However, .NET Core
126
123
CLI has an extensibility model that allows you to specify additional tools for your projects. You can find out more
127
-
in the [extensibility document](extensibility.md).
124
+
in the [.NET Core CLI extensibility model](extensibility.md) topic.
128
125
129
-
## More resources
126
+
## Summary
130
127
This was a short overview of the most important features of the CLI. You can find out more by using the reference and
131
128
conceptual topics on this site. There are also other resources you can use:
0 commit comments