Skip to main content

teams-cli

Microsoft Teams from your terminal—human-first and agent-first.

teams-cli is a Rust CLI and TUI for everyday Microsoft Teams work through supported Microsoft Graph APIs. It is designed as two equally first-class experiences over one typed core: a fast, calm terminal interface for people and a deterministic, introspectable command contract for agents. It signs in as you with delegated OAuth, protects refresh credentials in your operating system's credential store, emits readable terminal output on a TTY, and defaults to structured JSON when piped.

For humans, no arguments open guided onboarding on first use and the TUI afterward. For agents, no command ever waits for an undeclared prompt: teams schema works offline, collection sizes are caller-bounded, writes declare their effects, errors have stable kinds and exit codes, and stdout contains data only.

Install

pipx install teams-cli
# or
cargo install teams-cli --locked
# or run from PyPI without installing
uvx teams-cli --help

The PyPI distribution provides both teams and teams-cli as executable names.

To work from source:

cargo install --path .
# or build a local wheel
maturin build

Explore before configuring Microsoft 365

teams tui --demo
teams tui --demo --snapshot
teams capabilities
teams schema --command "messages send"

Onboarding

Run teams in a terminal on first use, or start explicitly:

teams init

teams-cli includes a maintained multitenant Microsoft Entra public-client registration, so normal setup does not require creating an app or copying a client ID:

teams init

Browser PKCE is the human-friendly default. The browser talks directly to Microsoft, and the CLI never receives or stores your password. Normal sign-in requests these delegated scopes:

openid profile offline_access User.Read Team.ReadBasic.All
Channel.ReadBasic.All Chat.Read Chat.Create ChatMessage.Send
ChannelMessage.Send

The TUI is also the recovery path: an unconfigured profile, missing credential, expired refresh session, or Microsoft 401 opens a focused connection screen. Press Enter or a to restore the normal terminal, complete Microsoft sign-in, and return directly to the inbox; q exits without changing anything.

Reading channel history is intentionally separate because ChannelMessage.Read.All requires administrator consent. Request it only when needed:

teams auth login --channel-history

The CLI surfaces missing consent as a stable permission_denied error instead of silently reaching for undocumented Teams APIs. Tenant policy can still require an administrator to approve otherwise user-consentable permissions.

Headless setup is explicit and never prompts:

teams init --no-login
teams auth login --device-code
teams whoami --output json

Organizations that prefer their own Entra registration can override the bundled application:

teams init --client-id "$TEAMS_CLIENT_ID" --tenant organizations --no-login

The custom app must be a public client with http://localhost registered for browser login, public-client flows enabled for device-code login, and the baseline delegated permissions listed above.

For short-lived automation, TEAMS_ACCESS_TOKEN overrides the stored credential. Refresh credentials are never written to the config file.

Everyday commands

teams list
teams channels list TEAM_ID
teams chats list --limit 25
teams messages list --chat CHAT_ID
teams auth login --channel-history  # once, with administrator approval
teams messages list --team TEAM_ID --channel CHANNEL_ID
teams messages send --chat CHAT_ID --body "On it."
printf 'Status update' | teams messages send --chat CHAT_ID --body -
teams config show
teams doctor

Collection commands expose --limit and --fields; Graph-native collections use --cursor, while joined teams and channels use --offset because those endpoints do not accept $top. With a terminal they render concise text; when stdout is piped they emit JSON envelopes with continuation metadata and truncated.

Profiles can block every remote write while keeping reads, sign-in, diagnostics, and the TUI available:

teams init --no-login --read-only
# or for one invocation/environment
TEAMS_READ_ONLY=true teams messages send --chat CHAT_ID --body "Blocked"

Like the other tools in the suite, the config file is selected with --profile, overridden by TEAMS_* environment variables, and inspectable without exposing credentials through teams config show and teams config path.

Boundaries

  • Microsoft 365 work or school accounts only. The relevant Teams Graph endpoints do not support personal Microsoft accounts.
  • A work account can authenticate successfully before Microsoft Teams is licensed or provisioned; teams doctor distinguishes identity access from Teams availability.
  • Calling and screen sharing are not available as a delegated user CLI; Graph calling is built around bot/application scenarios.
  • No extracted desktop tokens, browser interception, or private Teams protocols.
  • Tenant policy and admin consent can restrict delegated capabilities.

CLI Spec

teams schema is offline, unauthenticated, and follows CLI Spec v0.3: flat invocable command paths, declared effects and cardinality, bounded collections, stable error kinds and exit codes, stdout/stderr separation, and safe noninteractive behavior.

Releasing

Vership owns versioning, changelog generation, release commits, and tags. See the release runbook for the verified workflow and recovery policy.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teams_cli-0.1.5.tar.gz (63.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

teams_cli-0.1.5-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

teams_cli-0.1.5-py3-none-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

teams_cli-0.1.5-py3-none-manylinux_2_28_aarch64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

teams_cli-0.1.5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.8 MB view details)

Uploaded Python 3macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file teams_cli-0.1.5.tar.gz.

File metadata

  • Download URL: teams_cli-0.1.5.tar.gz
  • Upload date:
  • Size: 63.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for teams_cli-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b74d5edb4a94e5268fdbbc9d52ddabc38e993d1500848142785d2cd8f72da723
MD5 7790dc1f1b8a6ce30f390df0a425b481
BLAKE2b-256 7cbad0c9a5c26247d560d9b938fbb023f6baec22be9b86312b400f9ff8b5e7be

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.5.tar.gz:

Publisher: release.yml on rvben/teams-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teams_cli-0.1.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: teams_cli-0.1.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for teams_cli-0.1.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 20aeebc38e4b52e611e6405959d95e4e55dd7d53d9e1243cb22dcc7d62d084f4
MD5 78d28a65ef15064b8377a775be8c3d6a
BLAKE2b-256 51a1bb4f897e48e97dbe709bb41b7a4e966294767d44d07e335ccf7fd268e398

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.5-py3-none-win_amd64.whl:

Publisher: release.yml on rvben/teams-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teams_cli-0.1.5-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for teams_cli-0.1.5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a5d8fa3d85e398305a6628d7badbe9dda045260ae54282e56a6c2975de3a12a
MD5 c30a7c60e1daa4c4342878eb9da9a5b8
BLAKE2b-256 90725aa0d8b81678a00eddf98337103baecd2c2191c77ef1328ed4beb683cdd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.5-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on rvben/teams-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teams_cli-0.1.5-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for teams_cli-0.1.5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 50b1b60862ec0c3f1868f10db5a015474ec667439435780a825d576648194a24
MD5 6b69ad3906a39d1b8011d6a02cd5546e
BLAKE2b-256 5af697fc48fac0bc513264754bdd5de95ebe0febb42c3c1436237b45b462dfce

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.5-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on rvben/teams-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file teams_cli-0.1.5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for teams_cli-0.1.5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 210a17bb120bf06fc112e89c8fe1d3564488fb5e5272ec0566820c7ae5fff86a
MD5 15ad6c8b5d87459877c5ecdb407cb403
BLAKE2b-256 95eb03f69c34d8a47964eb9fd464f94dd1b67c6d4a033f06e045fef6c64e1dd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on rvben/teams-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.5 This release

5 files

0.1.4

5 files

0.1.3

5 files

0.1.2

5 files

0.1.1

5 files

0.1.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page