diff --git a/README.md b/README.md index 0ff7efe..3387536 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,22 @@ normally — pxpipe compresses the *request* only, never the model's output. Recent turns stay text; the system prompt, tool docs, and older bulk history are imaged. +## Offline export (no proxy) + +You can render text, files, or diffs to PNG pages without running the proxy or +connecting Claude Code: + +```bash +pxpipe export src/ +cat prompt.txt | pxpipe export --stdin +pxpipe export --git +``` + +The command writes an output folder containing `page-*.png`, `factsheet.txt`, +`manifest.json`, and `prompt.txt`. Upload the PNG pages and paste the prompt +into image-upload clients such as Cursor when you want dense visual context +without running the proxy. + ## The honest part - **It is lossy.** Exact 12-char hex strings in dense imaged content: diff --git a/tests/readme-offline-export.test.ts b/tests/readme-offline-export.test.ts new file mode 100644 index 0000000..a19b13e --- /dev/null +++ b/tests/readme-offline-export.test.ts @@ -0,0 +1,32 @@ +import { describe, expect, it } from 'vitest'; +import * as fs from 'node:fs'; + +const README_PATH = 'README.md'; +const OFFLINE_EXPORT_HEADING = '## Offline export (no proxy)'; +const REQUIRED_OFFLINE_EXPORT_TEXT = [ + 'pxpipe export', + '--stdin', + '--git', + 'page-*.png', + 'factsheet.txt', + 'prompt.txt', + 'Cursor', + 'without running the proxy', +] as const; + +describe('README offline export documentation', () => { + it('documents the proxy-free image export workflow', () => { + const readme = fs.readFileSync(README_PATH, 'utf8'); + const sectionStart = readme.indexOf(OFFLINE_EXPORT_HEADING); + + expect(sectionStart).toBeGreaterThanOrEqual(0); + + const nextSectionStart = readme.indexOf('\n## ', sectionStart + OFFLINE_EXPORT_HEADING.length); + const section = + nextSectionStart === -1 ? readme.slice(sectionStart) : readme.slice(sectionStart, nextSectionStart); + + for (const requiredText of REQUIRED_OFFLINE_EXPORT_TEXT) { + expect(section).toContain(requiredText); + } + }); +});