teams-cli
A Rust CLI for Microsoft Teams: messages, channels and events through Graph API with JSON output and agent-friendly exit codes.
- 61 ★ on the repository
- Last commit
Broad access
Why this level
- The agent posts messages as the signed-in user and manages teams and channels through Graph with delegated permissions.
Install
- Works in
Manual install
brew install osodevops/tap/teams-cliFirst command from the README Install section; skills install separately with `npx skills add osodevops/ms-teams-cli`.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The agent posts messages as the signed-in user and manages teams and channels through Graph with delegated permissions.
This is third-party code. Review the repository files before installing.
What it does
A single `teams` binary gives agents and scripts access to Microsoft Teams through the Microsoft Graph API. Every command called from a pipe returns a JSON envelope with `success`, `data` and `metadata`, and on failure a code such as `AUTH_TOKEN_EXPIRED`. Exit codes are tabulated: 3 for sign-in errors, 4 for permission denied, 6 for rate limits, 7 for network. An agent branches on them without reading text. The CLI ships with the `teams-cli-setup`, `teams-cli-messaging`, `teams-cli-admin` and `teams-cli-automation` skills covering sign-in, messaging, team management and automation.
Who it is for. Admins and developers who automate Microsoft Teams workflows with an agent or script without building a bot of their own.
Good fit when
- An agent must read a chat and post a summary to a channel as the user.
- A CI pipeline writes build results into Teams and expects a clear exit code.
- An admin needs to create teams and channels in bulk from a script.
- A customer tenant needs its own sign-in and app: `--profile` keeps them separate.
Not a fit when
- A conversational bot inside Teams is needed: the tool is called from outside and does not replace a bot.
- The organization forbids delegated Graph permissions or gives no admin consent.
- A token captured from the Teams web client is required: Graph accepts only its own tokens.
Example request
Read the latest messages in the Engineering channel with teams and post a one-message daily summary there.Limitations
Messages and actions as a user need a delegated sign-in: `teams auth login` or `teams auth login --device-code`. Reading channel messages needs the broader `ChannelMessage.Read.All` scope and often admin consent. Tokens captured from the Teams web client do not work because they carry the wrong audience. A customer app is used through `--client-id` and `--tenant-id`. Permissions are requested per account, so the agent posts messages as the signed-in person.
How to disable. Sign out with the `teams auth` command for your profile, remove the binary (`brew uninstall teams-cli`, `scoop uninstall teams` or `cargo uninstall`) and revoke the app consent in Microsoft Entra.
FAQ
How do I install teams?
`brew install osodevops/tap/teams-cli` on macOS and Linux, `scoop install teams` on Windows or `cargo install --git https://github.com/osodevops/ms-teams-cli`.
How do I install the agent skills?
With `npx skills add osodevops/ms-teams-cli`. A single skill installs with the `--skill` flag, for example `--skill teams-cli-messaging`.
How do I sign in without a browser?
Use `teams auth login --device-code`: the CLI shows a code and an address to confirm on another device.
How do I check sign-in and permissions?
`teams auth doctor --output json` shows sign-in state, tenant, token type and consent URL.
What exit codes do commands use?
0 success, 2 invalid arguments, 3 auth error, 4 permission denied, 5 not found, 6 rate limited, 7 network, 8 server error, 10 configuration error.
Discussion
No questions or reviews yet.
Related
CLI toolsA Slack CLI and skill: the agent reads channels and threads and searches messages and files, and drafts or sends only when you ask
A CLI and skill for Yandex Tracker and Wiki: short output readable by people and agents alike, instead of raw MCP payloads costing thousands of tokens
Linear CLI
linear-cli
A Linear CLI for the terminal: list, start and create issues, PRs from a branch, JSON output and an agent skill, with git and jj support
MCP Teams Server
mcp-teams-server
An MCP server for Microsoft Teams: reading channel messages, creating threads with mentions and replying. The code is open by Inditex and runs in Docker
WeCom CLI
wecom-cli
The official WeCom CLI with 15 agent skills: messages, docs, calendar, meetings, mail and disk from the terminal
An MCP server that turns a plain request into CLI for Microsoft 365 command chains: SharePoint, Teams, Planner, Power Platform.
README in short
The README defines an agent contract: a uniform JSON envelope, an exit code table and rules for truncated lists. A separate section covers sign-in with variants for a custom app.