cursor

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cursor is the Cursor IDE adapter for agent-memory. It bundles a worked Cursor-rule (.mdc) file teaching the editor's agent when and how to call memory.fetch_context / memory.propose_update, plus an Install function that drops the file at the documented location.

Cursor reads .mdc files from .cursor/rules/ (project-local) and from ~/.cursor/rules/ (user-global). Both are supported here.

Index

Constants

View Source
const AdapterName = "cursor"

AdapterName is the stable identifier used by `agent-memory install <name>`.

Variables

This section is empty.

Functions

func RuleContent

func RuleContent() []byte

RuleContent returns the embedded .mdc bytes verbatim. Used by tests and by future `install cursor --print`.

Types

type Options

type Options struct {
	Root       string
	UserGlobal bool
	Force      bool
	HomeDir    string
}

Options mirrors the same shape used by every adapter package.

type Result

type Result struct {
	Adapter string   `json:"adapter"`
	Files   []string `json:"files,omitempty"`
	Skipped []string `json:"skipped,omitempty"`
}

Result reports what Install did. Same shape as claude/agents/gemini so the CLI dispatch layer can render results uniformly.

func Install

func Install(opts Options) (*Result, error)

Install writes the embedded agent-memory.mdc to the chosen rules directory, creating intermediate directories as needed. Existing files are preserved unless Force is set.

Symmetric with claude's Install: same return-result contract, "skipped because already present" reported in Result.Skipped (not as an error).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL