Imported from shinshin86/codex-history-list (
AGENTS.md). Install upstream withnpx skills add shinshin86/codex-history-list. Copyright stays with the author.
Repository Guidelines
Project Structure & Module Organization
src/: TypeScript sources.cli.ts: CLI entrypoint (args, table/JSON output).scan.ts: Recursive finder for~/.codex/sessions/**/*.jsonlandmtime.parse.ts: Line‑by‑line JSONL parser; extractscwd, first user ask, and optionaltimestamp.types.ts: Shared types.
dist/: Build output fromtsup(ignored by Git). Do not commit.package.json,tsconfig.json,README.md,LICENSE.
Build, Test, and Development Commands
- Install:
npm i(Node 18+). - Build:
npm run build→ emits ESM todist/viatsup. - Watch:
npm run dev→ rebuild on change. - Type check:
npm run typecheck(no emit). - Lint:
npm run lint(requires ESLint to be installed/configured). - Run CLI:
node dist/cli.js --helpor e.g.node dist/cli.js --json --no-color.
Coding Style & Naming Conventions
- Language: TypeScript + ESM. Keep local imports with
.jsextensions (even in.ts). - Indentation: 2 spaces; use semicolons; prefer
constand arrow functions. - Naming:
camelCasefor vars/functions,PascalCasefor types, filenames lowercase (use dashes if multiple words). - Exports: prefer named exports. Handle wide characters with
string-widthwhere relevant.
Testing Guidelines
- No test runner is configured yet. If adding tests, use Node’s built‑in test runner or Vitest.
- Location:
tests/orsrc/**/__tests__/**. - Naming:
*.test.tsor*.spec.ts. - Tips: use
--no-colorand--jsonfor stable snapshots; cover parsing of<environment_context>/<cwd>and table truncation logic.
Commit & Pull Request Guidelines
- Style: follow Conventional Commits (e.g.,
fix(cli): align path column,docs(readme): add sample output). - PR checklist:
- Clear description and rationale; include example CLI output (before/after) when UI changes.
- Link related issues; keep diffs focused; update README/AGENTS when behavior or options change.
- Ensure
npm run typecheckandnpm run buildsucceed; do not commitdist/.
Security & Configuration Tips
- This CLI only reads local session files; never write to
~/.codex/sessions. - Fail gracefully on unreadable files; avoid loading entire files into memory; keep errors non‑verbose by default.