whatsapp-cli AGENTS.md

Project instructions for whatsapp-cli, a command-line program that lets you access WhatsApp from a terminal. It supports machine-readable formats such as JSON, CSV, and TSV as well as human-readable tables.

In plain words
What is it for?
Developing commands for chats, messages, search, contacts, media, database access, formatting, testing, and release checks.
Why use it?
They show coding agents how the application is organized, built, tested, and connected to its local database and WhatsApp client.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/eddmann/whatsapp-cli/agents-md
Clone the repo
git clone --depth 1 https://github.com/eddmann/whatsapp-cli

Made for: Codex, OpenCode.

Per session 468 This file is loaded in full into every session.
When invoked 468 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00468 $0.00468
Opus 5 $0.00234 $0.00234
Sonnet 5 $0.00094 $0.00094
Haiku 4.5 $0.00047 $0.00047

Measured yesterday against content hash 6c6c68d96dce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

whatsapp-cli AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

This file provides guidance to AI coding agents when working with code in this repository.

Project Overview

whatsapp-cli provides WhatsApp access from your terminal. Machine-readable output (JSON, JSONL, CSV, TSV, human tables).

Development Commands

make build                          # Build binary (requires CGO)
make run CMD="chats --limit 5"      # Run CLI command
make test                           # Run all tests
make lint                           # Check linting
make fmt                            # Format code
make can-release                    # Full CI (lint + test)

Architecture

cmd/whatsapp/main.go                # Entry point

internal/
├── cli/                            # Cobra commands, config, output, temporal parsing
├── store/                          # SQLite + FTS5 database, models (Chat, Message, Contact)
└── whatsapp/                       # WhatsApp client (connection, sync, messaging, media)

Requires Go 1.25+, CGO enabled, SQLite with FTS5. FFmpeg optional for audio.

Key Pattern

Commands use shared helpers for database and client setup:

// Database-only (chats, messages, search)
func runChats(cmd *cobra.Command, args []string) error {
    return WithDB(func(db *store.DB) error {
        chats, err := db.ListChats(store.ListChatsOptions{...})
        if err != nil {
            return err
        }
        return Output(chats)  // Auto-serialized based on --format
    })
}

// With WhatsApp connection (send, sync)
func runSend(cmd *cobra.Command, args []string) error {
    return WithConnection(func(db *store.DB, client *whatsapp.Client) error {
        result, err := client.SendTextMessage(jid, message)
        if err != nil {
            return err
        }
        return Output(result)
    })
}

Testing

Tests use go test -tags sqlite_fts5. Manual testing: ./dist/whatsapp doctor and ./dist/whatsapp auth status.

Data Units

All timestamps ISO8601 UTC. JIDs: [email protected] (individual), [email protected] (group).

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 68 lines · 468 tokens per session scan A 6c6c68d96dce

Subscribe to this mod's changes

whatsapp-cli AGENTS.md is an instructions file published in the GitHub repository eddmann/whatsapp-cli (23 stars, last pushed 3mo ago), licensed MIT. It adds 468 tokens to every session, about $0.0023 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.