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

The PyPI distribution is named teams-cli; the executable is teams, matching the jira-clijira and confluence-cliconfluence family.

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 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.

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.

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.2.tar.gz (57.4 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.2-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

teams_cli-0.1.2-py3-none-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

teams_cli-0.1.2-py3-none-manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

teams_cli-0.1.2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (6.4 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.2.tar.gz.

File metadata

  • Download URL: teams_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 57.4 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.2.tar.gz
Algorithm Hash digest
SHA256 0e9b3b5bb012161a883e655aeca83cd6556d7a31050639093b71923c46030e70
MD5 71ac4b89180aa8f19b2a5cc55243ef57
BLAKE2b-256 2cc694257c3b8437e92bd061ebcf6209cfc68b5fbca3592891f53268f9f5cd29

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: teams_cli-0.1.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.0 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.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 65cac66ce001684fec65bc2574afb34cd9162f4c18685ea4468b1c5851811235
MD5 60454cd5182ac8115deca4c09862274b
BLAKE2b-256 b3972235043d7f2ab6c75977d0605b56c4c2b9376e6fb40bf1ca653110eb187b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for teams_cli-0.1.2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 efbf1c4cdc1293c8549c172902a3faf7bb5a47f10f81c031d6972f57bcc97754
MD5 72ad5f47240d895f1fd8b3e631f191c5
BLAKE2b-256 0c75c4511eedd9263a259cfaf1f7045c52a92e8ada4232907c8e4b56762f00a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for teams_cli-0.1.2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e4ad883c43946cf21b1ef6f3b83027d35fda3a77faf7da5fc14b76cb450c5a35
MD5 e4981aa74665699cd576f5d97b4cf6f1
BLAKE2b-256 802a04778363e8785b2ebf3456cef51201cd3946876ecf4375a7fd4026bbf99c

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.2-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.2-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.2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 bbd4797cadce15436ba53c61fd53079a7c2a1e87eda0fd74df05857ae531fddf
MD5 565248321ffb1782a412d3794190e087
BLAKE2b-256 04dc09c64137d35c693e4e27f33df765db2634820071b5d91c55de22a09e767e

See more details on using hashes here.

Provenance

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

0.1.4

5 files

0.1.3

5 files

This release

0.1.2 This release

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