Quickstart
Get started with Teams AI Library (v2) quickly using the Teams CLI.
Set up a new projectโ
Prerequisitesโ
- .NET v.8 or higher. Install or upgrade from dotnet.microsoft.com.
Instructionsโ
Install the Teams CLIโ
Use your terminal to install the Teams CLI globally using npm:
npm install -g @microsoft/teams.cli
The Teams CLI is a command-line tool that helps you create and manage Teams applications. It provides a set of commands to simplify the development process.
After installation, you can run teams --version
to verify the installation.
Creating Your First Agentโ
Let's begin by creating a simple echo agent that responds to messages. Run:
teams new csharp quote-agent --template echo
This command:
- Creates a new directory called
Quote.Agent
. - Bootstraps the echo agent template files into your project directory.
- Creates your agent's manifest files, including a
manifest.json
file and placeholder icons in theQuote.Agent/appPackage
directory. The Teams app manifest is required for sideloading the app into Teams.
The
echo
template creates a basic agent that repeats back any message it receives - perfect for learning the fundamentals.
Running your agentโ
- Navigate to your new agent's directory:
cd Quote.Agent/Quote.Agent
- Install the dependencies:
dotnet restore
- Start the development server:
dotnet run
- In the console, you should see a similar output:
[INFO] Microsoft.Hosting.Lifetime Now listening on: http://localhost:3978
[WARN] Echo.Microsoft.Teams.Plugins.AspNetCore.DevTools โ ๏ธ Devtools are not secure and should not be used production environments โ ๏ธ
[INFO] Echo.Microsoft.Teams.Plugins.AspNetCore.DevTools Available at http://localhost:3978/devtools
[INFO] Microsoft.Hosting.Lifetime Application started. Press Ctrl+C to shut down.
[INFO] Microsoft.Hosting.Lifetime Hosting environment: Development
When the application starts, you'll see:
- An HTTP server starting up (on port 3978). This is the main server which handles incoming requests and serves the agent application.
- A devtools server starting up. This is a developer server that provides a web interface for debugging and testing your agent quickly, without having to deploy it to Teams.
Now, navigate to the devtools server by opening your browser and navigating to http://localhost:3978/devtools. You should see a simple interface where you can interact with your agent. Try sending it a message!
Next stepsโ
After creating and running your first agent, read about the code basics to better understand its components and structure.
Otherwise, if you want to run your agent in Teams, you can check out the Running in Teams guide.