Skip to content

[codex] Add current document context command#158

Draft
afar1 wants to merge 1 commit into
mainfrom
codex/ft-current-context
Draft

[codex] Add current document context command#158
afar1 wants to merge 1 commit into
mainfrom
codex/ft-current-context

Conversation

@afar1
Copy link
Copy Markdown
Owner

@afar1 afar1 commented May 25, 2026

Summary

Adds ft current, a CLI command that reads the active Field Theory document context written by the Mac app terminal integration.

The command finds the newest context manifest under the Field Theory Library, reads the pointed-at active.md, and can print either human-readable output, JSON, or content-only markdown.

Why

Agents in the embedded terminal need a stable way to answer “what document am I looking at?” without relying on manual find/jq commands or prompt-only context.

Changes

  • Add src/current.ts for context manifest discovery, validation, formatting, and content loading.
  • Register ft current, ft current --json, ft current --content-only, and --manifest <path>.
  • Teach the Field Theory skill text to use ft current --json for active document questions.
  • Add tests for manifest selection and command registration.

Validation

  • npm ci
  • npx tsx --test tests/current.test.ts tests/cli.test.ts tests/skill.test.ts
  • npm run build
  • npm run dev -- current --json
  • git diff --check
  • npm test (545 passed)

@afar1 afar1 force-pushed the codex/ft-current-context branch from 1ee899c to 781cafa Compare May 25, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant