hook

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 hook provides terminal output functions for the hook command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockResponse

func BlockResponse(cmd *cobra.Command, response string)

BlockResponse prints a JSON block response line. Nil cmd is a no-op.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • response: JSON-encoded block response.

func Content

func Content(cmd *cobra.Command, content string)

Content prints raw hook content to stdout.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • content: Pre-rendered content string.

func HookContext

func HookContext(cmd *cobra.Command, response string)

HookContext prints a JSON hook response line. Nil cmd is a no-op.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • response: JSON-encoded hook response.

func InfoCopilotCreated

func InfoCopilotCreated(cmd *cobra.Command, targetFile string)

InfoCopilotCreated reports that copilot instructions were created.

Parameters:

  • cmd: Cobra command for output
  • targetFile: Path to the created file

func InfoCopilotMerged

func InfoCopilotMerged(cmd *cobra.Command, targetFile string)

InfoCopilotMerged reports that copilot instructions were merged into an existing file.

Parameters:

  • cmd: Cobra command for output
  • targetFile: Path to the merged file

func InfoCopilotSessionsDir

func InfoCopilotSessionsDir(cmd *cobra.Command, sessionsDir string)

InfoCopilotSessionsDir reports that the sessions directory was created.

Parameters:

  • cmd: Cobra command for output
  • sessionsDir: Path to the sessions directory

func InfoCopilotSkipped

func InfoCopilotSkipped(cmd *cobra.Command, targetFile string)

InfoCopilotSkipped reports that copilot instructions were skipped because the ctx marker already exists in the target file.

Parameters:

  • cmd: Cobra command for output
  • targetFile: Path to the existing file

func InfoCopilotSummary

func InfoCopilotSummary(cmd *cobra.Command)

InfoCopilotSummary prints the post-write summary for copilot.

Parameters:

  • cmd: Cobra command for output

func InfoTool

func InfoTool(cmd *cobra.Command, content string)

InfoTool prints a tool integration section to stdout.

The content is a pre-formatted multi-line text block loaded from commands.yaml. A trailing newline is not added: the content is expected to include its own formatting.

Parameters:

  • cmd: Cobra command for output
  • content: Pre-formatted text block

func InfoUnknownTool

func InfoUnknownTool(cmd *cobra.Command, tool string)

InfoUnknownTool prints the unknown tool message.

Parameters:

  • cmd: Cobra command for output
  • tool: The unrecognized tool name

func Nudge

func Nudge(cmd *cobra.Command, nudgeBox string)

Nudge prints a pre-built nudge box to stdout.

Used by system hooks to emit nudge messages through the write layer rather than calling cmd.Println directly.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • nudgeBox: fully formatted nudge box string.

func NudgeBlock

func NudgeBlock(cmd *cobra.Command, nudgeBox string)

NudgeBlock prints a nudge box followed by an empty line. Empty box or nil cmd is a no-op.

Parameters:

  • cmd: Cobra command for output. Nil is a no-op.
  • nudgeBox: fully formatted nudge box string.

func Separator

func Separator(cmd *cobra.Command)

Separator prints a blank line between hook output sections.

Parameters:

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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