dockhand

module
v0.0.0-20260920.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT

README

[!NOTE] Early software; the command surface is still settling. Your stored data is safe: the state database is migrated forward by each newer Dockhand, never discarded, and dockhand db backup keeps a copy before any migration. Commands, flags, output, and the workflow itself may still change between releases, so scripts built on them should expect to be revisited.

dockhand logo

dockhand

From upstream release to submitted port update.

Dockhand is for people who keep MacPorts ports up to date and contribute the updates as pull requests. Given a port, it finds the newest upstream release, edits the Portfile and checksums, builds the port in a clean macOS virtual machine or on GitHub Actions, and opens the pull request from your fork. You look at the result at every step, and nothing goes out until it has been built or you have said it should.

Two things a MacPorts contributor will want to know first:

  • It works entirely through your own fork of macports/macports-ports. The pull request it opens is the same kind you would open by hand, and nothing is ever pushed to the MacPorts repository directly. You do not need commit access.
  • It builds the way a MacPorts pull request is built. Lint, build, and install decide the verdict. The port's tests run and their result is reported in the pull request, but a failing test suite does not fail the build, the same rule the MacPorts workflow applies; --tests required makes it decisive.

When a Portfile does something Dockhand does not understand, or a build fails, or upstream looks wrong, it stops, keeps what it has done, and tells you why. It never guesses.

The thirty-second version

dockhand auth login      # once: a browser login to GitHub
cd ~/Source/macports-ports
dockhand bump jq

The last command fetches the current MacPorts master, creates a branch named like dockhand/bump/jq-…, edits the port to the newest release, builds it, pushes the branch to your fork, and opens the pull request. It stays in the foreground and prints each milestone: the version move, the branch, where it is building, the verdict, and the pull request URL. Your checkout is not touched. If the port is already current, it says so and stops. If the build fails, the branch is kept and no pull request is opened.

That is the whole tool for most updates. The rest of this page is what to do around it.

Where builds happen

Dockhand needs somewhere to build. You have two choices, and it picks whichever is available.

  • A local virtual machine, on an Apple silicon Mac with Tart installed. Run dockhand setup once to prepare a clean macOS image with MacPorts in it; it takes a while the first time. dockhand setup --xcode /path/to/Xcode.xip prepares a second image for ports that need full Xcode, and Dockhand chooses the right one per port. This is the faster and more detailed option: each phase gets its own verdict and you can follow the log with --trace.
  • GitHub Actions in your fork, when there is no Tart image. This uses the MacPorts workflow your fork already has, so make sure that workflow is enabled under the fork's Actions settings. It needs the GitHub login above and a fork Dockhand can find among your checkout's remotes; without those, a bump says so before doing any work.

--provider tart or --provider github overrides the choice.

The everyday loop

dockhand outdated --maintainer you@example.org   # which of my ports have a newer release
dockhand bump jq --diff                          # what would change, without touching anything
dockhand bump jq                                 # do it: branch, build, pull request
dockhand status                                  # everything I have open, as a live table
dockhand refresh jq                              # record the PR's fate after review

outdated reads your checkout and asks each port's upstream, or its livecheck, whether there is something newer. bump jq 1.8.1 names the version yourself; bump-revision jq --reason "…" and refresh-checksums jq do the other two kinds of update, with the same flags. status shows one row per port with its phase, state, and what comes next; on a terminal it is live, processes your pending work while open, and its keys run the other commands on the selected row. After a pull request is merged or closed, refresh records it and cleans up the branches so the next bump starts fresh.

Every accepted job is durable. Close the terminal and dockhand wait jq picks the same job back up; Ctrl-C detaches without canceling anything, and dockhand cancel jq cancels on purpose.

When something goes wrong

A failed build keeps the prepared branch. Switch to it, look at the log the verdict line points at, fix the Portfile or patches, stage the change, and let Dockhand take it from there:

dockhand amend      # capture the staged fix as the contribution's new commit, rebuild, update the PR
dockhand rebase     # reapply the contribution onto current master when it has moved on
dockhand abandon jq # stop pursuing this update; the branch and its history are kept

amend --diff and rebase --diff show what would change first. Both verify and update the pull request the way bump does, and take the same stop-early flags below.

Dockhand's branches are ordinary Git branches, and it will build and publish a branch you made yourself: keep the contribution to one commit in one port directory, then dockhand verify and dockhand publish it.

Stopping early, or skipping the build

Four combinations cover every change command:

Flags What happens
none prepare, build, open the pull request
--no-publish (-P) prepare and build; look before you publish
--skip-verify (-V) prepare and open the pull request without building; the PR says so
both prepare the branch and stop

--detach submits the work and returns as soon as the build is admitted; wait finishes it. --diff previews without creating anything. A branch left at --no-publish is published later with dockhand publish jq, and publish --dry-run shows the full pull request body first.

Requirements

  • macOS. Local builds need an Apple silicon Mac with Tart; the prepared images cover macOS Monterey through Golden Gate. Any other Mac can still prepare updates and build them on GitHub Actions.
  • A local MacPorts installation. Dockhand reads Portfiles through MacPorts' own Tcl interpreter, so it sees exactly what port sees.
  • Git, and a clone of your fork of macports/macports-ports that Git can push to. Dockhand recognizes macports/macports-ports as upstream whatever the remote is called, and finds your fork by your GitHub login; --remote is only for ambiguous layouts.
  • A GitHub credential: dockhand auth login, an existing gh auth login, or GH_TOKEN.
  • go2port or cargo2port, from MacPorts, only for ports whose Portfile carries a generated Go or Rust dependency block.
Installing

Build from source with Go 1.27.1 or newer; the dependencies are vendored, so the build needs no network:

git clone https://github.com/herbygillot/dockhand.git
cd dockhand
make build
mkdir -p "$HOME/.local/bin" && install -m 755 dockhand "$HOME/.local/bin/dockhand"

dockhand --version shows which build you have.

More

Dockhand keeps its records in one SQLite database, ~/.dockhand/state.db unless --db or DOCKHAND_DB says otherwise. dockhand gc prunes old build environments and logs, and dockhand db backup copies the database.

docs/usage.md covers every command and option, which Portfile shapes can be bumped automatically, credential precedence, and what each build actually runs. docs/github-verification.md covers building in your fork, and docs/operations.md the database, backups, and retention. The rest of docs/ is the design. review appears in --help but is not implemented yet.

Dockhand is developed at github.com/herbygillot/dockhand and licensed under the MIT License.

Directories

Path Synopsis
cmd
dockhand command
Command dockhand prepares, verifies, and publishes MacPorts contributions.
Command dockhand prepares, verifies, and publishes MacPorts contributions.
internal
app
Package app composes Dockhand's configuration, workflow engine, and concrete integrations for command callers.
Package app composes Dockhand's configuration, workflow engine, and concrete integrations for command callers.
archive
Package archive walks tar and zip source archives without extracting them onto the host.
Package archive walks tar and zip source archives without extracting them onto the host.
assess
Package assess reports whether committed ports have supported update inputs.
Package assess reports whether committed ports have supported update inputs.
atomicfile
Package atomicfile durably replaces small local files.
Package atomicfile durably replaces small local files.
cli
Package cli defines Dockhand's Cobra commands and their user-facing behavior.
Package cli defines Dockhand's Cobra commands and their user-facing behavior.
credential
Package credential defines secret-storage and device-authorization contracts.
Package credential defines secret-storage and device-authorization contracts.
credential/keychain
Package keychain stores credentials in the current user's macOS Keychain.
Package keychain stores credentials in the current user's macOS Keychain.
fetch
Package fetch performs bounded HTTP transfers using caller-owned requests and clients.
Package fetch performs bounded HTTP transfers using caller-owned requests and clients.
filelock
Package filelock provides context-aware advisory locks for files and external resources shared by Dockhand processes.
Package filelock provides context-aware advisory locks for files and external resources shared by Dockhand processes.
forge
Package forge defines remote repository observations and publication inputs shared by forge adapters and their consumers.
Package forge defines remote repository observations and publication inputs shared by forge adapters and their consumers.
forge/github
Package github adapts GitHub repositories and pull requests to forge contracts.
Package github adapts GitHub repositories and pull requests to forge contracts.
forge/gitlab
Package gitlab adapts GitLab tag observations to forge contracts.
Package gitlab adapts GitLab tag observations to forge contracts.
git
Package git provides repository operations through a configurable Git executable.
Package git provides repository operations through a configurable Git executable.
git/changeset
Package changeset captures Git-backed sources and describes changes between immutable objects.
Package changeset captures Git-backed sources and describes changes between immutable objects.
github
Package github supplies the GitHub client and authentication shared by forge and verification adapters.
Package github supplies the GitHub client and authentication shared by forge and verification adapters.
macos
Package macos describes macOS releases and supplies developer-tool, storage, and launchd operations.
Package macos describes macOS releases and supplies developer-tool, storage, and launchd operations.
macports
Package macports defines bound ports-tree contexts and evaluated observations.
Package macports defines bound ports-tree contexts and evaluated observations.
macports/dependency
Package dependency handles generated MacPorts Go and Rust dependency blocks.
Package dependency handles generated MacPorts Go and Rust dependency blocks.
macports/dependents
Package dependents discovers downstream verification coverage from a frozen ports tree.
Package dependents discovers downstream verification coverage from a frozen ports tree.
macports/distfiles
Package distfiles associates native fetch observations with exact checksum declarations.
Package distfiles associates native fetch observations with exact checksum declarations.
macports/eval
Package eval implements MacPorts evaluation through its native Tcl runtime.
Package eval implements MacPorts evaluation through its native Tcl runtime.
macports/fidelity
Package fidelity compares MacPorts evaluations of a Portfile before and after an edit and reports whether only the intended metadata changed.
Package fidelity compares MacPorts evaluations of a Portfile before and after an edit and reports whether only the intended metadata changed.
macports/installation
Package installation observes and installs MacPorts on an explicit command target.
Package installation observes and installs MacPorts on an explicit command target.
macports/patchcheck
Package patchcheck tells whether a port's patch files still apply to a source archive before any build is attempted.
Package patchcheck tells whether a port's patch files still apply to a source archive before any build is attempted.
macports/portedit
Package portedit prepares evaluated Portfile edits in disposable source workspaces.
Package portedit prepares evaluated Portfile edits in disposable source workspaces.
macports/portfile
Package portfile identifies and edits literal inputs in Tcl Portfiles.
Package portfile identifies and edits literal inputs in Tcl Portfiles.
macports/portindex
Package portindex prepares, reads, and retains MacPorts indexes for immutable source trees.
Package portindex prepares, reads, and retains MacPorts indexes for immutable source trees.
macports/selection
Package selection resolves port names in a captured source before native evaluation.
Package selection resolves port names in a captured source before native evaluation.
macports/source
Package source interprets the upstream conventions of evaluated Portfiles.
Package source interprets the upstream conventions of evaluated Portfiles.
macports/survey
Package survey selects ports from an isolated snapshot of committed source.
Package survey selects ports from an isolated snapshot of committed source.
macports/version
Package version owns how Dockhand reads a version spelling: whether it is a usable spelling at all, how an upstream tag maps to and from it, and whether it is stable or a prerelease.
Package version owns how Dockhand reads a version spelling: whether it is a usable spelling at all, how an upstream tag maps to and from it, and whether it is stable or a prerelease.
outdated
Package outdated observes upstream updates for ports selected from committed local source.
Package outdated observes upstream updates for ports selected from committed local source.
proc
Package proc drives workflow cycles within the current Dockhand process.
Package proc drives workflow cycles within the current Dockhand process.
progress
Package progress carries transient operation messages through a context to an optional observer.
Package progress carries transient operation messages through a context to an optional observer.
publish
Package publish plans and reconciles the remote publication of verified contributions.
Package publish plans and reconciles the remote publication of verified contributions.
record
Package record defines Dockhand's durable workflow records and shared identities and value types.
Package record defines Dockhand's durable workflow records and shared identities and value types.
state
Package state defines repository-scoped persistence and shared provider coordination for Dockhand workflows.
Package state defines repository-scoped persistence and shared provider coordination for Dockhand workflows.
state/sqlite
Package sqlite implements Dockhand's state contracts using SQLite.
Package sqlite implements Dockhand's state contracts using SQLite.
subprocess
Package subprocess runs one external command with the conventions every Dockhand tool runner shares: a bounded wait after cancellation, captured output, the context error joined into the cause, and one error shape that names the tool, its command, and what it wrote to stderr.
Package subprocess runs one external command with the conventions every Dockhand tool runner shares: a bounded wait after cancellation, captured output, the context error joined into the cause, and one error shape that names the tool, its command, and what it wrote to stderr.
tart
Package tart provides shared mechanics for the local Tart installation and its images.
Package tart provides shared mechanics for the local Tart installation and its images.
tart/host
Package host controls concrete Tart VMs and their guest-agent transport.
Package host controls concrete Tart VMs and their guest-agent transport.
tart/provision
Package provision constructs and validates local Tart images for verification.
Package provision constructs and validates local Tart images for verification.
tcl/rpc
Package rpc exchanges framed calls with a Tcl child over its standard streams.
Package rpc exchanges framed calls with a Tcl child over its standard streams.
tcl/shell
Package shell manages Tcl child processes and their bounded output.
Package shell manages Tcl child processes and their bounded output.
tcl/syntax
Package syntax parses Tcl source into byte-addressed syntax without evaluating it.
Package syntax parses Tcl source into byte-addressed syntax without evaluating it.
text
Package text provides byte spans and edits for source-preserving transformations.
Package text provides byte spans and edits for source-preserving transformations.
tui
Package tui renders the live status table: the contribution projection polled from the state database, one row per contribution, with keys that map onto the existing verbs and add no authority of their own.
Package tui renders the live status table: the contribution projection polled from the state database, one row per contribution, with keys that map onto the existing verbs and add no authority of their own.
upstream
Package upstream selects and checks releases for interpreted MacPorts sources.
Package upstream selects and checks releases for interpreted MacPorts sources.
verify
Package verify defines verification plans, provider contracts, and evidence assessment.
Package verify defines verification plans, provider contracts, and evidence assessment.
verify/github
Package github verifies committed contributions through GitHub Actions on a personal MacPorts fork.
Package github verifies committed contributions through GitHub Actions on a personal MacPorts fork.
verify/staging
Package staging prepares indexed source archives for verification providers.
Package staging prepares indexed source archives for verification providers.
verify/tart
Package tart verifies ports in isolated local Tart virtual machines.
Package tart verifies ports in isolated local Tart virtual machines.
version
Package version describes the running dockhand build from the information the Go toolchain embeds: the module version when built from a tagged module, otherwise the VCS revision, marked when the tree was modified.
Package version describes the running dockhand build from the information the Go toolchain embeds: the module version when built from a tagged module, otherwise the VCS revision, marked when the tree was modified.
workflow
Package workflow accepts Dockhand requests and advances durable records toward their requested destinations.
Package workflow accepts Dockhand requests and advances durable records toward their requested destinations.
workflow/policy
Package policy answers read-only questions about recorded workflow state: which verification evidence applies to a build question, whether evidence covers a publication's whole cohort, and whether a publication action still matches its job.
Package policy answers read-only questions about recorded workflow state: which verification evidence applies to a build question, whether evidence covers a publication's whole cohort, and whether a publication action still matches its job.
workflow/preparation
Package preparation connects immutable Git sources to Portfile editing.
Package preparation connects immutable Git sources to Portfile editing.
workflow/view
Package view is the contribution-centric projection of the engine's recorded snapshot and the phrasebook for it: the rows a person reads in status, its JSON, and the live table, and the words an action's summary uses for the same job.
Package view is the contribution-centric projection of the engine's recorded snapshot and the phrasebook for it: the rows a person reads in status, its JSON, and the live table, and the words an action's summary uses for the same job.
tools
stateperf command
Command stateperf measures SQLite state and workflow-cycle costs with synthetic job histories.
Command stateperf measures SQLite state and workflow-cycle costs with synthetic job histories.

Jump to

Keyboard shortcuts

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