agentleFS
entireioentireio/cli/.github/copilot-instructions.md

cli

Copilot instructions5.2k starsChanged 5 months agoMITView on GitHub

Entire CLI is a Go CLI tool that captures AI coding agent sessions (Claude Code, Codex, Antigravity, OpenCode, Cursor, Factory AI Droid, Copilot CLI, 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) All commands use mise as the task runner. Always run these in order before committing: CI runs these checks…

Trending

Quiet since September.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 7 mentionsMar 2026: 2 mentionsApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 6 mentionsAug 2026: 10 mentionsSep 2026: 9 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the entireio/cli repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about entireio/cli

The biggest 5 of 36 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 36

Talked about on GitHub, Hacker News and Bluesky (36 times).

On GitHub · 32

27 more on GitHub

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

19 rules. About 0 are common, 9 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All commands use mise as the task runner.

    line 11
  2. Very specific:

    All tests with race detection (mise run test:ci)

    line 24
  3. Very specific:

    Internal/debug logging: Use logging.Debug/Info/Warn/Error(ctx, msg, attrs...) from cli/logging/.

    line 88
  4. Very specific:

    User-facing output: Use fmt.Fprint*(cmd.OutOrStdout(), ...) or cmd.ErrOrStderr().

    line 89
  5. Very specific:

    Don't use fmt.Print* for operational messages (checkpoint saves, hook invocations) - use the logging package.

    line 91
  6. Distinctive:

    Privacy: Don't log user content (prompts, file contents, commit messages).

    line 93
  7. Distinctive:

    Use the task-specific reference map to find detailed architecture and development documentation.

    line 114
  8. Distinctive:

    Write tests that provide real value, not just coverage:

    line 118
  9. Distinctive:

    Include edge cases and error conditions: - ensure error paths are properly tested

    line 121
  10. Very specific:

    Run mise run test for quick validation, mise run test:ci for full CI parity.

    line 126
  11. Very specific:

    Test accessibility features with ACCESSIBLE=1 environment variable.

    line 128
  12. Distinctive:

    All errors must be handled explicitly

    line 133
  13. Distinctive:

    No unused variables/imports

    line 134
  14. Distinctive:

    Test files are exempt from some linters (gosec, wrapcheck, forbidigo)

    line 136
  15. Very specific:

    Run mise run lint:full to check all code (not just new issues).

    line 138
  16. Very specific:

    Add command in cmd/entire/cli/ following existing patterns (look at similar commands)

    line 142
  17. Very specific:

    Use SilentError for custom error messages

    line 144
  18. Distinctive:

    Add meaningful tests that verify behavior

    line 145
  19. Distinctive:

    Consider integration tests if command has complex git interactions

    line 146

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions for Entire CLI

Repository Overview

Entire CLI is a Go CLI tool that captures AI coding agent sessions (Claude Code, Codex, Antigravity, OpenCode, Cursor, Factory AI Droid, Copilot CLI, 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)

Build & Validation Commands

All commands use mise as the task runner. Always run these in order before committing:

mise run fmt           # Format with gofmt (required - CI will fail otherwise)
mise run lint          # Lint with golangci-lint (only new issues)
mise run test          # Unit tests
mise run test:ci       # Full tests with race detection (same as CI)

CI runs these checks on every PR (see .github/workflows/):

  1. gofmt formatting check (must pass - no unformatted files)
  2. golangci-lint
  3. go.mod tidy check
  4. All tests with race detection (mise run test:ci)

Critical Code Patterns

Error Handling

The CLI uses SilentError to avoid duplicate error output (see errors.go):

// When you print a custom error message, return SilentError
fmt.Fprintln(cmd.ErrOrStderr(), "User-friendly error message")
return NewSilentError(errors.New("internal error"))

// For normal errors, just return them - main.go will print
return fmt.Errorf("failed to do X: %w", err)

Forbidden go-git Operations

NEVER use go-git v5's Reset or Checkout directly - they delete .gitignored directories.

// WRONG - deletes .entire/ and .worktrees/
worktree.Reset(&git.ResetOptions{Mode: git.HardReset, Commit: hash})
worktree.Checkout(&git.CheckoutOptions{Branch: ref})

// CORRECT - use CLI wrappers from strategy/common.go and git_operations.go
HardResetWithProtection(hash)
CheckoutBranch(branch)

Path Handling

NEVER use os.Getwd() for git-relative paths - breaks when running from subdirectories.

// WRONG - breaks in subdirectories
cwd, _ := os.Getwd()
absPath := filepath.Join(cwd, gitRelativePath)

// CORRECT - always use repo root
repoRoot, _ := paths.RepoRoot()
absPath := filepath.Join(repoRoot, gitRelativePath)

The linter enforces these patterns via forbidigo rules in .golangci.yaml.

Accessibility

Interactive prompts must support screen readers:

// In cli package - use NewAccessibleForm()
form := NewAccessibleForm(huh.NewGroup(...))

// Outside cli (including strategy) - use cmd/entire/cli/uiform
form := uiform.New(huh.NewGroup(...))

Both helpers apply accessibility and theming centrally. Do not hand-roll IsAccessibleMode / WithAccessible wiring at call sites.

Logging vs User Output

  • Internal/debug logging: Use logging.Debug/Info/Warn/Error(ctx, msg, attrs...) from cli/logging/. Writes to .entire/logs/.
  • User-facing output: Use fmt.Fprint*(cmd.OutOrStdout(), ...) or cmd.ErrOrStderr().

Don't use fmt.Print* for operational messages (checkpoint saves, hook invocations) - use the logging package.

Privacy: Don't log user content (prompts, file contents, commit messages). Log only operational metadata (IDs, counts, paths, durations).

Project Structure

cmd/entire/
├── main.go           # Entry point
└── cli/              # Main CLI package
    ├── strategy/     # Session checkpoint strategies (strategy pattern)
    ├── checkpoint/   # Low-level storage operations
    ├── session/      # Session state management (.git/entire-sessions/)
    ├── agent/        # AI agent abstraction layer
    ├── paths/        # Path utilities (RepoRoot)
    └── integration_test/  # Integration tests (//go:build integration)

Key configuration files:

  • mise.toml - Task definitions and Go version
  • .golangci.yaml - Linting rules (forbidigo patterns for unsafe operations)
  • go.mod - Module dependencies

Use the task-specific reference map to find detailed architecture and development documentation.

Testing Guidelines

Write tests that provide real value, not just coverage:

  • Test behavior, not implementation - tests should validate what the code does, not how
  • Include edge cases and error conditions - ensure error paths are properly tested
  • When fixing bugs, write a test that surfaces the bug first - then write the fix
  • Unit tests: Same directory as source, *_test.go files
  • Integration tests: cmd/entire/cli/integration_test/, require //go:build integration tag

Run mise run test for quick validation, mise run test:ci for full CI parity.

Test accessibility features with ACCESSIBLE=1 environment variable.

Linting Notes

The linter is strict (many linters enabled). Key rules:

  • All errors must be handled explicitly
  • No unused variables/imports
  • wrapcheck requires wrapping errors from external packages
  • Test files are exempt from some linters (gosec, wrapcheck, forbidigo)

Run mise run lint:full to check all code (not just new issues).

When Adding New Commands

  1. Add command in cmd/entire/cli/ following existing patterns (look at similar commands)
  2. Register in root.go
  3. Use SilentError for custom error messages
  4. Add meaningful tests that verify behavior
  5. Consider integration tests if command has complex git interactions

Trust These Instructions

These instructions are verified and accurate. Only search the codebase if information here is incomplete or found to be incorrect during execution.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.