{"_id":"@audaxic/memory-import","name":"@audaxic/memory-import","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@audaxic/memory-import","version":"1.0.0","description":"Import past conversations from Codex CLI, Claude Code CLI, and OpenCode CLI into Audaxic Memory.","license":"MIT","type":"module","bin":{"audaxic-memory-import":"src/index.js"},"scripts":{"start":"node src/index.js"},"engines":{"node":">=18"},"keywords":["audaxic","memory","codex","claude","opencode","ai","agent","conversation","import"],"dependencies":{"better-sqlite3":"^11.0.0"},"_id":"@audaxic/memory-import@1.0.0","_nodeVersion":"22.17.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-LcFifLJxxrrBGB5cwv7qTnH7PM5NZHRZ3QA49/9Rp+8f4OPcvbLSRRSapwMNCTPvdNj9800LMhRwmFsljRU2Rg==","shasum":"2ae95a74f9cc9a27ea70fbb510782aa433bd09b0","tarball":"https://registry.npmjs.org/@audaxic/memory-import/-/memory-import-1.0.0.tgz","fileCount":10,"unpackedSize":22635,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD2vNACG8msE5WPcLgkR9eBZxQpGPWLo1VRWI/idaxNwwIgQe/H6TA0MrHJAgdVfEcXvEDEEnD7MJ5GhH62h1sA+h0="}]},"_npmUser":{"name":"efebilici","email":"mehmetefebilici@gmail.com"},"directories":{},"maintainers":[{"name":"efebilici","email":"mehmetefebilici@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memory-import_1.0.0_1786108990985_0.9834397054971784"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-07T13:23:10.829Z","1.0.0":"2026-08-07T13:23:11.175Z","modified":"2026-08-07T13:23:11.404Z"},"maintainers":[{"name":"efebilici","email":"mehmetefebilici@gmail.com"}],"description":"Import past conversations from Codex CLI, Claude Code CLI, and OpenCode CLI into Audaxic Memory.","keywords":["audaxic","memory","codex","claude","opencode","ai","agent","conversation","import"],"license":"MIT","readme":"# @audaxic/memory-import\n\nImport past conversations from **Codex CLI**, **Claude Code CLI**, and **OpenCode CLI** into [Audaxic Memory](https://memory.audaxic.com) — so your coding agents remember everything you've ever discussed, not just what happens after you install a plugin.\n\n## Why\n\nYour coding agents accumulate months of valuable context in their local conversation history. When you switch agents (Codex → Claude Code → OpenCode) or start fresh, that context is lost. This tool reads the history from each CLI and imports it into your shared Audaxic Memory layer — with the correct timestamps preserved.\n\n## Installation\n\n```bash\nnpm install -g @audaxic/memory-import\n```\n\n## Setup\n\nThe tool uses your Audaxic API key in this order:\n\n1. `AUDAXIC_API_KEY` environment variable\n2. `~/.config/audaxic/config.json` (`{\"apiKey\": \"ak_...\"}` — same config file used by the Audaxic plugins)\n\nGet your API key from: https://memory-dashboard.audaxic.com\n\n## Usage\n\n```bash\n# Import from all supported CLIs\naudaxic-memory-import\n\n# Import from a specific CLI\naudaxic-memory-import --tool codex\naudaxic-memory-import --tool claude\naudaxic-memory-import --tool opencode\n\n# Multiple CLIs\naudaxic-memory-import --tool claude --tool opencode\n\n# Preview without sending anything\naudaxic-memory-import --dry-run\n\n# Date range (local timezone)\naudaxic-memory-import --from 2026-01-01 --to 2026-07-31\n\n# Cap the number of messages\naudaxic-memory-import --limit 500\n\n# Override the API key\naudaxic-memory-import --api-key ak_...\n\n# Clear import state (re-import everything)\naudaxic-memory-import --reset-state\n```\n\nRun via `npx` without global install:\n\n```bash\nnpx @audaxic/memory-import --dry-run\n```\n\n## What It Imports\n\n| CLI | Source | Messages |\n|-----|--------|----------|\n| **Codex** | `~/.codex/sessions/**/rollout-*.jsonl` | user + assistant (`response_item` messages) |\n| **Claude Code** | `~/.claude/projects/**/*.jsonl` and `~/.claude/transcripts/*.jsonl` | user + assistant (native format), user (transcript format) |\n| **OpenCode** | `~/.local/share/opencode/opencode.db` (SQLite) | user + assistant (text parts only) |\n\nTool calls, reasoning blocks, and system prompts are skipped. Only actual conversation text is imported.\n\n## How It Works\n\n1. **Extract** — reads each CLI's conversation history and extracts `(role, text, timestamp)` messages\n2. **Group by day** — messages are grouped by local-timezone `YYYY-MM-DD` (the `/add` API accepts one timestamp per batch)\n3. **Batch** — each day's messages are sent in chunks of ≤30 to `POST /add` with the correct day as the timestamp\n4. **Idempotent** — processed messages are tracked in `~/.config/audaxic/import-state.json`; re-running skips everything already imported\n5. **Retry** — connection-level failures retry once (HTTP error responses never retry, preventing duplicate memories)\n\n## Dry Run\n\nAlways start with a dry run to preview exactly what would be imported:\n\n```\n$ audaxic-memory-import --dry-run\n\nTool: codex\n  codex: 6 source(s), 47 messages (31 user, 16 assistant)\n  Day 2026-07-31: 47 messages → 2 batch(es) of ≤30\n  DRY RUN — would send 1 day request(s)\n\nTool: claude\n  claude: 15 source(s), 45 messages (45 user, 0 assistant)\n  Day 2026-02-05: 13 messages → 1 batch(es) of ≤30\n  ...\n```\n\n## Import State\n\nThe state file `~/.config/audaxic/import-state.json` records which messages have been imported (per source file + line). This means:\n\n- Re-running is safe — already-imported messages are skipped\n- New conversations since the last run are picked up automatically\n- Use `--reset-state` only if you want to re-import everything (will create duplicates)\n\n## Troubleshooting\n\n**\"No API key found\"** — set `AUDAXIC_API_KEY` or run `npx @audaxic/memory-claude install` / `npx @audaxic/memory-codex install` (creates the shared config), or create `~/.config/audaxic/config.json` manually.\n\n**OpenCode shows no messages** — verify the database exists at `~/.local/share/opencode/opencode.db` (Linux/macOS: `~/.local/share/opencode/opencode.db`).\n\n**Claude Code shows only user messages** — your `~/.claude/transcripts/*.jsonl` format only contains user/tool entries; native `~/.claude/projects/**/*.jsonl` transcripts contain both roles.\n\n## Related\n\n- [Audaxic Memory](https://memory.audaxic.com)\n- [Audaxic Memory for Claude Code](https://www.npmjs.com/package/@audaxic/memory-claude)\n- [Audaxic Memory for Codex](https://www.npmjs.com/package/@audaxic/memory-codex)\n- [Audaxic Memory for OpenCode](https://www.npmjs.com/package/@audaxic/memory-opencode)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-bd8e397fd36be39c4385703cd5ea36b5"}