chatkeeper

module
v0.1.0-rc.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: MIT

README

ChatKeeper

Keep chat threads that matter. Mark a thread with a reaction and ChatKeeper saves its messages and attachments in a verified, portable archive. Search in your browser or give an agent read-only access through REST or MCP.

One static Go binary runs on your desktop or server. Slack capture is available; Discord and Telegram are planned. Capture never deletes source messages. MIT licensed.

Desktop setup Archived thread viewer

Install

Homebrew (macOS and Linux)
brew install bitskyai/tap/chatkeeper            # CLI + local server (formula)
brew install --cask bitskyai/tap/chatkeeper-app # macOS menu-bar app (bundles the server)

Run chatkeeper to open the local setup wizard, or keep it running in the background with brew services start chatkeeper and run chatkeeper again to open the browser UI of the running instance. Install one or the other for day-to-day use: both share the same data folder and instance lock, so the app attaches to a running brew services server rather than starting a second one. Upgrade with brew upgrade chatkeeper / brew upgrade --cask chatkeeper-app. The tap is bitskyai/homebrew-tap and receives stable releases only; prereleases are download-only.

Direct download

Download the archive for your OS and CPU from GitHub Releases, extract it and run the binary. Your browser opens the local setup wizard: connect Slack, review your rule, then test it.

OS Archive Run
macOS, Apple silicon chatkeeper_VERSION_darwin_arm64.tar.gz ./chatkeeper
macOS, Intel chatkeeper_VERSION_darwin_amd64.tar.gz ./chatkeeper
Linux x86-64 / arm64 chatkeeper_VERSION_linux_amd64.tar.gz / _linux_arm64 ./chatkeeper
Windows x86-64 / arm64 chatkeeper_VERSION_windows_amd64.zip / _windows_arm64 .\chatkeeper.exe

Use ./chatkeeper --no-browser to print the launch URL. The desktop listener is loopback-only. macOS binaries are not notarized and Windows binaries are not Authenticode signed yet. After verifying the download, use your OS's explicit approval flow for an unsigned app. On macOS, if necessary: xattr -d com.apple.quarantine ./chatkeeper.

macOS menu-bar app

ChatKeeper-VERSION.dmg on each release (or the chatkeeper-app cask above) is a universal (Apple silicon + Intel) menu-bar app for macOS 13+. It runs the bundled server in the background and shows its status (running, capturing, paused, needs attention). From the menu you can open ChatKeeper in the browser, jump to the five most recent archives, pause or resume capture, start at login, and check for updates. It shares the CLI's data folder and instance lock, so if chatkeeper or brew services is already running the app attaches to it.

v0.1 is not signed with an Apple Developer ID. After dragging it to Applications, right-click (Control-click) ChatKeeper → Open → Open once. On macOS 15+, use System Settings → Privacy & Security → Open Anyway. Or run xattr -dr com.apple.quarantine /Applications/ChatKeeper.app. The Homebrew cask does this for you. Building and signing details: desktop/macos.

Before running a download, verify its checksum and GitHub provenance:

# Download SHA256SUMS with your archive; check the matching line:
sha256sum --ignore-missing --check SHA256SUMS   # macOS: shasum -a 256 -c SHA256SUMS
# GitHub CLI verifies the artifact against the repository's attestation:
gh attestation verify chatkeeper_VERSION_linux_amd64.tar.gz --repo bitskyai/chatkeeper

Releases include six archives, SHA256SUMS and per-archive Syft SBOMs. GitHub build attestations cover archives, SBOMs and checksums. The macOS app's ChatKeeper-VERSION.dmg and .zip are listed in their own ChatKeeper-VERSION.sha256 (not in SHA256SUMS) and are attested too:

shasum -a 256 -c ChatKeeper-VERSION.sha256
gh attestation verify ChatKeeper-VERSION.dmg --repo bitskyai/chatkeeper

The container image has BuildKit SBOM and provenance plus a GitHub attestation. Keyless cosign signing is optional and is not enabled; do not expect .sig files.

Server: Docker Compose or Helm

Server mode supports administrator sign-in and a read-only API bearer. Put network access behind a TLS reverse proxy and restrict inbound access.

cd deploy/compose
cp .env.example .env
# Edit .env: set a unique administrator password (12+ characters), image version,
# allowed hosts, and CHATKEEPER_SECURE_COOKIES=1 when using HTTPS.
docker compose up -d

Links back to a saved thread use the address ChatKeeper listens on. When people reach it somewhere else (a reverse proxy, a public host name), set that address in config.yaml:

server:
  public_url: https://keeper.example.com

Open http://localhost:8787/login. Compose binds loopback by default and persists configuration, secrets, indexes and archives in a named volume. Pin a released v* image tag for production. A configured admin password is reapplied at every restart; rotate the environment value when rotating that password. To use a one-time setup code instead, omit the password environment entry, read the code from container logs, and visit /bootstrap.

kubectl create secret generic chatkeeper --from-literal=admin-password='YOUR-LONG-RANDOM-PASSWORD'
helm upgrade --install chatkeeper deploy/helm/chatkeeper --set image.tag=vVERSION
kubectl port-forward service/chatkeeper 8787:8787

The chart deploys a single writer with Recreate updates, a PVC, ClusterIP service, non-root security context and /healthz startup/readiness/liveness probes. Set existingSecret, envFromSecrets (platform credentials), persistence.existingClaim, persistence.storageClass and resources as needed. It creates no Ingress or credential Secret. Use a TLS ingress/proxy and an explicit Host allowlist for remote access (for example --set allowedHosts=chatkeeper.example.com --set secureCookies=true; then use the HTTPS hostname instead of port forwarding). The app creates its private home at /data/chatkeeper on the PVC. /healthz reports process availability, not workspace capture health. Back up the volume before upgrades; keep only one writer per archive.

To build from source, use Go 1.26+: go build -trimpath -o chatkeeper ./cmd/chatkeeper. The Slack plugin vendors standard emoji short names and glyphs generated from iamcal/emoji-data (MIT, see internal/plugins/slack/emoji/LICENSE). The source commit and SHA-256 are pinned in tools/generate-emoji.py and internal/plugins/slack/emoji/NOTICE; the generator refuses an input whose hash differs. To build a container: docker build -t chatkeeper:local . (BuildKit required).

Slack app setup

The wizard guides these steps and checks credentials before saving a workspace. A coding agent can do the same from a terminal: see Set up with a coding agent (chatkeeper setup slack --print-manifest, --dry-run, then save; the wizard's first page has a copyable prompt).

  1. Connect Slack: create the app from the manifest, install it once, and paste the bot and user tokens. Each token is checked automatically. An app-level token is optional; add it later with Make it instant.
  2. Your rule: read the sentence explaining who can react, which channels are watched, where the whole thread is saved, and when it is deleted. All features start on: archive, thread file, 📥 notification, and deletion after one minute. Read the deletion consent before saving; turn Delete off here to keep threads in Slack.
  3. Try it: post a test thread or react with 🗄️ to an existing one, then finish. Public channel selections join the bot automatically; invite it to private channels.

Open Rules from Home to edit the sentence. More options lets you turn off thread files or notifications, change the reaction, people, channels and undo window. Remove the reaction during the window to keep a thread. In polling mode react on the first message; instant mode sees replies too. Existing workspaces keep their settings.

Polling also runs with Socket Mode and repairs missed events. Each poll rescans thread roots posted in the last 24 hours, because a reaction can land on an older root at any time; a full history scan runs hourly and on Check now. When Slack answers HTTP 429, its Retry-After is honored across polls and reconnects: reads pause until the cooldown ends instead of retrying early.

For managed YAML, copy examples/config.yaml and replace synthetic IDs and credential environment names. Storage paths resolve relative to that YAML. Server paths are confined to <app home>/data. Read-only managed YAML can be exported from the wizard and applied externally.

Workflow: archive, save, notify, delete

Rules controls archiving, thread files, notifications and deletion. New setup enables every feature, with a one-minute undo window. Turning Delete on never deletes threads already archived. Turning it off keeps new threads in Slack; thread files and notifications have their own switches under More options.

Settings > Advanced holds the export folder and Move archive. Moving pauses capture, copies and verifies every thread, switches configuration, and keeps the old folder.

Settings > Integrations holds Run workflow steps and instructions for Slack Workflow Builder (paid plans). Leave the switch off to use the built-in rule on every plan. Turn it off again to return to that rule. YAML remains supported; omitted workflow/delete keys retain their existing off defaults. See the design. The Workflow Builder Delete thread step deletes only while Delete is on in Rules: Integrations says which it is and links there, the switch asks for the same consent, and turning it on keeps your steps.

Search and agents

Browser search supports SQLite FTS5 phrases, prefixes, boolean operators and NEAR; literal CJK text uses substring matching. Prior edits and messages deleted at source remain searchable. The archive viewer shows those annotations.

Claude Code stdio MCP configuration (.mcp.json, use an absolute binary path):

{"mcpServers":{"chatkeeper":{"command":"/absolute/path/chatkeeper","args":["mcp","--config","/absolute/path/config.yaml"],"env":{"CHATKEEPER_HOME":"/absolute/path/app-home"}}}}

Codex MCP configuration (~/.codex/config.toml):

[mcp_servers.chatkeeper]
command = "/absolute/path/chatkeeper"
args = ["mcp", "--config", "/absolute/path/config.yaml"]
env = { CHATKEEPER_HOME = "/absolute/path/app-home" }

Tools: search_threads, get_thread, list_workspaces. Stdio reads local archives and emits JSON-RPC only on stdout. Stdio also offers read-only setup_status (credential presence only, never values) and validate_setup (re-runs the connection tests with stored credentials, redacted); with no config yet it starts with only those two tools; see agent setup. Use the same home as the running app to share its index. REST offers GET /api/search, GET /api/threads/{workspace}/{channel}/{ts} and GET /api/openapi.json. HTTP MCP is /mcp and always requires a configured read-only bearer: Authorization: Bearer <CHATKEEPER_API_TOKEN>. The bearer grants all configured workspaces, never administrator access. HTTP MCP uses stateless JSON responses.

Privacy and security

Your archive stays on your filesystem; there is no hosted ChatKeeper service. Source APIs receive normal capture requests. ChatKeeper stores messages, attachments and history in plaintext files; use disk encryption and protected backups. Agents with local filesystem or API access can read archived content.

Desktop credentials use the OS keychain when available, otherwise a private secrets.env file. Environment values take precedence. Server credentials use environment variables or that file. Secrets are not stored in workspace YAML. App home defaults to the OS configuration directory's chatkeeper folder; CHATKEEPER_HOME overrides it. Desktop archives default to ~/ChatKeeper/<workspace>. Browser sessions expire after 12 hours. Server setup uses a one-time code or CHATKEEPER_ADMIN_PASSWORD; set secure cookies when terminating HTTPS at a proxy. Forwarded headers are not trusted. Compiled plugins are trusted in-process code.

Archive files and SHA-256 manifests are authoritative. Search indexes are derived and rebuildable. Back up archives, YAML, application state and cleanup journals; store credential backups separately. On Windows, directory fsync is unavailable, so power-loss durability depends on filesystem behavior. Read the security policy for private vulnerability reporting.

Commands and development

chatkeeper --help lists commands and flags. Common maintenance:

chatkeeper check-config --offline --config config.yaml
chatkeeper setup slack --help   # non-interactive setup, JSON result
chatkeeper backfill --config config.yaml
chatkeeper verify --config config.yaml
chatkeeper version

verify checks snapshots without source calls and fails on corruption. It may create locks or recover an interrupted rename; use a copy for migration rehearsals. run reloads valid YAML and credential changes; listener changes need a restart. Workspace removal keeps archives. See CONTRIBUTING, architecture, porting details, launch checklist and MIT license.

Opt-in source cleanup

The browser's new rule enables deletion after one minute, with consent. Use Rules > Delete to turn it off. The chatkeeper cleanup CLI and YAML policies remain available independently; omitted YAML cleanup settings still mean off.

Deletion verifies the durable archive, live identity, owner reaction and unchanged content. Bot credentials can delete only the bot's messages; deleting other people's posts needs an admin/owner user credential and allow_others: true. The manifest includes both token scopes in one install. Credentials stay in the secret store.

Advanced YAML policies remain visible under Rules > More options. Use recommended settings asks for consent before replacing them. Example of an explicitly configured older policy:

cleanup:
  enabled: true
  token_env: CHATKEEPER_CLEANUP_TOKEN
  min_age_hours: 24
  # Zero requires an explicit allow_zero_age: true opt-in.
  allow_others: false
  own_only: true
  scope: thread  # or messages: each target needs its own approval
  approval:
    who: owner
    owners: [UOWNER]  # use your workspace member ID
    reactions: [wastebasket]
    match: any
  every_hours: 0  # automatic apply OFF; set >= 1 to opt in

Legacy YAML without cleanup.approval retains its archive-trigger approval behavior. Existing policies are preserved until you change them.

Set the referenced secret in the environment or credential store. Preview is offline and needs no credential:

chatkeeper cleanup --workspace example
chatkeeper cleanup --workspace example --apply

Existing YAML every_hours schedules still run with the same safety checks. Turning Delete off in Rules stops a schedule, and Use recommended settings removes it; enabling a schedule requires editing YAML. What each scheduled run did shows in Recent on the dashboard and Rules (Deleted ✓ (3 messages) · by schedule, kept or not deleted with the reason); a run that fails raises a dashboard problem with one fix, and Logs > Scheduled deletes lists every run with its reasons. The old Cleanup page and settings URLs redirect to Rules. CLI preview remains offline; use --apply explicitly for live deletion.

Keep the cleanup/ journals with your archive. Deletion timestamps are stored there as source_deleted_at metadata so original snapshot bytes and hashes stay unchanged until refresh folds confirmed markers into the next snapshot. Refresh/backfill never shrink an archive and archive new replies after cleanup. The viewer and dashboard show cleaned, partial, stale or unknown/pending status. A stale journal is reconciled against the folded markers on the next cleanup. Folder storage on systems with durable directory sync is supported; Windows apply and unsupported storage types fail closed.

The Helm cleanup CronJob has separate cleanup.enabled, cleanup.workspace and cleanup.apply opt-ins; its default execution is a dry-run. Warning: cleanup.apply: true schedules destructive source deletion without the web confirmation step. Enable it only after reviewing a dry-run and the workspace age, owner and credential policies. The real Slack gates verify deletion, viewer markers, tamper refusal, refresh/backfill retention and new reply capture after partial cleanup.

Persistent diagnostics: see logging and platform paths. Slack compatibility fixtures, fuzzing, live results and remaining coverage gaps are documented in the corpus audit.

Usability acceptance harness

With Go from go.mod and Chrome/Chromium installed, run the real first-time UI against a fresh temporary CHATKEEPER_HOME:

go run ./tools/acceptance/usability -fake -out /tmp/chatkeeper-acceptance

The synthetic mode uses the existing slacktest API. It writes report.md, report.json, and masked PNG screenshots for every step, recording wall seconds, clicks, token pastes, typed characters, screens and guesses for T1–T9. It checks visible copy outside Logs and the permission card. Missing three-screen wizard/Rules UI reports NOT YET IMPLEMENTED, never a pass. Observed failures exit 1; -strict also rejects incomplete acceptance. CI is advisory while PRs 3–5 land. Actions → Release → Run workflow runs the strict synthetic gate and uploads its evidence, without publishing a release.

For live verification, use a disposable workspace/channel, an admin installer A, regular member B, and a separate observer with permission to read the channel. Export credentials in your shell without putting their values in commands, files committed to Git, or reports:

# Required environment: CK_BOT_TOKEN, CK_USER_TOKEN, CK_SECOND_USER_TOKEN,
# CK_INDEPENDENT_TOKEN, CK_CHANNEL. Optional: CK_APP_TOKEN and CK_SECOND_CHANNEL.
go run ./tools/acceptance/usability -live -strict -out /tmp/chatkeeper-live

Set CK_SECOND_CHANNEL to the ID of an unjoined disposable public channel to exercise T5. The proxy permits joining it only; all other mutations are restricted to CK_CHANNEL. The harness removes posted fixtures at the end and reports any leftovers.

The two user test credentials need chat:write and reactions:write for fixture messages/reactions; the independent reader needs channel history and reactions:read. These are test-fixture capabilities beyond the normal install.

Live mode posts uniquely named four-message test threads and lets the real app delete them. The observer token must differ from all writer tokens; its paginated conversations.replies and conversations.history reads verify each timestamp. Archive checks use ChatKeeper's integrity-verifying storage read, then open the saved copy in the UI. Reaction removal, non-owner reactions, pre-install reactions, polling, process kill/restart, save-only and non-admin scenarios are reported separately. T7 injects revoked-token and lost-membership API responses, then follows the dashboard repair action; it does not revoke your credentials. Allow up to 40 minutes for real polling/undo windows; no window is shortened. Inputs and token-shaped text are masked before screenshots; app logs and API response bodies are never printed. The temporary home and credentials are removed after the run. Artifacts can contain test message text and workspace names; treat live output as private.

Directories

Path Synopsis
cmd
chatkeeper command
Command chatkeeper runs read-only capture and archive verification.
Command chatkeeper runs read-only capture and archive verification.
internal
app
Package app owns the serialised running workspace set and config reload boundary.
Package app owns the serialised running workspace set and config reload boundary.
cleanup
Package cleanup implements explicit archive-then-delete; the capture runtime never imports it.
Package cleanup implements explicit archive-then-delete; the capture runtime never imports it.
config
Package config loads strict YAML with neutral keys and registered plugin schemas.
Package config loads strict YAML with neutral keys and registered plugin schemas.
core
Package core coordinates platform-neutral capture.
Package core coordinates platform-neutral capture.
export
Package export turns one archived thread into documents other tools can store: a schema-versioned JSON document, Markdown and plain text.
Package export turns one archived thread into documents other tools can store: a schema-versioned JSON document, Markdown and plain text.
logging
Package logging provides bounded persistent diagnostics shared by CLI and UI.
Package logging provides bounded persistent diagnostics shared by CLI and UI.
mcp
Package mcp exposes the archive service as read-only MCP tools.
Package mcp exposes the archive service as read-only MCP tools.
plugins/all
Package all contains build-selected built-in registrations.
Package all contains build-selected built-in registrations.
plugins/slack
Package slack owns all source-specific validation and transport behavior.
Package slack owns all source-specific validation and transport behavior.
plugins/slack/slacktest
Package slacktest is a synthetic HTTP Web API and Socket Mode test server.
Package slacktest is a synthetic HTTP Web API and Socket Mode test server.
search
Package search provides read-only queries over a derived archive index.
Package search provides read-only queries over a derived archive index.
secrets
Package secrets resolves write-only credentials without placing values in YAML.
Package secrets resolves write-only credentials without placing values in YAML.
storage
Package storage implements the versioned source-of-truth folder archive.
Package storage implements the versioned source-of-truth folder archive.
web
Package web renders read-only pages from verified archives.
Package web renders read-only pages from verified archives.
pkg
pluginapi
Package pluginapi is the versioned, platform-neutral contract for built-in plugins.
Package pluginapi is the versioned, platform-neutral contract for built-in plugins.
pluginapi/plugintest
Package plugintest checks contract-v1 manifests, schemas and lifecycle behavior.
Package plugintest checks contract-v1 manifests, schemas and lifecycle behavior.
tools
acceptance/usability command
Command usability runs the simple-setup acceptance script against a fresh app.
Command usability runs the simple-setup acceptance script against a fresh app.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL