@omega-edit/ai
v2.0.0
Published
AI-facing CLI and MCP tooling for OmegaEdit
Downloads
24
Readme
AI-facing tooling for Ωedit™: a scriptable oe CLI plus a stdio MCP server for bounded reads, reversible edits, and large-file-safe binary workflows.
Install
npm install @omega-edit/ai
# or
yarn add @omega-edit/aiCLI Quick Start
# Create a session against a file
oe create-session --file ./sample.bin
# Inspect a bounded range
oe view --session <session-id> --offset 0 --length 64
# Search text or bytes
oe search --session <session-id> --text PNG --limit 10
oe search --session <session-id> --hex 89504E47 --limit 10
# Preview and apply a reversible patch
oe patch --session <session-id> --offset 8 --hex 0000000d --dry-run
oe patch --session <session-id> --offset 8 --hex 0000000d
# Save or export a slice
oe save-session --session <session-id> --output ./patched.bin --overwrite
oe export-range --session <session-id> --offset 0 --length 128 --output ./header.bin --overwrite
# Undo if needed
oe undo --session <session-id>All CLI commands emit JSON to stdout and return non-zero exit codes on failure.
MCP Quick Start
omega-edit-mcpCodex Quick Start
If you are working from this repository, Codex can use the checked-out MCP server with the project-scoped config in .codex/config.toml:
[mcp_servers.omega-edit]
command = "node"
args = ["./packages/ai/dist/cjs/mcp.js"]If you want a machine-wide Codex config instead, use:
[mcp_servers.omega-edit]
command = "npx"
args = ["-y", "-p", "@omega-edit/ai", "omega-edit-mcp"]The server speaks newline-delimited JSON-RPC over stdio, following the MCP lifecycle documented by the Model Context Protocol:
initializenotifications/initializedtools/listtools/callping
Available tools:
omega_edit_create_sessionomega_edit_destroy_sessionomega_edit_session_statusomega_edit_read_rangeomega_edit_searchomega_edit_preview_patchomega_edit_apply_patchomega_edit_undoomega_edit_redoomega_edit_save_sessionomega_edit_export_rangeomega_edit_server_info
Safety Defaults
The AI surface is intentionally bounded:
- reads are capped by
OMEGA_EDIT_AI_MAX_READ_BYTES(default262144) - patch payloads are capped by
OMEGA_EDIT_AI_MAX_EDIT_BYTES(default262144) - search result counts are capped by
OMEGA_EDIT_AI_MAX_SEARCH_RESULTS(default1000) - preview context is capped by
OMEGA_EDIT_AI_PREVIEW_CONTEXT_BYTES(default64) - auto-start refuses to launch Ωedit™ if the target port is already occupied by a non-Ωedit™ service
Notes
- The CLI and MCP server are both thin adapters over
@omega-edit/client. diff-sessioncurrently reports session counters plus last-change metadata rather than a full multi-change diff stream.- Codex MCP configuration follows the current OpenAI Codex MCP docs: https://developers.openai.com/codex/mcp.
- The protobuf performance audit mentioned in issue
#1332should still be completed before wider rollout.
