open-index/open-npm huggingface dataset:
npm package: @openmnemo/cli
Description: OpenMnemo unified CLI — manage AI conversation memory
Author: OpenMnemo Contributors
Latest version: 0.4.1

# @openmnemo/cli

OpenMnemo unified CLI — manage AI conversation memory across Claude, Codex, Gemini, and Doubao.

## Install

```bash
npm install -g @openmnemo/cli
```

## Commands

### `openmnemo init`

Initialise a MemoryTree workspace in a repository.

```bash
openmnemo init --root . --project-name "my-project" --locale en
```

### `openmnemo upgrade`

Upgrade an existing workspace without overwriting policy files.

```bash
openmnemo upgrade --root .
```

### `openmnemo import`

Import a single transcript file into Memory.

```bash
openmnemo import --source ~/.codex/conversations/abc.jsonl --client codex
openmnemo import --source ~/doubao_session.txt --client doubao
```

### `openmnemo discover`

Scan default client directories and import all matching transcripts.

```bash
# Import all transcripts for the current project
openmnemo discover --scope current-project

# Import everything, all clients (claude, codex, gemini)
openmnemo discover --client all --scope all-projects
```

### `openmnemo search`

Full-text search over imported sessions.

```bash
openmnemo search --query "authentication bug"
openmnemo search --query "database migration" --limit 10 --format json
```

### `openmnemo recall`

Sync transcripts and return the most recent session for the current project.

```bash
openmnemo recall
openmnemo recall --format json
```

### `openmnemo report build`

Build a static HTML report from `Memory/`.

```bash
openmnemo report build --root . --output ./Memory/07_reports --no-ai
openmnemo report build --root . --output ./Memory/07_reports --locale zh-CN
```

### `openmnemo report serve`

Serve a built report over HTTP.

```bash
openmnemo report serve --dir ./Memory/07_reports --port 10086
```

### `openmnemo daemon`

Manage the background heartbeat that auto-imports transcripts.

```bash
openmnemo daemon install          # register with OS scheduler (every 10 min)
openmnemo daemon uninstall        # remove scheduled task
openmnemo daemon run-once         # run a single heartbeat cycle now
openmnemo daemon status           # show registration and lock state
```

## Supported clients

| Client | Format | Auto-discovery |
|--------|--------|----------------|
| Claude | JSONL | `~/.claude/projects/` |
| Codex (OpenAI) | JSONL | `~/.codex/conversations/` |
| Gemini | JSON | `~/.gemini/conversations/` |
| Doubao | TXT | via `openmnemo import --client doubao` |

## License

MIT
npm package: @openmnemo/core
Description: Transcript parsing, import, dedup, indexing, and recall for OpenMnemo
Author: OpenMnemo Contributors
Latest version: 0.4.1

# @openmnemo/core

Transcript parsing, import, dedup, full-text search, and recall for OpenMnemo.

## Install

```bash
npm install @openmnemo/core
```

## Features

- Parse transcripts from Claude (JSONL), Codex/OpenAI (JSONL), Gemini (JSON), and Doubao (TXT)
- Import into a structured `Memory/` directory with deduplication
- Full-text search over imported sessions via SQLite FTS4
- Recall the most recent session for a project

## Parsing

```typescript
import { inferClient, parseTranscript } from '@openmnemo/core'

const client = inferClient('auto', '/path/to/file.jsonl')  // 'claude' | 'codex' | ...
const transcript = parseTranscript(client, '/path/to/file.jsonl')
// → ParsedTranscript { client, session_id, title, messages, tool_events, ... }
```

## Discovery

```typescript
import { discoverSourceFiles, defaultGlobalTranscriptRoot } from '@openmnemo/core'

// Scan default client directories (~/.claude/projects, ~/.codex/conversations, ...)
const sources = discoverSourceFiles()  // [['claude', '/path/a.jsonl'], ...]
```

## Import

```typescript
import { importTranscript, transcriptHasContent } from '@openmnemo/core'

if (transcriptHasContent(transcript)) {
  const manifest = await importTranscript(
    transcript,
    '/path/to/repo',      // repository root
    '/path/to/Memory',    // global transcript root
    'my-project',         // project slug
    'not-set',            // raw upload permission
    true,                 // mirror to repo
  )
}
```

## Full-text Search

```typescript
import { searchTranscripts, sanitizeFtsQuery } from '@openmnemo/core'

const results = await searchTranscripts(
  '/path/to/Memory/index/search.sqlite',
  'authentication bug',
  20,  // limit
)
// → SearchResult[] { client, project, session_id, title, cwd, branch, started_at }
```

## Recall

```typescript
import { recall, formatRecallText } from '@openmnemo/core'

const result = await recall(
  '/path/to/repo',
  'my-project',
  '/path/to/Memory',
  new Date().toISOString(),
)
// → RecallResult { found, session_id, title, client, clean_content, ... }

console.log(formatRecallText(result))
```

## License

MIT
npm package: @openmnemo/report
Description: OpenMnemo report generation — builds a static HTML dashboard from Memory/
Author: OpenMnemo Contributors
Latest version: 0.4.1

# @openmnemo/report

Generates a static HTML dashboard from an OpenMnemo `Memory/` directory.

Produces an interactive site with session timelines, knowledge graph, project dashboards, goals, todos, and full-text search — all from local Markdown and JSONL files, with no server required.

## Install

```bash
npm install @openmnemo/report
```

## Usage

```typescript
import { buildReport } from '@openmnemo/report'

await buildReport({
  root: '/path/to/repo',            // repository root containing Memory/
  output: '/path/to/Memory/07_reports',
  noAi: true,                       // skip AI-powered session summaries
  model: 'claude-haiku-4-5-20251001',
  locale: 'en',                     // 'en' or 'zh-CN'
})
```

### With AI summaries

Set `noAi: false` and provide `ANTHROPIC_API_KEY` in the environment. The `@anthropic-ai/sdk` package is a peer dependency and only required when `noAi` is `false`.

```typescript
await buildReport({
  root: '.',
  output: './Memory/07_reports',
  noAi: false,
  model: 'claude-haiku-4-5-20251001',
})
```

## Output structure

```
Memory/07_reports/
  index.html          Dashboard (session count, recent activity, top projects)
  graph.html          Knowledge graph (topics, entities, session links)
  search.html         Full-text search UI
  projects/           Per-project pages
  transcripts/        Per-session clean transcript viewers
  goals/              Goals tracking
  todos/              Todo list view
  knowledge/          Knowledge base pages
  archive/            Archived sessions
```

## CLI

The easiest way to use this package is via `@openmnemo/cli`:

```bash
openmnemo report build --root . --output ./Memory/07_reports --no-ai
openmnemo report serve --dir ./Memory/07_reports --port 10086
```

## GitHub Pages deployment

Set `ghPagesBranch` to deploy automatically:

```typescript
await buildReport({
  root: '.',
  output: './Memory/07_reports',
  noAi: true,
  model: 'claude-haiku-4-5-20251001',
  ghPagesBranch: 'gh-pages',
  cname: 'memory.mysite.com',        // optional custom domain
  webhookUrl: 'https://...',         // optional Feishu/Slack/Discord/Telegram notify
})
```

## License

MIT
npm package: @openmnemo/sync
Description: Heartbeat daemon, config management, and background sync for OpenMnemo
Author: OpenMnemo Contributors
Latest version: 0.4.1

# @openmnemo/sync

Heartbeat daemon, config management, and background sync for OpenMnemo.

Runs periodically to discover new AI transcripts, import them into `Memory/`, commit changes to git, and optionally generate HTML reports.

## Install

```bash
npm install @openmnemo/sync
```

This package is primarily consumed by `@openmnemo/cli` via the `openmnemo daemon` commands. Direct usage is for programmatic control.

## Config

Config is stored in `~/.memorytree/config.toml`.

```typescript
import { loadConfig, saveConfig, memorytreeRoot } from '@openmnemo/sync'

const config = loadConfig()
// {
//   heartbeat_interval: '5m',
//   auto_push: true,
//   generate_report: false,
//   locale: 'en',
//   ai_summary_model: 'claude-haiku-4-5-20251001',
//   ...
// }
```

### Config fields

| Field | Default | Description |
|-------|---------|-------------|
| `heartbeat_interval` | `'5m'` | Heartbeat interval (e.g. `'5m'`, `'1h'`) |
| `auto_push` | `true` | Git push after each import |
| `generate_report` | `false` | Build HTML report on each heartbeat |
| `locale` | `'en'` | Report locale (`'en'` or `'zh-CN'`) |
| `ai_summary_model` | `'claude-haiku-4-5-20251001'` | Model for AI session summaries |
| `gh_pages_branch` | `''` | Deploy report to this branch (empty = skip) |
| `cname` | `''` | Custom domain for GitHub Pages |
| `webhook_url` | `''` | Notify Feishu/Slack/Discord/Telegram on publish |
| `report_base_url` | `''` | Base URL for report RSS/OG links |

## Programmatic heartbeat

```typescript
import { runHeartbeat } from '@openmnemo/sync'

await runHeartbeat()
```

## Lock management

```typescript
import { acquireLock, releaseLock, readLockPid } from '@openmnemo/sync'

const acquired = acquireLock()
if (acquired) {
  // run heartbeat
  releaseLock()
}
```

## Alerts

```typescript
import { readAlerts, writeAlert, clearAlerts } from '@openmnemo/sync'

const alerts = readAlerts()
writeAlert({ type: 'sensitive-content', message: 'API key detected', project: 'my-project' })
clearAlerts()
```

## License

MIT
npm package: @openmnemo/types
Description: Shared TypeScript types for OpenMnemo
Author: OpenMnemo Contributors
Latest version: 0.4.1

# @openmnemo/types

Shared TypeScript types for the OpenMnemo ecosystem.

## Install

```bash
npm install @openmnemo/types
```

## Types

```typescript
import type {
  Client,
  ParsedTranscript,
  TranscriptMessage,
  TranscriptToolEvent,
  ManifestEntry,
} from '@openmnemo/types'
```

### `Client`

```typescript
type Client = 'codex' | 'claude' | 'gemini' | 'doubao'
```

### `ParsedTranscript`

Normalised representation of a parsed AI conversation file, regardless of the original client format.

```typescript
interface ParsedTranscript {
  client: Client
  session_id: string
  title: string
  started_at: string
  cwd: string
  branch: string
  messages: TranscriptMessage[]
  tool_events: TranscriptToolEvent[]
  source_path: string
}
```

### `TranscriptMessage`

```typescript
interface TranscriptMessage {
  role: string
  text: string
  timestamp: string | null
}
```

### `TranscriptToolEvent`

```typescript
interface TranscriptToolEvent {
  summary: string
  timestamp: string | null
}
```

### `ManifestEntry`

Metadata written to disk after a transcript is imported. Used by indexing and recall systems.

```typescript
interface ManifestEntry {
  client: string
  project: string
  session_id: string
  raw_sha256: string
  title: string
  started_at: string
  imported_at: string
  cwd: string
  branch: string
  raw_source_path: string
  raw_upload_permission: string
  global_raw_path: string
  global_clean_path: string
  global_manifest_path: string
  repo_raw_path: string
  repo_clean_path: string
  repo_manifest_path: string
  message_count: number
  tool_event_count: number
  cleaning_mode: string
  repo_mirror_enabled: boolean
}
```

## License

MIT