hof

module
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: BSD-3-Clause

README

hof - the high code framework

The hof tool tries to cover 80% of typical development activities and weave it together into a cohesive and fluid experience. Several influential design decisions permeate the tool:

  • A user writes single-source of truth (SSoT) design for expressing conceptual data models or processes at a higher level of abstraction
  • A tool reads this SSoT, the current context, and the users intent to construct as much of the implementation as possible
  • A higher level representation of data, code, cloud-native, and other building blocks will unlock development to more humans
  • _thing you can do with hof should be customizable and extensible by only editing text files and not hof source code.

[ also, the tool should definitely be built with itself ;]

GitHub Release GitHub milestone go.dev reference hof docs GitHub All Releases Gitter

CircleCI Builds SonarCloud Status SonarCloud Security SonarCloud Coverage SonarCloud Vulnerabilities

features

  • single source of truth: designs mean you can write your idea down in one place, and make all the things from that.
  • data models: create, view, diff, calculate / migrate, and manage your data models
  • code gen: generate code, data, and config from your data models and designs
  • scripting: HLS is a scripting environment between bash and python with lots of builtin helpers
  • modules: leverage modules which span languages and technologies
  • label, sets: manage labels and labelsets for resources, datamodels, (nested) labelsets, and more
  • resources: builtin and custom resources, inspired by k8s, which cover a wide range of developer needs
  • workspaces: manage all of the above with contexts on a per-project basis
  • workflow: simplified git workflow plus extras for debugging and reproducing errors
  • cuelang: powered by the logic and unification which therein lies https://cuelang.org
  • extensible: you can make your own versions of all of the things you find around here without modifying hof itself, by design.
  • your way: everything is backed by files and git, so you can use your usual tools and team practices

getting started

You will have to download hof the first time. After that hof will prompt you to update and install new releases as they become available.

# Install (Linux, Mac, Windows)
curl -LO https://github.com/hofstadter-io/hof/releases/download/v0.5.5/hof_0.5.5_$(uname)_$(uname -m)
mv hof_0.5.5_$(uname)_$(uname -m) /usr/local/bin/hof

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

# Show the help text (also seen below)
hof

# Setup hof (optional)
hof setup

You can always find the latest version from the releases page or use hof to install a specific version of itself with hof update --version vX.Y.Z.

Modules and Examples

Projects:

  • This project uses itself to generate various pieces like the cli structure and the release process.

Modules:

  • hofmod-model - A module for representing common types and their relations.
  • hofmod-cli - Create CLI infrastructure based on the Golang Cobra library.
  • hofmod-releaser - Release code or binaries to GitHub and Docker with minimal configuration. Based on GoReleaser.
  • hofmod-config - Cloud native config and secret files using the Golang Viper library and adding dynamic reload in Kubernetes.
  • hofmod-rest - Generate Golang REST servers that are ready for production. This makes use of many of the other modules here.
  • hofmod-hugo - Create documentation sites with Hugo and Docsy

top-level commands

hof has a wide range of top level commands that span an equally wide range of typical developer activities. The goal here is to capture the 80% and weave it together into a cohesive experience.

hof - a polyglot tool for building software

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

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


Initialize and create new hof workspaces:
  init            β     create an empty workspace or initialize an existing directory to one
  clone           β     clone a workspace or repository into a new directory

Model your designs, generate implementation, run or test anything:
  datamodel       α     create, view, diff, calculate / migrate, and manage your data models
  gen             ✓     generate code, data, and config from your data models and designs
  run             α     Hof Line Script (HLS) is a successor to bash and python based scripting
  test            α     test all sorts of things

Labels are used _ for _ (see also 'hof topic labels'):
  label           α     manage labels for resources and more
  labelset        α     group resources, datamodels, labelsets, and more

Learn more about hof and the _ you can do:
  each command has four flags, use 'list' to see available
  --help                print help message
  --topics              addtional help topics
  --examples            examples for the command
  --tutorials           tutorials for the command

Download modules, add instances or content, and manage runtimes:
  mod             β     mod subcmd is a polyglot dependency management tool based on go mods
  add             α     add dependencies and new components to the current module or workspace
  runtimes        α     work with runtimes (go, js, py, bash, docker, cloud-vms, k8s, custom)

Manage resources (see also 'hof topic resources'):
  info            α     print information about known resources
  create          α     create resources
  get             α     find and display resources
  set             α     find and configure resources
  edit            α     edit resources
  delete          α     delete resources

Configure, Unify, Execute (see also https://cuelang.org):
  cmd             α     run commands from the scripting layer and your _tool.cue files
  def             α     print consolidated definitions
  eval            α     print consolidated definitions
  export          α     export your data model to various formats
  fmt             α     formats code and files
  import          α     convert other formats and systems to hofland
  trim            α     cleanup code, configuration, and more
  vet             α     validate data
  st              α     recursive diff, merge, mask, pick, and query helpers for Cue

Manage logins, config, secrets, and context:
  auth            Ø     authentication subcommands
  config          β     manage local configurations
  secret          β     manage local secrets
  context         α     get, set, and use contexts

Examine workpsace history and state:
  status          α     show workspace information and status
  log             α     show workspace logs and history
  diff            α     show the difference between workspace versions
  bisect          α     use binary search to find the commit that introduced a bug

Grow, mark, and tweak your shared history (see also 'hof topic changesets'):
  include         α     include changes into the changeset
  branch          α     list, create, or delete branches
  checkout        α     switch branches or restore working tree files
  commit          α     record changes to the repository
  merge           α     join two or more development histories together
  rebase          α     reapply commits on top of another base tip
  reset           α     reset current HEAD to the specified state
  tag             α     create, list, delete or verify a tag object signed with GPG

Collaborate (see also 'hof topic collaborate'):
  fetch           α     download objects and refs from another repository
  pull            α     fetch from and integrate with another repository or a local branch
  push            α     update remote refs along with associated objects
  propose         α     propose to incorporate your changeset in a repository
  publish         α     publish a tagged version to a repository
  remotes         α     manage remote repositories

Local development commands:
  reproduce       Ø     Record, share, and replay reproducible environments and processes
  jump            α     Jumps help you do things with fewer keystrokes.
  ui              Ø     Run hof's local web ui
  tui             Ø     Run hof's terminal ui
  repl            Ø     Run hof's local REPL
  pprof                 go pprof by setting HOF_CPU_PROFILE="hof-cpu.prof" hof <cmd>


Send us feedback or say hello:
  feedback        Ø     send feedback, bug reports, or any message :]
                        you can also chat with us on https://gitter.im/hofstadter-io

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

(✓) command is generally available
(β) command is beta and ready for testing
(α) command is alpha and under developmenr
(Ø) command is null and yet to be implemented

Flags:
      --account string               the account context to use during this hof execution
  -E, --all-errors                   print all available errors
      --billing string               the billing context to use during this hof execution
      --config string                Path to a hof configuration file
      --context string               The of an entry in the context file
      --context-file string          The path to a hof context file
      --datamodel-dir string         directory for discovering resources
      --error strings                error streams, depending on the command context
      --error-format string          error format, defaults to cue
      --example string               examples for this command, 'list' will print available examples
      --global                       Operate using only the global config/secret context
  -h, --help                         help for hof
      --ignore                       proceed in the presence of errors
      --impersonate-account string   account to impersonate for this hof execution
  -i, --input strings                input streams, depending on the command context
  -I, --input-format string          input format, defaults to infered
  -l, --label strings                Labels for use across all commands
      --local                        Operate using only the local config/secret context
      --log-http string              used to help debug issues
  -o, --output strings               output streams, depending on the command context
  -O, --output-format string         output format, defaults to cue
  -p, --package string               the package context to use during this hof execution
      --project string               the project context to use during this hof execution
  -q, --quiet                        turn off output and assume defaults at prompts
      --repl                         run the command from the hof repl
      --resources-dir string         directory for discovering resources
      --runtimes-dir string          directory for discovering runtimes
      --secret string                The path to a hof secret file
  -S, --simplify                     simplify output
      --strict                       report errors for lossy mappings
      --topic string                 help topics for this command, 'list' will print available topics
      --trace                        trace cue computation
  -T, --trace-token string           used to help debug issues
      --tui                          run the command from the terminal ui
      --tutorial string              tutorials for this command, 'list' will print available tutorials
  -v, --verbose string               set the verbosity of output
      --web                          run the command from the web ui
      --workspace string             the workspace context to use during this hof execution

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

Directories

Path Synopsis
cmd
hof
gen
lib
connector
Package connector ...
Package connector ...
datamodel
package datamodel - for modeling and managing that model
package datamodel - for modeling and managing that model
gen
gotils/cache
Package cache implements a build artifact cache.
Package cache implements a build artifact cache.
gotils/cmd/txtar-addmod
The txtar-addmod command adds a module as a txtar archive to the a testdata module directory as understood by the goproxytest package (see https://godoc.org/github.com/hofstadter-io/hof/lib/gotils/goproxytest).
The txtar-addmod command adds a module as a txtar archive to the a testdata module directory as understood by the goproxytest package (see https://godoc.org/github.com/hofstadter-io/hof/lib/gotils/goproxytest).
gotils/cmd/txtar-c
The txtar-c command archives a directory tree as a txtar archive printed to standard output.
The txtar-c command archives a directory tree as a txtar archive printed to standard output.
gotils/cmd/txtar-goproxy
The txtar-goproxy command runs a Go module proxy from a txtar module directory (as manipulated by the txtar-addmod command).
The txtar-goproxy command runs a Go module proxy from a txtar module directory (as manipulated by the txtar-addmod command).
gotils/cmd/txtar-x
The txtar-x command extracts a txtar archive to a filesystem.
The txtar-x command extracts a txtar archive to a filesystem.
gotils/dirhash
Package dirhash defines hashes over directory trees.
Package dirhash defines hashes over directory trees.
gotils/fmtsort
Package fmtsort provides a general stable ordering mechanism for maps, on behalf of the fmt and text/template packages.
Package fmtsort provides a general stable ordering mechanism for maps, on behalf of the fmt and text/template packages.
gotils/goproxytest
Package goproxytest serves Go modules from a proxy server designed to run on localhost during tests, both to make tests avoid requiring specific network servers and also to make them significantly faster.
Package goproxytest serves Go modules from a proxy server designed to run on localhost during tests, both to make tests avoid requiring specific network servers and also to make them significantly faster.
gotils/gotooltest
Package gotooltest implements functionality useful for testing tools that use the go command.
Package gotooltest implements functionality useful for testing tools that use the go command.
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/modfile
Package modfile implements parsing and formatting for go.mod files.
Package modfile implements parsing and formatting for go.mod files.
gotils/module
Package module defines the module.Version type along with support code.
Package module defines the module.Version type along with support code.
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/semver
Package semver implements comparison of semantic version strings.
Package semver implements comparison of semantic version strings.
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.
labels
Should be able to query select by labels and then apply one more more lables So basically "Get" with label changes, will need to expand to some CRUD ops almost their own thing, but want some real flexibility here
Should be able to query select by labels and then apply one more more lables So basically "Get" with label changes, will need to expand to some CRUD ops almost their own thing, but want some real flexibility here
mod
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.
ops
resources
package resources - for working with hof stuff and crds Resources are a conceptualization around things and bringing some consistency in how difinitions are written.
package resources - for working with hof stuff and crds Resources are a conceptualization around things and bringing some consistency in how difinitions are written.
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.
shell
Package ishell implements an interactive shell.
Package ishell implements an interactive shell.

Jump to

Keyboard shortcuts

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