Metadata-Version: 2.4
Name: message-cli
Version: 0.1.0
Summary: A Linux-style terminal client for Instagram direct messages
Keywords: instagram,direct-message,dm,cli,terminal
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: instagrapi>=2.1.3
Requires-Dist: typer>=0.12

# message-cli

`message-cli` is an interactive, Linux-style terminal client for Instagram
direct messages. It keeps room and message caches locally so moving between
conversations stays responsive.

> [!WARNING]
> This project uses the unofficial `instagrapi` private API and is not affiliated
> with or endorsed by Instagram or Meta. Instagram can require a checkpoint,
> restrict a session, or change the underlying API at any time. Use it only with
> an account you own, avoid repeated login attempts, and complete verification in
> the official Instagram app or website when requested.

## Installation

Python 3.10 or newer is required.

```console
pip install message-cli
```

Start a session with your Instagram username. The password prompt is hidden.

```console
mcli login -u your_instagram_username
```

Session settings and command history are stored under `.message_cli` in the
directory where the program runs. Do not share these files.

## Interactive commands

| Command | Description |
| --- | --- |
| `ls [room_count]` | List DM rooms (20 by default). |
| `ls -u` | List followed accounts available to group-room creation. |
| `cd <room> [-n <count>]` | Open a room by list index or exact title. |
| `cd ..` | Return to the room list. |
| `tail -n <count> <room>` | Show recent messages from a room index. |
| `echo "message" [-n <count>]` | Send a message in the open room. |
| `grep "text" -n <count> -r <room>` | Search up to 50 recent messages. |
| `find "room title"` | Find matching DM rooms. |
| `find -u "username"` | Find matching followed accounts. |
| `mkdir -u <user indexes> -n "title"` | Create a group DM. |
| `history` | Show saved interactive commands. |
| `man [command]` | Show command help. |
| `exit` | End the program. |

While a room is open, incoming messages are polled and displayed automatically.
Media and call events are represented by labels such as `<Image>`, `<Video>`,
and `<Call>`.

## Account verification

If Instagram requests additional verification, the client stops making requests.
Open Instagram on a trusted device, complete the checkpoint, keep the same
network and saved session data when possible, and then retry. Repeated login
attempts from the CLI cannot clear a checkpoint and may make the restriction last
longer.

## Development

```console
python -m pip install -e .
python -m unittest discover -s tests -v
```
