hive

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 1 Imported by: 0

README

Hive

Hive is a viewer and editor for SFGA taxonomic archives (SQLite). It opens an archive in a terminal interface or in the browser, checks it against validation rules, and stamps edits with the editor's ORCID™ iD.

Status: v0.0.1 is an early prototype. Expect rough edges and changes between releases, and keep backups of archives you edit.

Features

  • Terminal interface. hive view browses an archive read-only; hive edit opens it for editing.
  • Web interface. hive serve runs a local web app for browsing and editing at http://127.0.0.1:2365.
  • Validation. hive validate checks an archive with gsvalidator against three built-in rulesets (hive, clb, tw). Each can be switched off per archive with hive ruleset.
  • Attribution. Edits are stamped with the configured ORCID iD.

Install

Download a binary for Linux, macOS or Windows from the releases page, or install with Go 1.26.5 or later:

go install github.com/sfborg/hive@latest

Release binaries are not signed. On macOS, the first launch may need to be approved in System Settings → Privacy & Security; on Windows, SmartScreen may ask for confirmation.

Development quick start

Development dependencies:

Clone this repo, build Hive and generate a small demo archive:

just build    # bin/hive and bin/mkdemo
just demo     # writes ./demo.db

Open it:

./bin/hive view demo.db     # read-only terminal interface
./bin/hive edit demo.db     # editing terminal interface
./bin/hive serve demo.db    # web interface at http://127.0.0.1:2365

Run the validation rules, and choose which rulesets apply:

./bin/hive validate demo.db
./bin/hive ruleset list demo.db
./bin/hive ruleset disable demo.db clb    # rulesets: hive, clb, tw

Run the tests with just test; just --list shows every recipe.

Configuration

Settings live in ~/.config/sfborg/hive/config.yml; hive config path prints the location.

hive config set orcid 0000-0002-1825-0097
hive config set openalex-email you@example.org
  • orcid: the iD stamped on edits (col__modified_by). Also set with --orcid or HIVE_ORCID.
  • openalex-email: a contact address included with reference lookups to OpenAlex, as its polite pool requests. Also set with --openalex-email or HIVE_OPENALEX_EMAIL.

hive serve listens on 127.0.0.1 by default. Binding to any other address requires authentication to be configured.

License

MIT. See LICENSE. The web interface bundles Lit (BSD-3-Clause), whose license ships alongside it in internal/wui/dist/vendor/.

ORCID™, the ORCID logo, and the iD logo are trademarks of ORCID, Inc. and are used in accordance with the ORCID Brand Guidelines.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
rankguess
Package rankguess suggests a sfga rank ID for a name based on nom_code, the gnparser flattened parse result, and the canonical form.
Package rankguess suggests a sfga rank ID for a name based on nom_code, the gnparser flattened parse result, and the canonical form.
server
Package server implements `hive serve <archive.db>` — the HTTP + WUI frontend.
Package server implements `hive serve <archive.db>` — the HTTP + WUI frontend.
tui
Package tui implements the Bubble Tea TUI shared by `hive view` and `hive edit`.
Package tui implements the Bubble Tea TUI shared by `hive view` and `hive edit`.
wui
Package wui embeds the WUI static assets shipped inside the hive binary.
Package wui embeds the WUI static assets shipped inside the hive binary.
pkg
bhlnames
Package bhlnames is an HTTP client for the BHLnames service (bhlnames.globalnames.org/api/v1).
Package bhlnames is an HTTP client for the BHLnames service (bhlnames.globalnames.org/api/v1).
bibtex
Package bibtex converts a single BibTeX entry into a coldp.Reference.
Package bibtex converts a single BibTeX entry into a coldp.Reference.
config
Package config owns hive's user-config file: a small YAML document at $XDG_CONFIG_HOME/sfborg/hive/config.yml (or the platform equivalent), plus the merged flag > env > config Identity that downstream packages read via CurrentIdentity.
Package config owns hive's user-config file: a small YAML document at $XDG_CONFIG_HOME/sfborg/hive/config.yml (or the platform equivalent), plus the merged flag > env > config Identity that downstream packages read via CurrentIdentity.
openalex
Package openalex is a thin HTTP client for api.openalex.org that resolves DOIs and runs cross-field search, mapping the returned Work records into coldp.Reference values.
Package openalex is a thin HTTP client for api.openalex.org that resolves DOIs and runs cross-field search, mapping the returned Work records into coldp.Reference values.
orcid
Package orcid is a Go client for the ORCID public API (https://pub.orcid.org/v3.0).
Package orcid is a Go client for the ORCID public API (https://pub.orcid.org/v3.0).
orcid/config
Package config holds the Config and its functional Option setters used to construct an orcid Client.
Package config holds the Config and its functional Option setters used to construct an orcid Client.
sfgarules
Package sfgarules holds the SFGAMapper — hive's implementation of gsvalidator's SchemaMapper and joins.PrimaryKeyProvider interfaces for the sfga schema (col__ / gn__ / sf__ prefixes, col__id as the primary key across every table).
Package sfgarules holds the SFGAMapper — hive's implementation of gsvalidator's SchemaMapper and joins.PrimaryKeyProvider interfaces for the sfga schema (col__ / gn__ / sf__ prefixes, col__id as the primary key across every table).
ui
Package ui holds hive's shared UI descriptions — data that both the TUI and the WUI render from, so a single edit propagates to both frontends.
Package ui holds hive's shared UI descriptions — data that both the TUI and the WUI render from, so a single edit propagates to both frontends.
tools
mkdemo command
mkdemo generates a small SFGA archive with a tiny taxonomic tree so that developers can smoke-test `hive view` and other frontends against real data.
mkdemo generates a small SFGA archive with a tiny taxonomic tree so that developers can smoke-test `hive view` and other frontends against real data.
mknomen command
mknomen extracts NOMEN_URI + gbif_status constants from a checked-out TaxonWorks source tree and emits nomen_tw.json — the "authoritative partition" of NOMEN URIs that hive uses to filter its status picker (classifications only) and to downcast to CoLDP-generalized values on export.
mknomen extracts NOMEN_URI + gbif_status constants from a checked-out TaxonWorks source tree and emits nomen_tw.json — the "authoritative partition" of NOMEN URIs that hive uses to filter its status picker (classifications only) and to downcast to CoLDP-generalized values on export.
mknotices command
mknotices writes the third-party notices shipped in hive release archives: the license and notice files of every module linked into hive on any release platform, the Go license, and the licenses of the vendored web assets.
mknotices writes the third-party notices shipped in hive release archives: the license and notice files of every module linked into hive on any release platform, the Go license, and the licenses of the vendored web assets.
mkrankorder command
mkrankorder regenerates the rank_order parameter block in pkg/clb_rules.json by walking pkg/ui/rank_hierarchy.json (the TW-derived rank data hive already uses for its child-rank picker).
mkrankorder regenerates the rank_order parameter block in pkg/clb_rules.json by walking pkg/ui/rank_hierarchy.json (the TW-derived rank data hive already uses for its child-rank picker).

Jump to

Keyboard shortcuts

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