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

Uploaded Python 3Windows x86-64

teams_cli-0.1.3-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.3-py3-none-manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

teams_cli-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: teams_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 61.0 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.3.tar.gz
Algorithm Hash digest
SHA256 ed3b0fd58e2b0e9b44dfc20c1f6adcd41f3987862e4f09297aff1e82eeedb106
MD5 e2aaf79c108a74b0b3f4df020fb4918c
BLAKE2b-256 9356229bfa2fbc4b605f31105b49ce040f4046b0faf02cd852cb129f972ab055

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: teams_cli-0.1.3-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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4a830eac89b70885603fb1fb3678f59682fd33da4c6543b330965c8db6fdba62
MD5 75e2370b0dece0d8cca1c8eed7a42b49
BLAKE2b-256 6776e638b4ade43000739352ae70d5d77b9ecdb1e0283f9c6afb0c75242e03db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for teams_cli-0.1.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 df844998465844461e4674e50e2538051b87f7255b464322cee9b74d4b338243
MD5 77b6a81d20b0917c8867a84f6e9b8a57
BLAKE2b-256 36cf82ad190984d5e28231b0f76bf48df3c1db41d906f1cd0597cd719354035f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for teams_cli-0.1.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 71a6631899515264bd3a1f0fee17a68570e2c315e4ddaef5822928d3305222d7
MD5 bf146ecd5738ab150faf477d776442e0
BLAKE2b-256 ed8ba27d1dcc52d6a6f8cb93669ed5feaf7295dcfc4c1e778988fc509c4123a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for teams_cli-0.1.3-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.3-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.3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 5c6466b5da6185a33be07034c6229796f72b7e4be56f8c4ce6e79b09472b9abd
MD5 9b194f0608dc61a921e145a0f5d0b4aa
BLAKE2b-256 fe88e158a27913a8f97cd6f1ec58e1862dbb60e06f5ccfb32123e9d6d9095e23

See more details on using hashes here.

Provenance

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

This release

0.1.3 This release

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