Skip to content
Merged
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
77 changes: 40 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Sessions are stored separately from your code commits on the `entire/sessions` b
A **checkpoint** is a snapshot within a session that you can rewind to—a "save point" in your work.

**When checkpoints are created:**

- **Manual-commit strategy**: When you make a git commit
- **Auto-commit strategy**: After each agent response

Expand All @@ -86,35 +87,37 @@ A **checkpoint** is a snapshot within a session that you can rewind to—a "save

Entire offers two strategies for capturing your work:

| Aspect | Manual-Commit | Auto-Commit |
|--------|---------------|-------------|
| Code commits | None on your branch | Created automatically after each agent response |
| Safe on main branch | Yes | No - creates commits |
| Rewind | Always possible, non-destructive | Full rewind on feature branches; logs-only on main |
| Best for | Most workflows - keeps git history clean | Teams wanting automatic code commits |
| Aspect | Manual-Commit | Auto-Commit |
| ------------------- | ---------------------------------------- | -------------------------------------------------- |
| Code commits | None on your branch | Created automatically after each agent response |
| Safe on main branch | Yes | No - creates commits |
| Rewind | Always possible, non-destructive | Full rewind on feature branches; logs-only on main |
| Best for | Most workflows - keeps git history clean | Teams wanting automatic code commits |

## Commands Reference

| Command | Description |
|---------|-------------|
| `entire enable` | Enable Entire in your repository (uses `manual-commit` by default) |
| `entire disable` | Remove Entire hooks from repository |
| `entire status` | Show current session and strategy info |
| `entire rewind` | Rewind to a previous checkpoint |
| `entire resume` | Resume a previous session |
| `entire explain` | Explain a session or commit |
| `entire session` | View and manage sessions (list, show details, view logs) |
| `entire version` | Show Entire CLI version |
| Command | Description |
| ---------------- | ----------------------------------------------------------------------------- |
| `entire clean` | Remove orphaned entire's data that wasn't cleaned up automatically |
| `entire disable` | Remove Entire hooks from repository |
| `entire enable` | Enable Entire in your repository (uses `manual-commit` by default) |
| `entire explain` | Explain a session or commit |
| `entire reset` | Delete the shadow branch and session state for the current HEAD commit |
| `entire resume` | Resume a previous session |
| `entire rewind` | Rewind to a previous checkpoint |
| `entire session` | View and manage sessions (list, show details, view logs) |
| `entire status` | Show current session and strategy info |
| `entire version` | Show Entire CLI version |

### `entire enable` Flags

| Flag | Description |
|------|-------------|
| `--strategy <name>` | Strategy to use: `manual-commit` (default) or `auto-commit` |
| `--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 |
| `--telemetry=false` | Disable anonymous usage analytics |
| Flag | Description |
| ------------------- | ------------------------------------------------------------------ |
| `--strategy <name>` | Strategy to use: `manual-commit` (default) or `auto-commit` |
| `--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 |
| `--telemetry=false` | Disable anonymous usage analytics |

**Examples:**

Expand Down Expand Up @@ -158,13 +161,13 @@ Personal overrides, gitignored by default:

### Configuration Options

| Option | Values | Description |
|--------|--------|-------------|
| `strategy` | `manual-commit`, `auto-commit` | Session capture strategy |
| `enabled` | `true`, `false` | Enable/disable Entire |
| `agent` | `claude-code`, `gemini`, etc. | AI agent to integrate with |
| `log_level` | `debug`, `info`, `warn`, `error` | Logging verbosity |
| `strategy_options.push_sessions` | `true`, `false` | Auto-push `entire/sessions` branch on git push |
| Option | Values | Description |
| -------------------------------- | -------------------------------- | ---------------------------------------------- |
| `strategy` | `manual-commit`, `auto-commit` | Session capture strategy |
| `enabled` | `true`, `false` | Enable/disable Entire |
| `agent` | `claude-code`, `gemini`, etc. | AI agent to integrate with |
| `log_level` | `debug`, `info`, `warn`, `error` | Logging verbosity |
| `strategy_options.push_sessions` | `true`, `false` | Auto-push `entire/sessions` branch on git push |

### Settings Priority

Expand All @@ -174,13 +177,13 @@ Local settings override project settings field-by-field. When you run `entire st

### Common Issues

| Issue | Solution |
|-------|----------|
| "Not a git repository" | Navigate to a git repository first |
| "Entire is disabled" | Run `entire enable` |
| Issue | Solution |
| ------------------------ | ----------------------------------------------------------------------------------------- |
| "Not a git repository" | Navigate to a git repository first |
| "Entire is disabled" | Run `entire enable` |
| "No rewind points found" | Work with Claude Code and commit (manual-commit) or wait for agent response (auto-commit) |
| "shadow branch conflict" | Run `entire rewind reset --force` |
| "session not found" | Check available sessions with `entire session list` |
| "shadow branch conflict" | Run `entire reset --force` |
| "session not found" | Check available sessions with `entire session list` |

### SSH Authentication Errors

Expand Down Expand Up @@ -213,7 +216,7 @@ ENTIRE_LOG_LEVEL=debug entire status

```bash
# Reset shadow branch for current commit
entire rewind reset --force
entire reset --force

# Disable and re-enable
entire disable && entire enable --force
Expand Down
2 changes: 1 addition & 1 deletion cmd/entire/cli/hooks_claudecode_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func handleSessionInitErrors(ag agent.Agent, initErr error) error {
"Starting a new session would orphan the existing work.\n\n"+
"Options:\n"+
"1. Commit your changes (git commit) to create a new base commit\n"+
"2. Run 'entire rewind reset' to discard the shadow branch and start fresh\n"+
"2. Run 'entire reset' to discard the shadow branch and start fresh\n"+
"3. Resume the existing session: %s\n\n"+
"To suppress this warning in future sessions, run:\n"+
" entire enable --disable-multisession-warning",
Expand Down
87 changes: 87 additions & 0 deletions cmd/entire/cli/reset.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package cli

import (
"errors"
"fmt"

"entire.io/cli/cmd/entire/cli/paths"
"entire.io/cli/cmd/entire/cli/strategy"
"github.com/charmbracelet/huh"
"github.com/spf13/cobra"
)

func newResetCmd() *cobra.Command {
var forceFlag bool

cmd := &cobra.Command{
Use: "reset",
Short: "Reset the shadow branch and session state for current HEAD",
Long: `Reset deletes the shadow branch and session state for the current HEAD commit.

This allows starting fresh without existing checkpoints on your current commit.

Only works with the manual-commit strategy. For auto-commit strategy,
use Git directly: git reset --hard <commit>

The command will:
- Find all sessions where base_commit matches the current HEAD
- Delete each session state file (.git/entire-sessions/<session-id>.json)
- Delete the shadow branch (entire/<commit-hash>)

Example: If HEAD is at commit abc1234567890, the command will:
1. Find all .json files in .git/entire-sessions/ with "base_commit": "abc1234567890"
2. Delete those session files (e.g., 2026-02-02-xyz123.json, 2026-02-02-abc456.json)
3. Delete the shadow branch entire/abc1234

Without --force, prompts for confirmation before deleting.`,
RunE: func(_ *cobra.Command, _ []string) error {
// Check if in git repository
if _, err := paths.RepoRoot(); err != nil {
return errors.New("not a git repository")
}

// Get current strategy
strat := GetStrategy()

// Check if strategy supports reset
resetter, ok := strat.(strategy.SessionResetter)
if !ok {
return fmt.Errorf("strategy %s does not support reset", strat.Name())
}

if !forceFlag {
var confirmed bool

form := NewAccessibleForm(
huh.NewGroup(
huh.NewConfirm().
Title("Reset session data?").
Value(&confirmed),
),
)

if err := form.Run(); err != nil {
if errors.Is(err, huh.ErrUserAborted) {
return nil
}
return fmt.Errorf("failed to get confirmation: %w", err)
}

if !confirmed {
return nil
}
}

// Call strategy's Reset method
if err := resetter.Reset(); err != nil {
return fmt.Errorf("reset failed: %w", err)
}

return nil
},
}

cmd.Flags().BoolVarP(&forceFlag, "force", "f", false, "Skip confirmation prompt")

return cmd
}
Loading