Mindcap is an extensible Python CLI for capturing source material, preserving a verified archive, and preparing canonical inputs for knowledge extraction and the Ego Hygiene Mind Garden.
Mindcap currently ships ChatGPT, Suno, and DistroKid source plugins. The architecture is designed for future webpage, PDF, image, repository, document, and media plugins.
Warning
The private ChatGPT browser strategy is experimental. ChatGPT does not expose a documented public API for retrieving one private conversation by URL. Mindcap observes the network traffic produced by an authenticated browser and isolates that behavior behind a replaceable capture strategy.
mindcapTyper CLI- Plugin registry and strategy protocols
- ChatGPT URL and identifier parsing
- Working saved-JSON import strategy
- Experimental Playwright browser strategy
- Dedicated persistent ChatGPT browser profile outside the repository
- Provider-independent capture envelope
- ChatGPT message-tree normalization
- Selected-path Markdown rendering with alternate-response appendix
- Immutable version directories and canonical content hashes
- Manifest, raw index, report, latest pointer, and version history
- Offline fixtures and tests
Knowledge extraction, synapse derivation, attachments, complete redaction, Gardenization, and Google Drive upload are deliberately outside this bootstrap.
Unzip this directory into the Ego Hygiene repository:
~/src/egohygiene/egohygiene/tools/mindcap/
From the Mindcap directory:
cd "$HOME/src/egohygiene/egohygiene/tools/mindcap"
uv sync
uv run playwright install chromiumOr if you have Task installed:
cd "$HOME/src/egohygiene/egohygiene/tools/mindcap"
task setupRun the offline test suite:
uv run pytest
uv run ruff check .Or with Task:
task checkMindcap defaults to the Ego Hygiene repository root at:
.cache/mindcap/
Before capturing private data, verify that the root .cache/ directory is
ignored:
cd "$HOME/src/egohygiene/egohygiene"
mkdir -p ".cache/mindcap"
git check-ignore ".cache/mindcap"The final command must print .cache/mindcap. If it prints nothing, add this to
the repository root .gitignore before continuing:
.cache/From tools/mindcap/:
uv run mindcap --help
uv run mindcap --version
uv run mindcap plugins list
uv run mindcap pathsMindcap includes an experimental Suno workspace archive flow with a provider
default api capture strategy.
Store a Clerk __client cookie safely from standard input:
printf '%s' "${SUNO_CLERK_COOKIE}" | \
uv run mindcap auth suno --cookie-stdinInspect safe Suno diagnostics:
uv run mindcap doctor sunoCapture a workspace archive using a placeholder workspace UUID:
uv run mindcap capture suno "00000000-0000-0000-0000-000000000000"Authenticate using a dedicated DistroKid browser profile:
uv run mindcap auth distrokid
uv run mindcap doctor distrokidCapture an authenticated release library:
uv run mindcap capture distrokid "https://distrokid.com/mymusic/"Capture one release by album URL or bare UUID:
uv run mindcap capture distrokid \
"https://distrokid.com/dashboard/album/?albumuuid=642BAA93-568F-47A7-99558E4426A9D1D0"
uv run mindcap capture distrokid "642BAA93-568F-47A7-99558E4426A9D1D0"Import the included fixture without accessing ChatGPT:
uv run mindcap import chatgpt \
"tests/fixtures/chatgpt/branching-conversation.json"Mindcap prints the finalized bundle path. Verify it with:
uv run mindcap verify "<bundle-path>"Open the generated transcript:
<bundle-path>/normalized/conversation.md
Mindcap previously attempted authentication inside Playwright's bundled Chrome for Testing browser. Google rejects OAuth from that browser with:
Couldn't sign you in β This browser or app may not be secure.
This message does not indicate a problem with your Google account. It is Google's security policy rejecting a browser that does not meet its trust requirements. Do not repeatedly retry the rejected flow. Do not disable account security, MFA, browser protections, or Google security settings to work around this message.
Mindcap has two separate modes:
- Authentication mode (
mindcap auth chatgpt) launches ordinary stable Google Chrome directly and requires manual login. - Capture mode (
mindcap capture chatgpt ... --strategy browser) launches stable Chrome as an external process, enables loopback-only CDP, and lets Playwright connect to that process. Playwright does not launch the profile.
Google OAuth must only happen in authentication mode. Google may reject OAuth inside controlled/automated contexts, so Mindcap never automates OAuth, MFA, or account verification.
The dedicated profile is stored outside the repository at a path like:
| Platform | Default path |
|---|---|
| macOS | ~/Library/Application Support/Ego Hygiene/mindcap/browser/chatgpt |
| Linux | ~/.local/share/mindcap/browser/chatgpt (or $XDG_DATA_HOME) |
| Windows | %APPDATA%\Ego Hygiene\mindcap\browser\chatgpt |
Run uv run mindcap paths (or task paths) to display the exact location on
your system.
Important
The dedicated profile contains sensitive authentication state (cookies and
session tokens). It must never be committed to git, placed in
.cache/mindcap/, archived, or uploaded to any service.
Do not copy your everyday Chrome profile into Mindcap's profile path.
cd tools/mindcap
task authWithout Task:
uv run mindcap auth chatgptMindcap will:
- Locate stable Google Chrome on your system.
- Launch Chrome directly (no Playwright automation, no remote-debugging flags, no anti-detection tricks).
- Open
https://chatgpt.com/in the dedicated profile. - Display a prompt asking you to log in.
Confirm the Chrome process and profile are correct from chrome://version:
- Executable Path should point to stable Google Chrome.
- Command Line should include your dedicated
--user-data-dir. - Profile Path should end in
/Defaultfor the dedicated profile.
Complete these steps in the Chrome window:
- Sign into ChatGPT using Google or your OpenAI credentials.
- Confirm that your conversation history is visible.
- Fully quit Chrome β on macOS use Cmd+Q, on Windows and Linux use File β Exit or close all windows and confirm the process has stopped.
- Return to the terminal and press Enter.
Important
Chrome must be fully quit before you press Enter. If Chrome is still running, the profile will be locked and capture will fail.
After authentication, capture uses Playwright with the stable Chrome channel via an external Chrome + CDP bridge so cookies written by stable Chrome remain readable. Playwright's bundled Chrome for Testing is never used for authentication.
With Task:
cd tools/mindcap
task setup
task paths
task doctor
task auth
task doctor
task capture -- "https://chatgpt.com/c/6a14b69f-7834-83ea-8257-0eceadb41691"
task verify -- "<bundle-path>"
task checkWithout Task:
uv sync
uv run mindcap paths
uv run mindcap doctor chatgpt
uv run mindcap auth chatgpt
uv run mindcap doctor chatgpt
uv run mindcap capture chatgpt \
"https://chatgpt.com/c/6a14b69f-7834-83ea-8257-0eceadb41691" \
--strategy "browser"
uv run mindcap verify "<bundle-path>"
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy src testsuv run mindcap capture chatgpt \
"https://chatgpt.com/c/6a14b69f-7834-83ea-8257-0eceadb41691" \
--strategy "browser"The browser strategy:
- Launches stable Chrome with the dedicated profile and loopback-only CDP.
- Registers response listeners before navigation.
- Creates a fresh capture tab and navigates to the requested conversation.
- Collects JSON responses without persisting headers or cookies.
- Scores candidates for conversation-shaped data.
- Archives and normalizes the highest-confidence payload.
If ChatGPT's current frontend does not expose a recognizable JSON response, the command fails with a diagnostic report instead of scraping an incomplete DOM and calling it a complete capture.
Increase the observation window if the chat is slow to load:
uv run mindcap capture chatgpt \
"https://chatgpt.com/c/6a14b69f-7834-83ea-8257-0eceadb41691" \
--strategy "browser" \
--wait-seconds 20If you see "This browser or app may not be secure", the authentication flow is
running inside Chrome for Testing instead of stable Chrome. Make sure you are
running mindcap auth chatgpt with the current version of Mindcap. Do not
attempt to work around Google's security check by disabling MFA or security
settings.
Mindcap requires a normally installed stable Google Chrome for authentication. Install it from https://www.google.com/chrome/ and retry.
If Chrome is installed in a non-standard location, set the environment variable:
export MINDCAP_CHROME_EXECUTABLE="/path/to/google-chrome"If Mindcap reports that the dedicated profile is locked, Chrome is still running. Fully quit the dedicated Chrome process and retry. Do not delete the lock file while Chrome is running β doing so can corrupt the profile.
Run diagnostics:
task doctor
# or
uv run mindcap doctor chatgpt --verboseAuthentication cookies have a limited lifetime. When capture redirects to a login page, re-authenticate:
task authConfirm that both the authentication command and capture command are using the
same dedicated profile path. Run task paths to display both locations.
Then fully quit dedicated Chrome and rerun:
task auth
task doctorIf the conversation is slow to load, increase the observation window:
uv run mindcap capture chatgpt "<url>" --strategy "browser" --wait-seconds 30task paths
# or
uv run mindcap pathsAfter a successful capture, relaunch dedicated Chrome manually with the same
--user-data-dir and confirm ChatGPT is still authenticated. Mindcap capture
should not invalidate the dedicated profile.
To start over with a fresh, unauthenticated profile, delete the dedicated
profile directory. Run task paths (or uv run mindcap paths) first to
confirm the exact path, then delete it manually:
# Step 1 β display the profile path:
uv run mindcap paths
# Step 2 β delete the path shown in the "ChatGPT browser profile" row:
# macOS / Linux example (replace with the actual path printed above):
rm -rf "$HOME/Library/Application Support/Ego Hygiene/mindcap/browser/chatgpt"
# Linux example:
# rm -rf "$HOME/.local/share/mindcap/browser/chatgpt"Warning
Always verify the path shown by mindcap paths before deleting. Never
run rm -rf with unverified shell expansions.
After deleting the profile, run task auth again to create a fresh one.
mindcap auth chatgpt
mindcap doctor chatgpt
mindcap capture chatgpt <url-or-id>
mindcap import chatgpt <json-file>
mindcap verify <bundle-path>
mindcap plugins list
mindcap paths
mindcap version
CaptureRequest
-> PluginRegistry
-> ChatGPTPlugin
-> CaptureStrategy
βββ BrowserCaptureStrategy
βββ SavedJsonCaptureStrategy
-> ChatGPTNormalizer
-> ChatGPTMarkdownRenderer
-> FilesystemStorageStrategy
-> Verified Artifact Bundle
Provider-specific behavior belongs under src/mindcap/plugins/. Core modules
must not import ChatGPT code.
- Authentication state lives outside the repository and artifact cache.
- Authentication uses stable Chrome directly β no Playwright automation during the auth flow.
- Capture uses Playwright with
channel="chrome"to remain compatible with the auth state. - Capture bundles never include request headers, cookies, or browser storage.
- Raw provider payloads may still contain sensitive conversation content and expiring asset references.
.cache/mindcap/must remain ignored and private.- Do not share an unreviewed HAR file; HAR files commonly include request headers and cookies.
- Treat every generated bundle as
sensitiveby default.
- ChatGPT capture depends on undocumented frontend network behavior.
- Browser candidate detection is intentionally conservative.
- Attachments are recorded only when present in the captured payload; binary download is not implemented.
- Security redaction and redaction ledgers are not implemented yet.
- Normalization targets the common ChatGPT
mappingrepresentation. - Knowledge extraction, synapses, and Gardenization are not implemented.
- Version-history writes are local-filesystem oriented and do not yet provide cross-process locking.
task capturerequires stable Google Chrome to be installed on the host.
Use the repository specifications as authoritative inputs:
../../.github/specs/source-capture.spec.md../../.github/specs/knowledge-extract.spec.md../../.github/specs/gardenize.spec.md
The next milestone should harden live ChatGPT response discovery against the acceptance conversation, add sanitized diagnostics, complete source-capture contract coverage, and preserve attachment metadata without leaking temporary credentials.