Skip to content

Repository files navigation

Cerex Web showing project files, a rendered document, and agent sessions

Preview of Cerex Web IDE (coming soon)


Cerex is an agent engine for durable, fault-tolerant AI sessions. The current open-source release focuses on coding and ships with a terminal client. The SDK is not fully stable yet; if you want to build on it, talk to us via Issues or email simonramstedt@gmail.com.

Cerex matches the Codex CLI system prompt and tool profile without requiring its source tree or binary. Any other OpenAI-compatible API is also supported, with model-specific tool profiles for Kimi K3 and others in development.

Cerex is installable directly from GitHub source, with no npm dependencies and no build step.

Architecture

Cerex process architecture

Source layout
cli/ command-line composition root
packages/
protocol/src/ shared transport and transcript presentation contracts
sdk/src/ runtime-independent client SDK
server/src/
agent-core/ AgentLoop + Agent (streamFn-driven), JSDoc types
ai-apis/ zero-dep OpenAI Chat-Completions / Responses / Codex clients
tools/ built-in coding and shell tools
fallback-tools/ PATH fallbacks for common external commands
session-manager/ SQLite + in-memory session storage
app/ service, workspace-host, and worker runtime
tui/src/
tui/ reusable retained terminal UI framework
app/ Cerex terminal client

Install

npm install -g github:rmst/cerex
cerex

Requires Node ≥ 22.6. Cerex is best tested on macOS and also runs on Linux and Windows through WSL 2. Linux and WSL 2 require Bubblewrap for sandboxing; Cerex can offer to continue without a sandbox when it is unavailable.

Clone and run directly
git clone https://github.com/rmst/cerex
./cerex/bin/cerex.js

On first run, Cerex opens the model provider credentials view when no provider is configured. Cerex is currently optimized for use with a ChatGPT subscription.

Install and first setup demo

Cerex install and first setup demo

API keys are also supported. Cerex can import supported API keys from the launch environment. Deployment-level API keys and other settings can be configured declaratively; see settings.

Common commands

cerex # open the session overview
cerex open /sessions/<id># open a session directly
cerex service # show local service status
cerex --help

Terminal client

Running cerex opens an overview of your sessions. Type a task and press Enter to start a background session in the current directory. Running sessions stay alive when you detach from the terminal, and the service shuts down automatically after all sessions are idle.

Terminal UI demo and reference

Cerex terminal session overview and running agent demo

Use /model from the overview to update the global default model for newly dispatched sessions.

Useful keys:

KeyAction
/ select a session
Enter / open the selected session
return to the overview
Ctrl+Greturn to the overview, including while composing text
Spacepeek at the selected session or reply to it
Escinterrupt an open running session
Ctrl+Xstop a selected running session
Ctrl+Cdetach this terminal without stopping running sessions

Type / to autocomplete. /help shows the full command list for the current view.

Overview commands

CommandWhat it does
/modelselect the default model for new sessions
/reasoningset the default reasoning effort for new sessions
/usageshow ChatGPT/Codex usage limits
/settingsedit local settings; includes credentials

Session commands

CommandWhat it does
/modelselect a compatible model for this session
/rewindrewind to an earlier prompt or switch branch
/branchcreate a new session from the current conversation branch
/contextshow context usage details
/fast on|off|statustoggle Codex Fast mode when supported by the model

In an open session, type !cmd to run a shell command directly. Use !!cmd to run it without adding the result to agent context.

Press Ctrl+V in the session or overview editor to paste an image from the system clipboard. On Linux this requires wl-clipboard (wl-paste) or xclip.

Branching and rewind

/branch creates a new session from the current conversation point. The original session remains unchanged and both sessions can continue independently.

Press Esc Esc on an empty editor to open /rewind. You can return to an earlier prompt, switch to another branch tip, and optionally restore files changed through Cerex's edit tools.

If you have questions or issues, ask Cerex itself. It has read-only access to its own source and documentation.

Tool environments

By default, tools run in a native filesystem sandbox on macOS and Linux. macOS uses sandbox-exec; Linux uses Bubblewrap (bwrap). You can optionally configure named local or container environments for tool execution.

Sandbox mount paths include the session's starting working directory. In the environments configuration, mountPaths adds other static host paths. Changing cwd does not add mounts or writable paths. Native workers allow reads from mounted paths plus system, toolchain, Cerex runtime paths, and the environment's tool home, while writes stay restricted to mounted paths, temporary directories, and the tool home.

Environment configuration

Create ~/.cerex/environments.json to define explicit environments:

{
"default": "alpine",
"environments": {
"alpine": {
"sandbox": {
"type": "container",
"image": "node:22-alpine",
"mountPaths": [
"/Users/me/dev"
],
"env": { "GH_TOKEN": "..." }
}
}
}
}

Project context

Cerex reads project instructions from AGENTS.md or CLAUDE.md:

  1. Global instructions under ~/.cerex/.
  2. Instructions in ancestor directories of the current working directory.
  3. Additional instructions in subdirectories when files there are read or modified.

@import

@<path> references in normal Markdown text are replaced with that file's contents. Relative paths resolve against the importing file; ~/ expands to $HOME. Inline code and fenced code blocks are left alone.

# project rules
See @README for project overview.
@./conventions.md
@~/.cerex/personal-style.md

Notes

  • Cerex was initially called Pinano and was based on Pi.
  • Cerex also runs on the experimental Qn runtime.

About

AI Agent Engine/Harness/TUI with Zero Dependencies

Resources

Stars

26 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages