hostmark
hostmark is a cross-platform CLI for a stable local host identity and a Git-managed canonical hostname registry. It
stores one UUIDv4 on each operating-system instance, maps that identifier to an intended short hostname, and reports
hostname drift on demand. It never changes the operating-system hostname, DNS, Cloudflare, or startup settings. Its
bounded Git support initializes, clones, or fast-forwards the inventory repository only when explicitly requested.
The local UUID answers “which operating-system instance is this?” The registry hostname answers “what should this instance be called?” A hostname can change while the UUID remains stable. A retired UUID and every hostname it has owned remain as permanent tombstones. Host IDs are identifiers, not authentication credentials or secrets.
Installation
Install the Hostmark CLI from PyPI with uv:
uv tool install hostmark
pipx provides another isolated CLI installation:
pipx install hostmark
For a normal Python environment, use pip:
python -m pip install hostmark
Install a specific release when reproducibility requires a pin:
uv tool install "hostmark==0.2.0"
The Hostmark source package is public. Real Hostmark inventory repositories should normally remain private because they may contain hostnames, UUIDs, operator notes, and site topology. No inventory data ships inside the PyPI package.
For development from this checkout:
uv sync --extra dev
uv run hostmark --version
Quick start
Create the first private inventory repository at the platform-specific user default. The --site option is repeatable.
hostmark repo init \
--dns-suffix node.infra.example.com \
--site nc1
hostmark repo path
Change into the Repository directory printed by hostmark repo path, then run:
git add .gitattributes HOSTMARK_REPOSITORY hosts.json
git commit -m "Initialize hostmark repository"
git remote add origin <remote-url>
git push -u origin main
repo init creates an unborn main branch, canonical .gitattributes, an empty marker, and a canonical empty registry.
It does not stage, commit, configure a remote, or push, and it is not sync-ready until those three files are committed.
On another machine, install Hostmark 0.2.0, create that machine's identity, and record its UUID before cloning. On
Windows, run identity init without --sudo from an elevated terminal.
hostmark identity init --sudo
hostmark identity show --raw
hostmark repo sync --remote <remote-url>
hostmark repo path
Change into the Repository directory printed by hostmark repo path, then register, review, and publish the record:
hostmark registry register nc1-example-01
git diff -- hosts.json
hostmark registry validate --registry hosts.json
git add hosts.json
git commit -m "Register nc1-example-01"
git push
hostmark check
If the machine's current OS hostname differs from the registered name, this first check is expected to report drift.
Manually change the OS hostname to the canonical registry hostname, reboot or re-login when the operating system
requires it, and run hostmark check again until it succeeds. Hostmark detects this mismatch; it never changes the OS
hostname.
System scope is recommended and normally requires elevation on Linux and macOS. Before sudo elevation, Hostmark checks both the system path and the invoking user's path; see platform identity storage for the duplicate-prevention details.
# Explicit fallback when system scope is unsuitable:
hostmark identity init --scope user
Never initialize a host ID in a VM template or generic system image. Each clone must generate its own identity after it becomes an independent operating-system instance.
An administrator may pre-register another machine only after obtaining the UUID generated on that machine. The
administrator must use that exact value with --host-id, never invent a replacement UUID for the target machine:
hostmark registry register nc1-fox-01 \
--host-id f0c5ebce-b37e-45d5-9f62-5c5a12f25116
The target then synchronizes the repository and follows the same hostname mismatch, manual remediation, and final
hostmark check flow.
Rename the same identity in the registry first:
hostmark registry rename nc1-fox-01 nc1-fox-02 --dry-run
hostmark registry rename nc1-fox-01 nc1-fox-02
git diff -- hosts.json
hostmark check # expected mismatch
# Manually change the operating-system hostname after review.
hostmark check # must now succeed
Commit and review the registry update before changing the operating-system hostname. The first check deliberately
exposes drift; the second confirms the manual OS change. Hostmark never performs that change itself.
Retire an ended identity, optionally recording its active replacement:
hostmark registry retire nc1-fox-01 \
--reason "Rebuilt as a new VM" \
--replacement nc1-fox-02
Manual registry workflow
Registry files are ordinary JSON designed for Git review. Before editing, inspect the record and preserve all required fields. Never delete host tombstones or reuse names. After editing, canonicalize and validate the candidate, then compare it with the authoritative base revision:
hostmark registry format --registry hosts.json
hostmark registry validate --registry hosts.json
hostmark registry validate \
--registry hosts.json \
--against /tmp/hosts.base.json
git diff -- hosts.json
registry format --check only checks bytes. Formatting can reorder canonical arrays and object fields, but it refuses
semantic errors and never repairs identity or lifecycle data.
The normal read-only daily sequence is explicit:
hostmark repo sync && hostmark check
repo sync requires the three repository metadata/data files to be tracked, rejects tracked changes, ignores unrelated
untracked files, pulls only the current origin/* upstream with fast-forward-only semantics, validates hosts.json,
and never pushes. Hostmark uses GitPython as a typed interface to system Git, so the user's credential helpers and SSH
configuration remain authoritative. check itself never invokes Git or performs network access. See the
repository workflow for discovery defaults, authentication behavior, and v0.1 migration.
Scope and non-goals
Hostmark stores only UUID identity, hostname history, lifecycle metadata, sites, notes, and the DNS suffix used to compute
hostname + "." + dns_suffix. It deliberately excludes IP addresses, MAC addresses, DHCP, hypervisors, service names,
service domains, ports, DNS records, Cloudflare, credentials, reachability, and monitoring. There is no daemon, boot-time
service, automatic hostname remediation, automatic Git commit/push, network probe, central server, database, identity
reset, host deletion, unretirement, or hostname allocation/reuse command.
See the CLI reference, schema reference, and lifecycle guide for the complete contract.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hostmark-0.2.0.tar.gz.
File metadata
- Download URL: hostmark-0.2.0.tar.gz
- Upload date:
- Size: 43.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22609734108f140312c79d0433cf8f68da427065fa1cce96068c77bc50c85860
|
|
| MD5 |
cb97ba091ca530d2d333ea663e9442d2
|
|
| BLAKE2b-256 |
286dc31039e0149bf1bc54353731a978f5405cab9b6ef85e9fedb9201629a7da
|
Provenance
The following attestation bundles were made for hostmark-0.2.0.tar.gz:
Publisher:
publish.yml on eserie-fox/hostmark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hostmark-0.2.0.tar.gz -
Subject digest:
22609734108f140312c79d0433cf8f68da427065fa1cce96068c77bc50c85860 - Sigstore transparency entry: 2700439131
- Sigstore integration time:
-
Permalink:
eserie-fox/hostmark@6a8286f5cd06b4f4b3976a7bd9e93e6451414c55 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/eserie-fox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a8286f5cd06b4f4b3976a7bd9e93e6451414c55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hostmark-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hostmark-0.2.0-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29fe8f210029077c476ec6ed29973c0c8b4775d8d25254c0d03a9e877cd2e0a
|
|
| MD5 |
86bb7969057d094bc19aceb8fbe8aa66
|
|
| BLAKE2b-256 |
13f1457e2cce01e948d747a390a4c9ade299efef2769c8f6a9206e67b50292d7
|
Provenance
The following attestation bundles were made for hostmark-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on eserie-fox/hostmark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hostmark-0.2.0-py3-none-any.whl -
Subject digest:
e29fe8f210029077c476ec6ed29973c0c8b4775d8d25254c0d03a9e877cd2e0a - Sigstore transparency entry: 2700439183
- Sigstore integration time:
-
Permalink:
eserie-fox/hostmark@6a8286f5cd06b4f4b3976a7bd9e93e6451414c55 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/eserie-fox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a8286f5cd06b4f4b3976a7bd9e93e6451414c55 -
Trigger Event:
push
-
Statement type: