configgen

package
v1.0.40468-pre Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package configgen renders a CircleCI pipeline YAML from a reposcan.Result and writes it to disk. It backs `circleci config generate` and is reusable by other commands (e.g. an onboarding wrapper) that already have a scan result in hand and want to write the config without re-scanning.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, dir string, result *reposcan.Result) error

Generate writes a CircleCI pipeline config to <dir>/.circleci/config.yml from a pre-computed scan result. It marshals the pipeline YAML, creates the .circleci/ directory if missing, writes the file atomically (temp file + rename), and prints a "Generated <path>" line to stderr.

Callers are responsible for any preamble output and the "config already exists" short-circuit; Generate will overwrite an existing file.

Errors are returned as structured CLIErrors so the CLI's top-level handler can render them consistently.

func RenderWriteFailedPrompt

func RenderWriteFailedPrompt(stack, image, targetPath, errMsg string) string

RenderWriteFailedPrompt returns the POC prompt shown when writing the generated config to disk fails. The user is expected to paste this into an AI assistant to diagnose the filesystem-level cause.

Types

This section is empty.

Jump to

Keyboard shortcuts

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