Skip to main content

Terminal iMessage client for macOS

Project description

tmsg

tmsg is a terminal client for iMessage on macOS.

Package name: terminal-messenger
Command name: tmsg

Features

  • Sends messages through Messages.app using AppleScript.
  • Reads recent messages from the local Messages database.
  • Lets you pick recent conversations from the terminal.
  • Loads recent message history when you open a chat.
  • Resolves many phone numbers and emails to contact names from macOS Contacts.
  • Supports arrow-key navigation and live search.
  • Shows unread chats in the picker.

Requirements

  • macOS
  • iMessage set up in Messages.app
  • Python 3.8+

Install

Recommended:

pipx install terminal-messenger

If you do not use pipx:

python3 -m pip install terminal-messenger

First-time macOS permissions

tmsg needs macOS permissions to work:

  • Automation so it can send through Messages.app
  • Full Disk Access so it can read ~/Library/Messages/chat.db

The first send should trigger the Automation prompt automatically.

If reading or sending fails, check:

  • System Settings > Privacy & Security > Automation
  • System Settings > Privacy & Security > Full Disk Access

You may need to grant access to both your terminal app and the Python binary it uses.

Quick start

tmsg

That opens the conversation picker.

Common commands

Open the chat picker:

tmsg

Open a specific conversation:

tmsg frida

Open a specific phone number or email:

tmsg --contact "+15555555555"

List recent conversations without opening one:

tmsg --list-chats

Show more history when opening a chat:

tmsg --history-limit 200

While using it

In the picker:

  • Type to search
  • Up / Down to move
  • Enter to open
  • Esc or q to cancel

In a chat:

  • /help
  • /history
  • /list
  • /quit

Troubleshooting

  • Operation not permitted usually means Full Disk Access is missing
  • send failures usually mean Automation permission was denied
  • if tmsg is not found after install, reopen your terminal or refresh your shell shims
  • macOS Messages internals are undocumented, so some reactions and rich content may still be imperfect

Development

git clone <your-repo-url>
cd terminal-messenger
python3 -m pip install -e .
python3 -m unittest discover -s tests

You can also run it directly during development:

python3 -m tmsg

Releasing

Publish a new version to PyPI:

yarn deploy 0.1.1

That command:

  • updates the version in pyproject.toml
  • rebuilds the package
  • checks the built files
  • uploads them to PyPI

If you want non-interactive upload, either set PYPI_TOKEN in your shell or create a local .env file:

export PYPI_TOKEN=pypi-...
yarn deploy 0.1.1

or:

cp .env.example .env

Then edit .env and set:

PYPI_TOKEN=pypi-...

Project details


Download files

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

Source Distribution

terminal_messenger-0.1.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

terminal_messenger-0.1.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file terminal_messenger-0.1.1.tar.gz.

File metadata

  • Download URL: terminal_messenger-0.1.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.12

File hashes

Hashes for terminal_messenger-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cd44b011ac1528b3007d55267277a214fae0dad3fcf7a45c14d3ee57081452aa
MD5 4c3a8c89b8afb93cf3b153b8275deee8
BLAKE2b-256 b23eaa6db103575122f7c44ffd80be36cb4eec0d6f38ed98bc9f3cdaf7af2d9d

See more details on using hashes here.

File details

Details for the file terminal_messenger-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for terminal_messenger-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c25b39dce5e12f1e1f963a97f5aa6274b0038e7b0bd99918d35345ab5e5d040
MD5 1a265672cecb8a55abc117afd1fe5d7e
BLAKE2b-256 cfb63080a5a5a04b934611cabad74aef54efe96bff54fe956d8cbd40d05cf9c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page