Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Repository Overview

Entire CLI is a Go CLI tool that captures AI coding agent sessions (Claude Code, Cursor, etc.) as searchable metadata stored separately from code commits. It uses a strategy pattern for session/checkpoint management with minimal impact on commit history.
Entire CLI is a Go CLI tool that captures AI coding agent sessions (Claude Code, Cursor, Gemini CLI, OpenCode, Factory AI Droid, etc.) as searchable metadata stored separately from code commits. It uses a strategy pattern for session/checkpoint management with minimal impact on commit history.

**Tech Stack**: Go (version in `mise.toml`), Cobra (CLI), charmbracelet/huh (interactive prompts), go-git/v5 (with caveats)

Expand Down
8 changes: 5 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repo contains the CLI for Entire.
- `entire/`: Main CLI entry point
- `entire/cli`: CLI utilities and helpers
- `entire/cli/commands`: actual command implementations
- `entire/cli/agent`: agent implementations (Claude Code, Gemini CLI, OpenCode, Cursor) - see [Agent Integration Checklist](docs/architecture/agent-integration-checklist.md) and [Agent Implementation Guide](docs/architecture/agent-guide.md)
- `entire/cli/agent`: agent implementations (Claude Code, Gemini CLI, OpenCode, Cursor, Factory AI Droid) - see [Agent Integration Checklist](docs/architecture/agent-integration-checklist.md) and [Agent Implementation Guide](docs/architecture/agent-guide.md)
- `entire/cli/strategy`: strategy implementation (manual-commit) - see section below
- `entire/cli/checkpoint`: checkpoint storage abstractions (temporary and committed)
- `entire/cli/session`: session state management
Expand Down Expand Up @@ -72,16 +72,18 @@ mise run test:e2e [filter] # All agents, filtered
mise run test:e2e --agent claude-code [filter] # Claude Code only
mise run test:e2e --agent gemini-cli [filter] # Gemini CLI only
mise run test:e2e --agent opencode [filter] # OpenCode only
mise run test:e2e --agent cursor [filter] # Cursor only
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The E2E agent selector for Cursor is cursor-cli (not cursor) in this repo, so this command example won’t work as written. Update it to mise run test:e2e --agent cursor-cli [filter].

Suggested change
mise run test:e2e --agent cursor [filter] # Cursor only
mise run test:e2e --agent cursor-cli [filter] # Cursor only

Copilot uses AI. Check for mistakes.
mise run test:e2e --agent factoryai-droid [filter] # Factory AI Droid only
```

E2E tests:

- Use the `//go:build e2e` build tag
- Located in `e2e/tests/`
- See [`e2e/README.md`](e2e/README.md) for full documentation (structure, debugging, adding agents)
- Test real agent interactions (Claude Code, Gemini CLI, OpenCode, Cursor, or Vogon creating files, committing, etc.)
- Test real agent interactions (Claude Code, Gemini CLI, OpenCode, Cursor, Factory AI Droid, or Vogon creating files, committing, etc.)
- Validate checkpoint scenarios documented in `docs/architecture/checkpoint-scenarios.md`
- Support multiple agents via `E2E_AGENT` env var (`claude-code`, `gemini`, `opencode`, `cursor`, `vogon`)
- Support multiple agents via `E2E_AGENT` env var (`claude-code`, `gemini`, `opencode`, `cursor`, `factoryai-droid`, `vogon`)
Comment on lines +84 to +86
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E2E_AGENT values here should match the E2E agent registry names. In this repo those include gemini-cli (not gemini) and cursor-cli (not cursor), and CI also runs copilot-cli (see .github/workflows/e2e.yml). Update this list so readers can copy/paste valid values.

Copilot uses AI. Check for mistakes.

**Environment variables:**

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ These are markdown files that define specialized behaviors for Claude Code (e.g.

### 2. Coding Agent Integrations (Go)

These are Go implementations that integrate Entire with different AI coding tools (Claude Code, Gemini CLI, OpenCode, Cursor, etc.) using the Agent abstraction layer.
These are Go implementations that integrate Entire with different AI coding tools (Claude Code, Gemini CLI, OpenCode, Cursor, Factory AI Droid, etc.) using the Agent abstraction layer.

- **Location:** `cmd/entire/cli/agent/`
- **Steps:**
Expand Down Expand Up @@ -338,7 +338,7 @@ Join the Entire community:

- [README](README.md) - Setup and usage documentation
- [CLAUDE.md](CLAUDE.md) - Architecture and development reference (Claude Code)
- [AGENTS.md](AGENTS.md) - Architecture and development reference (Gemini CLI, OpenCode, Cursor)
- [AGENTS.md](AGENTS.md) - Architecture and development reference (Gemini CLI, OpenCode, Cursor, Factory AI Droid)
- [Code of Conduct](CODE_OF_CONDUCT.md) - Community guidelines
- [Security Policy](SECURITY.md) - Reporting security vulnerabilities

Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ With Entire, you can:

- Git
- macOS or Linux (Windows via WSL)
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [OpenCode](https://opencode.ai/docs/cli/), or [Cursor](https://www.cursor.com/) installed and authenticated
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [OpenCode](https://opencode.ai/docs/cli/), [Cursor](https://www.cursor.com/), or [Factory AI Droid](https://www.factory.ai/) installed and authenticated

## Quick Start

Expand All @@ -56,13 +56,13 @@ entire status
entire enable
```

This installs agent and git hooks to work with your AI agent (Claude Code, Gemini CLI, OpenCode, or Cursor). You'll be prompted to select which agents to enable. To enable a specific agent non-interactively, use `entire enable --agent <name>` (e.g., `entire enable --agent cursor`).
This installs agent and git hooks to work with your AI agent (Claude Code, Gemini CLI, OpenCode, Cursor, or Factory AI Droid). You'll be prompted to select which agents to enable. To enable a specific agent non-interactively, use `entire enable --agent <name>` (e.g., `entire enable --agent cursor`).

The hooks capture session data as you work. Checkpoints are created when you or the agent make a git commit. Your code commits stay clean, Entire never creates commits on your active branch. All session metadata is stored on a separate `entire/checkpoints/v1` branch.

### 2. Work with Your AI Agent

Just use Claude Code, Gemini CLI, OpenCode, or Cursor normally. Entire runs in the background, tracking your session:
Just use Claude Code, Gemini CLI, OpenCode, Cursor, or Factory AI Droid normally. Entire runs in the background, tracking your session:

```
entire status # Check current session status anytime
Expand Down Expand Up @@ -171,7 +171,7 @@ Multiple AI sessions can run on the same commit. If you start a second session w

| Flag | Description |
| ---------------------- | --------------------------------------------------------------------- |
| `--agent <name>` | AI agent to install hooks for: `claude-code`, `gemini`, `opencode`, or `cursor` |
| `--agent <name>` | AI agent to install hooks for: `claude-code`, `gemini`, `opencode`, `cursor`, or `factoryai-droid` |
| `--force`, `-f` | Force reinstall hooks (removes existing Entire hooks first) |
| `--local` | Write settings to `settings.local.json` instead of `settings.json` |
| `--project` | Write settings to `settings.json` even if it already exists |
Expand Down Expand Up @@ -232,7 +232,8 @@ Each agent stores its hook configuration in its own directory. When you run `ent
| Claude Code | `.claude/settings.json` | JSON hooks config |
| Gemini CLI | `.gemini/settings.json` | JSON hooks config |
| OpenCode | `.opencode/plugins/entire.ts` | TypeScript plugin |
| Cursor | `.cursor/hooks.json` | JSON hooks config |
| Cursor | `.cursor/hooks.json` | JSON hooks config |
| Factory AI Droid | `.factory/settings.json` | JSON hooks config |

You can enable multiple agents at the same time — each agent's hooks are independent. Entire detects which agents are active by checking for installed hooks, not by a setting in `settings.json`.

Expand Down Expand Up @@ -309,6 +310,22 @@ Rewind is not available at this time, but other commands (`doctor`, `status` etc

If you run into any issues with Cursor integration, please [open an issue](https://github.com/entireio/cli/issues).

### Factory AI Droid

Factory AI Droid support is currently in preview. Entire can work with [Factory AI Droid](https://www.factory.ai/) as an alternative to Claude Code, or alongside it — you can have multiple agents' hooks enabled at the same time.

To enable:

```bash
entire enable --agent factoryai-droid
```

Or select Factory AI Droid from the interactive agent picker when running `entire enable`.

All commands (`rewind`, `resume`, `status`, `doctor`, etc.) work the same regardless of which agent is configured.

If you run into any issues with Factory AI Droid integration, please [open an issue](https://github.com/entireio/cli/issues).

## Security & Privacy

**Your session transcripts are stored in your git repository** on the `entire/checkpoints/v1` branch. If your repository is public, this data is visible to anyone.
Expand Down
26 changes: 13 additions & 13 deletions docs/architecture/agent-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ var (

### Step 8: Implement Hook Installation (if `HookSupport`)

If your agent uses a JSON config file for hooks (like Claude Code's `.claude/settings.json`, Gemini's `.gemini/settings.json`, or Cursor's `.cursor/hooks.json`), implement `HookSupport`:
If your agent uses a JSON config file for hooks (like Claude Code's `.claude/settings.json`, Gemini's `.gemini/settings.json`, Cursor's `.cursor/hooks.json`, or Factory AI Droid's `.factory/settings.json`), implement `HookSupport`:

```go
func (a *YourAgent) InstallHooks(localDev bool, force bool) (int, error) {
Expand Down Expand Up @@ -422,15 +422,15 @@ Test `ParseHookEvent` for every hook name your agent supports. See [Testing Patt

The framework dispatcher (`DispatchLifecycleEvent` in `lifecycle.go`) handles each event type as follows:

| Event Type | Framework Actions | Claude Code Hook | Gemini CLI Hook | Cursor Hook | OpenCode Hook |
|------------|-------------------|------------------|-----------------|-----------------|---------------|
| `SessionStart` | Shows banner, checks concurrent sessions, fires state machine transition | `session-start` | `session-start` | `session-start` | `session-start` |
| `TurnStart` | Captures pre-prompt state (git status, transcript position), ensures strategy setup, initializes session | `user-prompt-submit` | `before-agent` | `before-submit-prompt` | `turn-start` |
| `TurnEnd` | Validates transcript, extracts metadata (prompts, summary, files), detects file changes via git status, saves step + checkpoint, transitions phase to IDLE | `stop` | `after-agent` | `stop` | `turn-end` |
| `Compaction` | Fires compaction transition (stays ACTIVE), resets transcript offset | *(not used)* | `pre-compress` | `pre-compact` | `compaction` |
| `SessionEnd` | Marks session as ENDED in state machine | `session-end` | `session-end` | `session-end` | `session-end` |
| `SubagentStart` | Captures pre-task state (git status snapshot) | `pre-task` (PreToolUse[Task]) | *(not used)* | `subagent-start` | *(not used)* |
| `SubagentEnd` | Extracts subagent modified files, detects changes, saves task checkpoint | `post-task` (PostToolUse[Task]) | *(not used)* | `subagent-stop` | *(not used)* |
| Event Type | Framework Actions | Claude Code Hook | Gemini CLI Hook | Cursor Hook | OpenCode Hook | Factory AI Droid Hook |
|------------|-------------------|------------------|-----------------|-----------------|---------------|----------------------|
| `SessionStart` | Shows banner, checks concurrent sessions, fires state machine transition | `session-start` | `session-start` | `session-start` | `session-start` | `session-start` |
| `TurnStart` | Captures pre-prompt state (git status, transcript position), ensures strategy setup, initializes session | `user-prompt-submit` | `before-agent` | `before-submit-prompt` | `turn-start` | `user-prompt-submit` |
| `TurnEnd` | Validates transcript, extracts metadata (prompts, summary, files), detects file changes via git status, saves step + checkpoint, transitions phase to IDLE | `stop` | `after-agent` | `stop` | `turn-end` | `stop` |
| `Compaction` | Fires compaction transition (stays ACTIVE), resets transcript offset | *(not used)* | `pre-compress` | `pre-compact` | `compaction` | `pre-compact` |
| `SessionEnd` | Marks session as ENDED in state machine | `session-end` | `session-end` | `session-end` | `session-end` | `session-end` |
| `SubagentStart` | Captures pre-task state (git status snapshot) | `pre-task` (PreToolUse[Task]) | *(not used)* | `subagent-start` | *(not used)* | `pre-tool-use` (PreToolUse[Task]) |
| `SubagentEnd` | Extracts subagent modified files, detects changes, saves task checkpoint | `post-task` (PostToolUse[Task]) | *(not used)* | `subagent-stop` | *(not used)* | `post-tool-use` (PostToolUse[Task]) |

### Event Field Requirements

Expand Down Expand Up @@ -591,7 +591,7 @@ agent.SortChunkFiles(files, "full.jsonl") // sorted by chunk index

### JSON Config File Pattern

Claude Code, Gemini CLI, and Cursor use a JSON settings file in their config directory. The installation pattern is:
Claude Code, Gemini CLI, Cursor, and Factory AI Droid use a JSON settings file in their config directory. The installation pattern is:

1. **Read existing settings** as `map[string]json.RawMessage` to preserve unknown fields
2. **Parse only the hook types you modify** into typed slices
Expand Down Expand Up @@ -833,8 +833,8 @@ Use `//nolint:nilnil` to suppress the linter warning on intentional nil returns.

### Agent Name vs Agent Type

- `AgentName` is the **registry key** used in code (`"claude-code"`, `"gemini"`, `"cursor"`). It appears in CLI commands: `entire hooks cursor stop`.
- `AgentType` is the **display name** stored in metadata and commit trailers (`"Claude Code"`, `"Gemini CLI"`, `"Cursor"`). It's what users see.
- `AgentName` is the **registry key** used in code (`"claude-code"`, `"gemini"`, `"opencode"`, `"cursor"`, `"factoryai-droid"`). It appears in CLI commands: `entire hooks cursor stop`.
- `AgentType` is the **display name** stored in metadata and commit trailers (`"Claude Code"`, `"Gemini CLI"`, `"OpenCode"`, `"Cursor"`, `"Factory AI Droid"`). It's what users see.

Register constants for both in `cmd/entire/cli/agent/registry.go` when adding a new agent.

Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/agent-integration-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ See Guide: [Transcript Format Guide](agent-guide.md#transcript-format-guide), [T

- [ ] **Full transcript on every turn**: At turn-end, capture the complete session transcript, not just events since the last checkpoint
- [ ] **Resumed session handling**: When a user resumes an existing session, the transcript must include all historical messages, not just new ones since the plugin/hook loaded
- [ ] **Use agent's canonical export**: Prefer the agent's native export command (e.g., reading Claude's JSONL file, Gemini's JSON, Cursor's JSONL, OpenCode's `opencode export` JSON) over manually reconstructing from events
- [ ] **Use agent's canonical export**: Prefer the agent's native export command (e.g., reading Claude's JSONL file, Gemini's JSON, Cursor's JSONL, Factory AI Droid's JSONL, OpenCode's `opencode export` JSON) over manually reconstructing from events
- [ ] **No custom formats**: Store the agent's native format directly in `NativeData` - do not convert between formats (e.g., JSON to JSONL) or create intermediate representations
- [ ] **Graceful degradation**: If the canonical source is unavailable (e.g., agent shutting down), fall back to best-effort capture with clear documentation of limitations

Expand All @@ -54,7 +54,7 @@ See Guide: [Transcript Format Guide](agent-guide.md#transcript-format-guide), [T
See Guide: [Step 3 - Core Agent Interface](agent-guide.md#step-3-implement-core-agent-interface-youragentgo)

- [ ] **`WriteSession` implementation**: Agent must implement `WriteSession(AgentSession)` to restore sessions
- [ ] **File-based agents** (Claude, Gemini, Cursor): Write `NativeData` to `SessionRef` path
- [ ] **File-based agents** (Claude, Gemini, Cursor, Factory AI Droid): Write `NativeData` to `SessionRef` path
- [ ] **Database-backed agents** (OpenCode): Write `NativeData` to file, then import into native storage (the native format should be what the agent's import command expects)
- [ ] **Single format per agent**: Store only the agent's native format in `NativeData` - no separate fields for different representations of the same data

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/sessions-and-checkpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Entire CLI creates checkpoints for AI coding sessions. The system is agent-agnostic - it works with Claude Code, Gemini CLI, OpenCode, Cursor, or any tool that triggers Entire hooks.
Entire CLI creates checkpoints for AI coding sessions. The system is agent-agnostic - it works with Claude Code, Gemini CLI, OpenCode, Cursor, Factory AI Droid, or any tool that triggers Entire hooks.

## Domain Model

Expand Down
2 changes: 1 addition & 1 deletion docs/security-and-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Entire stores AI session transcripts and metadata in your git repository. This d

### Where data is stored

When you use Entire with an AI agent (Claude Code, Gemini CLI, OpenCode, Cursor), session transcripts, user prompts, and checkpoint metadata are committed to a dedicated branch in your git repository (`entire/checkpoints/v1`). This branch is separate from your working branches, your code commits stay clean, but it lives in the same repository.
When you use Entire with an AI agent (Claude Code, Gemini CLI, OpenCode, Cursor, Factory AI Droid), session transcripts, user prompts, and checkpoint metadata are committed to a dedicated branch in your git repository (`entire/checkpoints/v1`). This branch is separate from your working branches, your code commits stay clean, but it lives in the same repository.

Entire also creates temporary local branches (e.g., `entire/<short-hash>`) as working storage during a session. These shadow branches store file snapshots and transcripts **without redaction**. They are cleaned up when session data is condensed (with redaction) into `entire/checkpoints/v1` at commit time. Shadow branches are **not** pushed by Entire — do not push them manually, as unredacted content would be visible on the remote.

Expand Down
8 changes: 5 additions & 3 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# E2E Tests

End-to-end tests for the `entire` CLI against real agents (Claude Code, Gemini CLI, OpenCode).
End-to-end tests for the `entire` CLI against real agents (Claude Code, Gemini CLI, OpenCode, Cursor, Factory AI Droid).

## Commands

Expand All @@ -9,6 +9,8 @@ mise run test:e2e [filter] # run filtered (or omit filt
mise run test:e2e --agent claude-code [filter] # Claude Code only
mise run test:e2e --agent gemini-cli [filter] # Gemini CLI only
mise run test:e2e --agent opencode [filter] # OpenCode only
mise run test:e2e --agent cursor [filter] # Cursor only
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The E2E agent name for Cursor in this repo is cursor-cli (see e2e/agents/cursor_cli.go and .github/workflows/e2e.yml), so mise run test:e2e --agent cursor won’t select any agent. Update these docs to use --agent cursor-cli (and keep factoryai-droid as-is).

Suggested change
mise run test:e2e --agent cursor [filter] # Cursor only
mise run test:e2e --agent cursor-cli [filter] # Cursor only

Copilot uses AI. Check for mistakes.
mise run test:e2e --agent factoryai-droid [filter] # Factory AI Droid only
go build ./... # compile check (no agent CLI needed)
```

Expand Down Expand Up @@ -46,7 +48,7 @@ e2e/

| Variable | Description | Default |
|----------|-------------|---------|
| `E2E_AGENT` | Agent to test (`claude-code`, `gemini-cli`, `opencode`) | all registered |
| `E2E_AGENT` | Agent to test (`claude-code`, `gemini-cli`, `opencode`, `cursor`, `factoryai-droid`) | all registered |
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E2E_AGENT must match the E2E agent registry names (e.g., cursor-cli, not cursor). Consider also listing other registered E2E agents that CI runs (copilot-cli, vogon) so the doc matches actual supported values.

Copilot uses AI. Check for mistakes.
| `E2E_ENTIRE_BIN` | Path to a pre-built `entire` binary | builds from source |
| `E2E_TIMEOUT` | Timeout per prompt | `2m` |
| `E2E_KEEP_REPOS` | Set to `1` to preserve temp repos after test | unset |
Expand Down Expand Up @@ -80,7 +82,7 @@ To diagnose: read `console.log` in the failing test's artifact directory. Compar

## CI Workflows

- **`.github/workflows/e2e.yml`** — Runs full suite on push to main. Matrix: `[claude, opencode, gemini]`.
- **`.github/workflows/e2e.yml`** — Runs full suite on push to main. Matrix: `[claude, opencode, gemini, cursor, factoryai-droid]`.
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow matrix list doesn’t match .github/workflows/e2e.yml: it uses claude-code, gemini-cli, cursor-cli, etc., and also includes copilot-cli. Update the matrix list here to reflect the actual agent names (or explicitly say it’s a simplified list).

Suggested change
- **`.github/workflows/e2e.yml`** — Runs full suite on push to main. Matrix: `[claude, opencode, gemini, cursor, factoryai-droid]`.
- **`.github/workflows/e2e.yml`** — Runs full suite on push to main. Simplified matrix summary: `[claude, opencode, gemini, cursor, factoryai-droid]` (see the workflow file for the exact agent IDs).

Copilot uses AI. Check for mistakes.
- **`.github/workflows/e2e-isolated.yml`** — Manual dispatch for debugging a single test. Inputs: agent + test name filter.

Both workflows run `go run ./e2e/bootstrap` before tests to handle agent-specific CI setup (auth config, warmup).