codex

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package codex is the pilot third-party adapter built on the adapter contract (internal/adapter/structproj) and the TOML codec (internal/tomlutil). It projects declared MCP servers targeting "codex" into ~/.codex/config.toml as [mcp_servers.<name>] tables, surgically and idempotently, without duplicating the Claude/OpenCode control flow — the adapter supplies only its file path, key mapping, and codec; all plan/apply/observe logic lives in the contract.

Index

Constants

View Source
const Tool = "codex"

Tool is the adapter/target name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter projects config into Codex's ~/.codex/config.toml.

func New

func New(home string) *Adapter

New builds a Codex adapter rooted at home ($HOME).

func (*Adapter) Apply

func (a *Adapter) Apply(_ *config.Config, cs adapter.ChangeSet, res *secret.Resolver, st *state.State) error

Apply writes managed MCP tables into config.toml (only when a managed key changed), preserving unmanaged content, and records state.

func (*Adapter) Name

func (a *Adapter) Name() string

Name identifies the tool.

func (*Adapter) ObserveHashes

func (a *Adapter) ObserveHashes(st *state.State) (map[string]string, error)

ObserveHashes re-hashes each recorded MCP key still present in config.toml.

func (*Adapter) Plan

func (a *Adapter) Plan(c *config.Config, st *state.State) (adapter.ChangeSet, error)

Plan diffs desired MCP servers against config.toml and recorded state.

Jump to

Keyboard shortcuts

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