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

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.4.tar.gz (61.6 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.4-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

teams_cli-0.1.4-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.4-py3-none-manylinux_2_28_aarch64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

teams_cli-0.1.4-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.4.tar.gz.

File metadata

  • Download URL: teams_cli-0.1.4.tar.gz
  • Upload date:
  • Size: 61.6 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.4.tar.gz
Algorithm Hash digest
SHA256 e91baad3467ddfe49d911422f5ee8064f2b1891350ccbe4a51404d4848897aed
MD5 cbb27dd2601984a88db3445fbf678308
BLAKE2b-256 d2c05ed02d7b58ed5ee25d80fc9d1665daa580e8b38aff24866fdb663a4c5aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.4.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.4-py3-none-win_amd64.whl.

File metadata

  • Download URL: teams_cli-0.1.4-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.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d846acd66283b9bbdc1992731d50adb32abced786d53ec8800972fd7c2bab120
MD5 8c0d8642485843be41b394e18323da05
BLAKE2b-256 f903b13188f72b1d3f1af9c333b75fa02039febc32e3ea63df6fc246bafef8a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.4-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.4-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for teams_cli-0.1.4-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2e9f740411d65da0c37f3710287cba39026cf53f1042269d81a793e2f6b70f9d
MD5 7a971ad8772e6435f2e424fea9feca5e
BLAKE2b-256 ea3ee6904b99bc57523109adf1a8cd166e8224221215934a447d8e5738bd0e62

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.4-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.4-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for teams_cli-0.1.4-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6b8fe815600ec97de82c71cb7ec2e1f8426d7bdbdef307627acf83ddce3584f4
MD5 a82aa2b7366e400c1d10872d2d33b204
BLAKE2b-256 653640b01afe740f6c74486cfabb7bad4c13d1c2307f8888522c3428d40a9298

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.4-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.4-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.4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 66fcf1b6df64e7525f5247a033a922e2cb30baf5dd6ba0070297657182a8a87c
MD5 927e957b60fb65ea0687539df24533b2
BLAKE2b-256 cbd52a4b8dede0adef3cea0a7b391eae17ec2240de9ae97445360b6fca04c078

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.4-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

0.1.5

5 files

This release

0.1.4 This release

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