Getting started
Slide 3 of 85
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, and reports coverage.
  • 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 where 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, which the next slide sets up. hive alone lists all of them.

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. Those mistakes are in what was typed rather than in any source, so their messages say who is complaining — hive: — and exit 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>`.