codex

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package codex provides helpers for OpenAI Codex hook commands.

Index

Constants

View Source
const (
	// DefaultAssistantName is the product name used in generated commit trailers.
	DefaultAssistantName = "OpenAI Codex"

	// DefaultUnknownModel is used when Codex hook input omits the active model.
	DefaultUnknownModel = "unknown-model"
)

Variables

This section is empty.

Functions

func GeneratedWithContext

func GeneratedWithContext(assistantName, model string) string

GeneratedWithContext returns developer context that asks Codex to include detailed commit messages and a model-specific Generated-with trailer.

func GeneratedWithTrailer

func GeneratedWithTrailer(assistantName, model string) string

GeneratedWithTrailer returns the commit trailer for the given model.

func RunGeneratedWith

func RunGeneratedWith(r io.Reader, w io.Writer, assistantName, unknownModel string) error

RunGeneratedWith reads Codex hook input from r and writes Codex hook output to w.

Types

type HookInput

type HookInput struct {
	HookEventName string `json:"hook_event_name,omitempty"`
	Model         string `json:"model,omitempty"`
}

HookInput is the subset of Codex hook input used by the generated-with hook.

type HookOutput

type HookOutput struct {
	HookSpecificOutput HookSpecificOutput `json:"hookSpecificOutput"`
}

HookOutput is the Codex hook output shape for adding developer context.

func NewGeneratedWithOutput

func NewGeneratedWithOutput(assistantName, model string) HookOutput

NewGeneratedWithOutput builds the SessionStart hook output for the model.

type HookSpecificOutput

type HookSpecificOutput struct {
	HookEventName     string `json:"hookEventName"`
	AdditionalContext string `json:"additionalContext"`
}

HookSpecificOutput is the Codex hook-specific output payload.

Jump to

Keyboard shortcuts

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