1.8 KiB
1.8 KiB
Repository Guidelines
Project Structure & Module Organization
Sources/imsgholds the CLI entrypoint and command wiring.Sources/IMsgCorecontains SQLite access, watchers, AppleScript send logic, and helpers.bin/is created bymake buildfor local artifacts.
Build, Test, and Development Commands
make imsg— clean rebuild + run debug CLI (useARGS=...).make build— universal release build intobin/.make lint— runswift formatlint +swiftlint.make test— runswift testafter syncing version + patching deps.
Coding Style & Naming Conventions
- Swift 6 module; prefer concrete types, early returns, and minimal globals.
- Formatting is enforced by
swift formatandswiftlint. - CLI flags use long-form, kebab-case (
--chat-id,--attachments).
Testing Guidelines
- Unit tests live in
Tests/as*Tests.swift. - Prefer deterministic fixtures over touching the live Messages DB.
- Add regression tests for fixes touching parsing, filtering, or attachment metadata.
Commit & Pull Request Guidelines
- Follow the existing short, lowercase prefixes seen in history (
ci:,chore:,fix:,feat:) with an imperative summary (e.g.,fix: handle missing attachments). - PRs should include: brief description, steps to repro/verify, and outputs of
make lintandmake test. For CLI changes, include sample commands and before/after snippets. - Keep changeset focused; avoid drive-by refactors unless they reduce risk or remove duplication in touched areas.
Security & macOS Permissions
- The tool needs read-only access to
~/Library/Messages/chat.db; ensure the terminal has Full Disk Access before running tests that touch the DB. - Sending requires Automation permission for Messages.app and SMS relay configured in macOS/iOS; document any manual steps needed for reviewers.