hof

module
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0

README

hof - the higher order framework

A tool that unifies data models, schemas, code generation, and a task engine.

hof is a CLI tool you add to your workflow.

  • Augment data, config, and schemas with CUE to improve consistency, gain confidence, and unlock new possibilities
  • Generate multiple Yaml and JSON files in one-shot, from a CUE based source of truth
  • Generate much of the application code, work directly in the output, regenerate without loss
  • Explore data or config with the TUI, work with it using CUE in live-reload mode
  • Run workflows with automatic task dependency inference, the right tasks are run in the right order
Core Features
code generation Data + templates = _ (anything), technology agnostic
data modeling Define, checkpoint, and diff data models
task engine Extensible task and DAG workflow engine
CUE cmds Core def, eval, export, and vet commands
creators bootstraping and starter kits from any repo
modules CUE module dependency management
tui A terminal interface to Hof and CUE
chat Combine LLM and Hof code gen for better, scalable results

hof uses CUE to power the DX and implementation. We believe CUE is a great language for specifying schemas, configuration, and generally for writing anything declarative or this is a source of truth. It has good theory and comes from the same people that brought us containers, Go, and Kubernetes.

Learn more about CUE: cuelang.org | cuetorials.com

Documentation

Please see docs.hofstadter.io to learn more.

The getting-started section will take you on a tour of hof. The the-walkthrough section shows you how to build and use a generator.

Join us or ask questions on

We also use GitHub issues and discussions. Use which every is easiest for you!

Installation

You can find the latest downloads on our GitHub releases page. This is the preferred method.

If you already have hof, install a specific version with hof update --version vX.Y.Z.

# Homebrew
brew install hofstadter-io/tap/hof

# Shell Completions (bash, zsh, fish, power-shell)
echo ". <(hof completion bash)" >> $HOME/.profile
source $HOME/.profile

# Show the help text or version info to verify installation
hof --help
hof version

Contributing & Community

Interested in helping out or hanging out? The best ways to get started are

  1. Joining the Community
  2. The Contributing Guild

Interfaces

There are two interfaces to hof

  1. a CLI - great for scripting and automation
  2. a TUI - great for exploring and designing

A desktop version is in the works, reach out if you would like early access.

cli
hof - the higher order framework

  Learn more at https://docs.hofstadter.io

Usage:
  hof [flags] [command] [args]

Main commands:
  chat                  co-create with AI (alpha)
  create                starter kits or blueprints from any git repo
  datamodel             manage, diff, and migrate your data models
  def                   print consolidated CUE definitions
  eval                  evaluate and print CUE configuration
  export                output data in a standard format
  flow                  run workflows and tasks powered by CUE
  fmt                   format any code and manage the formatters
  gen                   CUE powered code generation
  mod                   CUE module dependency management
  tui                   a terminal interface to Hof and CUE
  vet                   validate data with CUE

Additional commands:
  help                  help about any command
  update                check for new versions and run self-updates
  version               print detailed version information
  completion            generate completion helpers for your terminal
  feedback              open an issue or discussion on GitHub

Flags:
  -E, --all-errors           print all available errors
  -h, --help                 help for hof
  -i, --ignore-errors        turn off output and assume defaults at prompts
  -D, --include-data         auto include all data files found with cue files
  -V, --inject-env           inject all ENV VARs as default tag vars
  -I, --input stringArray    extra data to unify into the root value
  -p, --package string       the Cue package context to use during execution
  -l, --path stringArray     CUE expression for single path component when placing data files
  -q, --quiet                turn off output and assume defaults at prompts
  -d, --schema stringArray   expression to select schema to apply to data files
      --stats                print generator statistics
  -0, --stdin-empty          A flag that ensure stdin is zero and does not block
  -t, --tags stringArray     @tags() to be injected into CUE code
  -v, --verbosity int        set the verbosity of output
      --with-context         add extra context for data files, usable in the -l/path flag

Use "hof [command] --help / -h" for more information about a command.
tui

The hof tui is a terminal based interface to Hof's features. It has a built in help system and documentation. The following YouTube video provides a tour.

Tour Hof's TUI

Directories

Path Synopsis
ci
cmd
hof
cmd
context
This package provides a context for Tasks and a registry for their usage in flows.
This package provides a context for Tasks and a registry for their usage in flows.
lib
connector
Package connector ...
Package connector ...
diff3
Package diff3 implements a three-way merge algorithm Original version in Javascript by Bryan Housel @bhousel: https://github.com/bhousel/node-diff3, which in turn is based on project Synchrotron, created by Tony Garnock-Jones.
Package diff3 implements a three-way merge algorithm Original version in Javascript by Bryan Housel @bhousel: https://github.com/bhousel/node-diff3, which in turn is based on project Synchrotron, created by Tony Garnock-Jones.
fmt
gen
gotils/auth
Package auth provides access to user-provided authentication credentials.
Package auth provides access to user-provided authentication credentials.
gotils/browser
Package browser provides utilities for interacting with users' browsers.
Package browser provides utilities for interacting with users' browsers.
gotils/intern/syscall/windows/sysdll
Package sysdll is an internal leaf package that records and reports which Windows DLL names are used by Go itself.
Package sysdll is an internal leaf package that records and reports which Windows DLL names are used by Go itself.
gotils/intern/textutil
package textutil contains text processing utilities.
package textutil contains text processing utilities.
gotils/lockedfile
Package lockedfile creates and manipulates files whose contents should only change atomically.
Package lockedfile creates and manipulates files whose contents should only change atomically.
gotils/lockedfile/internal/filelock
Package filelock provides a platform-independent API for advisory file locking.
Package filelock provides a platform-independent API for advisory file locking.
gotils/mmap
The mmap package provides an abstraction for memory mapping files on different platforms.
The mmap package provides an abstraction for memory mapping files on different platforms.
gotils/par
Package par implements parallel execution helpers.
Package par implements parallel execution helpers.
gotils/renameio
Package renameio writes files atomically by renaming temporary files.
Package renameio writes files atomically by renaming temporary files.
gotils/robustio
Package robustio wraps I/O functions that are prone to failure on Windows, transparently retrying errors up to an arbitrary timeout.
Package robustio wraps I/O functions that are prone to failure on Windows, transparently retrying errors up to an arbitrary timeout.
gotils/testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
gotils/txtar
Package txtar implements a trivial text-based file archive format.
Package txtar implements a trivial text-based file archive format.
hof
This package manages the #hof: _ configuration and the various @<hof>() attributes
This package manages the #hof: _ configuration and the various @<hof>() attributes
mod
mod/mvs
Package mvs implements Minimal Version Selection.
Package mvs implements Minimal Version Selection.
mod/parse/lazyregexp
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
Package lazyregexp is a thin wrapper over regexp, allowing the use of global regexp variables without forcing them to be compiled at init.
tui
tui/hoc/layouts/panels
Panels Layout is a Flex widget with hidable panels and a main content.
Panels Layout is a Flex widget with hidable panels and a main content.
tui/tview
Package tview implements rich widgets for terminal based user interfaces.
Package tview implements rich widgets for terminal based user interfaces.
yagu/configdir
Package configdir provides a cross platform means of detecting the system's configuration directories.
Package configdir provides a cross platform means of detecting the system's configuration directories.
yagu/par
Package par implements parallel execution helpers.
Package par implements parallel execution helpers.
Package testscript provides support for defining filesystem-based tests by creating scripts in a directory.
Package testscript provides support for defining filesystem-based tests by creating scripts in a directory.
test

Jump to

Keyboard shortcuts

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