Recollect.Context.Detector (recollect v0.5.1)

Copy Markdown View Source

Detect current environment context from the running system.

Supports: Git repository, working directory, OS, and custom context.

All detector functions are pure — no side effects, easy to test.

Summary

Functions

List available detectors.

Check if a given entry's context hints match the current context.

Detect all available context signals.

Detect only git context (safe to call even outside a repo).

Detect the operating system.

Detect the current working directory.

Functions

available_detectors()

List available detectors.

context_matches(entry_hints, current_context)

Check if a given entry's context hints match the current context.

Returns the number of matching keys.

detect()

Detect all available context signals.

Returns a map with detected context values: %{ repo: "owner/repo", branch: "main", path_prefix: "/home/user/project", os: "linux" }

detect_git()

Detect only git context (safe to call even outside a repo).

detect_os()

Detect the operating system.

detect_path()

Detect the current working directory.