Getting startedSlide 3 of 86
3hiveGetting started

Every command

Eight commands take an entrypoint, and each is taught later, where it belongs:

  • hive check, hive run and hive build, the three above. build also takes --target <goos>/<goarch> to build for another platform.
  • hive test runs every test block the program reaches, side by side, and reports coverage. --threads N says how many run at once.
  • hive emit prints the Go a program compiles to, and needs no Go toolchain.
  • hive analyze scores what each proc and func will cost to run, lists what the program declares and never reaches, and writes a page of findings beside the entrypoint.
  • hive container writes a Dockerfile that builds the program and runs it.
  • hive install builds the program and moves it where a shell finds commands, so it runs by name, under --name if one is given.
  • hive export --target android/arm64 packages a windowed program as an installable Android app.

Three take nothing: hive version prints which release this is, hive agents writes .hivedocs/ (a page per feature, for a coding agent to read) into the current folder, and hive lsp is the language server an editor starts, set up on the next slide. hive alone lists them all.

A command refuses anything it does not take rather than ignoring it: a flag it has no use for, a second file, a command that does not exist. The mistake is in what was typed, not in any source, so these messages start with hive:, and the command exits non-zero.

$ hive emit hello.hive > main.go

$ hive check hello.hive --verbose
hive: `hive check` takes an entrypoint and nothing else. `--verbose` was given to it.

$ hive chekc hello.hive
hive: `chekc` is not a command. `hive` alone lists the ones there are.

$ hive build
hive: `hive build` needs an entrypoint: `hive build <entrypoint.hive>`.