sync

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sync provides formatted output helpers for the sync command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxSyncAction

func CtxSyncAction(cmd *cobra.Command, index int, actionType, description, suggestion string)

CtxSyncAction prints a single sync action item with optional suggestion.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • index: 1-based action number.
  • actionType: Action type label (e.g. "DEPS", "CONFIG").
  • description: Action description.
  • suggestion: Optional suggestion text (empty string skips).

func CtxSyncHeader

func CtxSyncHeader(cmd *cobra.Command, dryRun bool)

CtxSyncHeader prints the sync analysis heading and optional dry-run notice.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • dryRun: If true, includes the dry-run notice.

func CtxSyncInSync

func CtxSyncInSync(cmd *cobra.Command)

CtxSyncInSync prints the all-clear message when context is in sync.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.

func CtxSyncSummary

func CtxSyncSummary(cmd *cobra.Command, count int, dryRun bool)

CtxSyncSummary prints the sync summary with item count.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • count: Number of sync items found.
  • dryRun: If true, shows the dry-run variant.

func DryRun

func DryRun(cmd *cobra.Command, sourcePath, mirrorPath string, hasDrift bool)

DryRun prints the full dry-run plan block: header, source path, mirror path, and drift status.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • sourcePath: absolute path to MEMORY.md.
  • mirrorPath: relative mirror path.
  • hasDrift: whether the source has changed since last sync.

func ErrAutoMemoryNotActive

func ErrAutoMemoryNotActive(cmd *cobra.Command, cause error)

ErrAutoMemoryNotActive prints an informational stderr message when auto memory discovery fails.

Parameters:

  • cmd: Cobra command whose stderr stream receives the message. Nil is a no-op.
  • cause: the discovery error to display.

func Result

func Result(
	cmd *cobra.Command,
	sourceLabel, mirrorPath, sourcePath, archivedTo string,
	sourceLines, mirrorLines int,
)

Result prints the full sync result block: optional archive notice, synced confirmation, source path, line counts, and optional new content.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • sourceLabel: source label (e.g. "MEMORY.md").
  • mirrorPath: relative mirror path.
  • sourcePath: absolute source path for display.
  • archivedTo: archive basename, or empty if no archive was created.
  • sourceLines: current source line count.
  • mirrorLines: previous mirror line count.

Types

This section is empty.

Jump to

Keyboard shortcuts

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