biscuit

package module
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

biscuit logo  biscuit

CI status GitHub release Downloads of the v0.1.0-alpha.5 release GPL-2.0 License

Convert an OpenAPI 3.x spec into a complete, production-ready CLI repository. An open, self-hostable alternative to the Stainless CLI generator.

biscuit generate --spec openapi.yaml --config biscuit.yaml --out ./foo-cli

Status: pre-alpha walking skeleton. The install paths below work; generation does not exist yet. See ROADMAP.md.

Install

# stable channel
brew install oxmonty/tap/biscuit-cli
npm install -g biscuit-cli             # or one-off: npx biscuit-cli

# prerelease channel (recommended until v0.1 ships)
brew install oxmonty/tap/biscuit-cli@next
npm install -g biscuit-cli@next

Either way the installed command is biscuit.

The fully-qualified brew name matters: since Homebrew 6, it trusts just this cask; a bare brew install biscuit-cli after tapping requires brew trust oxmonty/tap first.

No package manager? Install directly:

curl -fsSL https://raw.githubusercontent.com/oxmonty/biscuit/main/install.sh | bash

Or grab a binary from GitHub Releases.

Usage

biscuit version
biscuit --help

License

GPL-2.0-or-later. A generated-output exception is planned (output produced by biscuit, including code derived from its templates, will belong entirely to you under any license you choose); final wording pending legal review.

Documentation

Overview

Package biscuit converts an OpenAPI 3.x spec into a complete CLI repository. The CLI (cmd/biscuit) is the first consumer of this API. Generate is a pure function — no disk I/O, no side effects; writing the plan is the separate FilePlan.Write step. That split is what yields --dry-run for free and keeps a future hosted service a thin wrapper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config = config.Config

Config is the parsed biscuit.yaml. LoadConfig reads and validates one; unknown keys are rejected so a malformed config never mis-generates.

func LoadConfig

func LoadConfig(dir string) (*Config, error)

LoadConfig reads dir/biscuit.yaml; a missing file yields an empty config.

type Document

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

Document is a parsed, validated OpenAPI 3.x spec ready for generation.

func Load

func Load(path string) (*Document, error)

Load reads, parses, and resolves the spec at path. Blocking correctness problems (unparseable spec, unresolvable $refs, duplicate operationIds) fail the load; advisory findings are available via Diagnostics.

func (*Document) Diagnostics

func (d *Document) Diagnostics() []string

Diagnostics returns advisory findings that degrade generated-CLI quality but never block generation.

func (*Document) Operations

func (d *Document) Operations() int

Operations returns the number of path operations (webhooks not included).

func (*Document) Title

func (d *Document) Title() string

Title returns the spec's info.title.

func (*Document) Version

func (d *Document) Version() string

Version returns the OpenAPI version the spec declares (e.g. "3.1.0").

type FilePlan

type FilePlan struct {
	Files []PlannedFile // sorted by Path
}

FilePlan is the complete set of files a generation run would write.

func Generate

func Generate(_ context.Context, doc *Document, cfg *Config) (*FilePlan, error)

Generate derives the command surface from a loaded spec and renders the complete output repository. Pure: nothing is written until FilePlan.Write.

func (*FilePlan) Write

func (p *FilePlan) Write(dir string) (*WriteResult, error)

Write materializes the plan under dir, creating directories as needed.

type Operation

type Operation = config.Operation

Operation is one per-operation override entry in Config.Operations.

type PlannedFile

type PlannedFile = render.File

PlannedFile is one file in the plan. EmitOnce marks files written when absent and never overwritten (internal/custom/).

type WriteResult

type WriteResult = render.WriteResult

WriteResult reports what a Write actually touched: regeneration rewrites only files still carrying the generated-file marker, so user-owned files surface as skips instead of being clobbered.

Directories

Path Synopsis
cmd
biscuit command
internal
cli
config
Package config loads and validates biscuit.yaml, the canonical override surface.
Package config loads and validates biscuit.yaml, the canonical override surface.
ir
Package ir is biscuit's intermediate representation: the immutable, deterministic shape between spec and templates.
Package ir is biscuit's intermediate representation: the immutable, deterministic shape between spec and templates.
lint
Package lint grades a spec with vacuum and translates rule hits into generation impact: what each finding does to the generated CLI and how to fix it — in the spec if you own it, in biscuit.yaml if you don't.
Package lint grades a spec with vacuum and translates rule hits into generation impact: what each finding does to the generated CLI and how to fix it — in the spec if you own it, in biscuit.yaml if you don't.
mapping
Package mapping builds the IR from a loaded spec.
Package mapping builds the IR from a loaded spec.
render
Package render executes the embedded template tree over the IR, producing the complete file plan for a generated repository.
Package render executes the embedded template tree over the IR, producing the complete file plan for a generated repository.
spec
Package spec loads an OpenAPI 3.x document into libopenapi's model, classifying failures per biscuit's contract: blocking correctness problems (unparseable spec, unresolvable $refs, duplicate operationIds) surface as *InvalidError, while advisory findings (circular refs, $refs inside vendor extensions, resolver noise) land in Document.Diagnostics.
Package spec loads an OpenAPI 3.x document into libopenapi's model, classifying failures per biscuit's contract: blocking correctness problems (unparseable spec, unresolvable $refs, duplicate operationIds) surface as *InvalidError, while advisory findings (circular refs, $refs inside vendor extensions, resolver noise) land in Document.Diagnostics.
scripts
gendocs command
Command gendocs writes biscuit's man pages and shell completion scripts to disk so they can be bundled into release archives and Homebrew casks.
Command gendocs writes biscuit's man pages and shell completion scripts to disk so they can be bundled into release archives and Homebrew casks.
spike module
Package templates embeds the generated-repo template tree.
Package templates embeds the generated-repo template tree.

Jump to

Keyboard shortcuts

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