Skip to content

Hinge CLI Reference

Hinge is Janus’s built-in package manager. It enforces the Garden Wall doctrine: every published package is a signed, content-addressed Capsule with proof certificates, SBOM, and capability manifests. Trust is not assumed; it is proven.

All commands are available through janus pkg (which delegates to Hinge internally) or directly via the hinge binary.


Scaffold a new Janus project with manifest, source directory, and git configuration.

Terminal window
janus init myproject

Creates the following structure:

myproject/
├── janus.kdl # Project manifest
├── src/
│ └── main.jan # Hello world starter
└── .gitignore

Arguments:

ArgumentRequiredDefaultDescription
nameNomyprojectProject directory and package name

Behavior:

  • Creates the directory if it does not exist
  • Generates a minimal janus.kdl manifest with name, version, and :core profile
  • Writes a src/main.jan with a working hello-world program
  • Initializes .gitignore with Janus build artifacts excluded

Resolve dependencies declared in janus.kdl and generate a pinned lockfile.

Terminal window
janus pkg resolve

Behavior:

  • Reads janus.kdl in the current directory
  • Resolves version constraints against available packages in the registry
  • Generates janus.lock with pinned versions and content IDs (CIDs)
  • Incremental: only re-resolves changed or newly added dependencies
  • Fails if any constraint is unsatisfiable (with diagnostics)

Output: janus.lock in the project root.


Create a .jpk package archive from source.

Terminal window
janus pkg pack src mylib 1.0.0

Arguments:

ArgumentRequiredDescription
sourceYesSource directory to pack
nameYesPackage name
versionYesSemantic version (MAJOR.MINOR.PATCH)

Output: {name}-{version}.jpk

What it does:

  1. Normalizes file content (consistent line endings, sorted entries)
  2. Computes a BLAKE3 content ID (CID) over the normalized archive
  3. Generates an SBOM (Software Bill of Materials)
  4. Bundles everything into a .jpk archive

Sign a package archive with your Ed25519 identity key.

Terminal window
janus pkg seal mylib-1.0.0.jpk --key identity.key

Arguments:

ArgumentRequiredDescription
packageYesPath to .jpk file
--keyYesPath to Ed25519 private key

What it does:

  1. Computes Ed25519 signature over content hash + manifest + SBOM
  2. Attaches the signature to the package
  3. Package becomes tamper-evident — any modification invalidates the seal

Verify a package’s integrity, authenticity, and trust status.

Terminal window
janus pkg verify mylib-1.0.0.jpk

Checks performed:

CheckDescription
Content integrityBLAKE3 CID matches actual archive contents
Signature validityEd25519 signature is mathematically correct
SBOM consistencyDeclared dependencies match actual imports
Trust policySigner exists in your trust graph
Revocation statusPackage has not been revoked by its author

Exit codes:

CodeMeaning
0Verification passed
1Verification failed (details printed to stderr)

janus pkg publish <package> --key <keyfile>

Section titled “janus pkg publish <package> --key <keyfile>”

Publish a signed package to the federated registry.

Terminal window
janus pkg publish mylib-1.0.0.jpk --key identity.key

What it does:

  1. Runs the full verification suite (same as janus pkg verify)
  2. Announces the package via DMP gossip on topic $HINGE/{chapter}/{name}/announce
  3. Appends an entry to the transparency ledger
  4. Stores the archive in local Content-Addressed Storage (CAS)

Preconditions: The package must be sealed. Unsigned packages are rejected.


Generate a new Ed25519 identity keypair for package signing.

Terminal window
janus pkg keygen myidentity

Output files:

FileDescription
{name}.keyEd25519 private key (keep secret)
{name}.pubEd25519 public key (share freely)

The corresponding DID is printed to stdout:

did:sovereign:z6Mkf5rGMoatrSj1f4CyvuHBeXJEhbSmYtwCDLmQ...

Add a DID to your local trust graph.

Terminal window
janus pkg trust add did:sovereign:z6Mkf5r...

Packages signed by this identity will pass trust policy checks during verify and resolve.


List all trusted DIDs and their trust distance.

Terminal window
janus pkg trust list

Remove a DID from your trust graph.

Terminal window
janus pkg trust remove did:sovereign:z6Mkf5r...

Packages signed exclusively by this identity will no longer pass trust policy checks.


Display project status: manifest summary, dependency count, and lock file health.

Terminal window
janus pkg status

Visualize the dependency graph.

Terminal window
janus pkg graph # Text tree (default)
janus pkg graph --format dot # GraphViz DOT format
janus pkg graph --format json # Machine-readable JSON

Formats:

FormatUse Case
textTerminal inspection (default)
dotPipe to dot -Tpng for visual diagrams
jsonCI integration and tooling

Run a security audit on all resolved dependencies.

Terminal window
janus pkg audit

Reports:

  • Known vulnerabilities (from advisory database)
  • License compatibility analysis
  • Capability usage summary (which packages touch FS, Net, etc.)
  • Unsigned or low-confidence packages flagged

Show cache statistics: total size, entry count, and hit rate.

Terminal window
janus pkg cache status

janus pkg cache prune [--max-age <days>] [--max-size <MB>]

Section titled “janus pkg cache prune [--max-age <days>] [--max-size <MB>]”

Clean up the local package cache.

Terminal window
janus pkg cache prune # Default eviction policy
janus pkg cache prune --max-age 30 # Remove entries older than 30 days
janus pkg cache prune --max-size 500 # Shrink cache to 500 MB

Options:

OptionDefaultDescription
--max-age90Maximum age in days before eviction
--max-size2048Maximum cache size in MB

Show recent entries from the transparency ledger.

Terminal window
janus pkg log show # All recent entries
janus pkg log show --last 10 # Last 10 entries

Each entry includes: timestamp, package CID, signer DID, and action (publish, revoke).


Show ledger health: entry count, last checkpoint hash, and integrity verification status.

Terminal window
janus pkg log status

VariableDefaultDescription
HINGE_CI0Set to 1 to enable CI mode (strict policy, offline, JSON output)
HINGE_OFFLINE0Set to 1 to prevent all network access
HINGE_CACHE_DIR~/.hinge/cachePackage cache directory
HINGE_KEY(none)Default signing key path (avoids repeated --key flags)

When HINGE_CI=1 is set, Hinge operates under strict deterministic constraints:

BehaviorDescription
Strict policyNo trust overrides or interactive prompts
Offline modeUses only cached and locked packages
Reproducible buildsFails if lockfile is stale or missing
JSON outputAll output is machine-parseable JSON
Mandatory proofsSBOM and proof certificates required on publish
Non-interactiveAll prompts auto-reject (no TTY assumed)
Terminal window
HINGE_CI=1 janus pkg resolve
HINGE_CI=1 janus pkg verify mylib-1.0.0.jpk

The project manifest uses KDL syntax. This is the human-facing intent layer; Hinge resolves it into canonical JSON internally (per the Law of Representation).

project {
name "mylib"
version "1.0.0"
profile "core"
description "A sovereign math library"
license "LUL-1.0"
authors "did:sovereign:z6Mkf5r..."
}
dependencies {
crypto "^2.1.0"
logging "~1.0.0"
math "=3.0.0"
}
PrefixNameMeaningExample
^CompatibleSame major version^1.2.3 matches >=1.2.3, <2.0.0
~ApproximateSame minor version~1.2.3 matches >=1.2.3, <1.3.0
=ExactPin to specific version=1.2.3 matches only 1.2.3
>=MinimumFloor constraint>=1.0.0 matches any >=1.0.0

All packages are identified by their BLAKE3 content ID (CID). The CID is computed over the normalized archive contents, ensuring that identical source always produces the same identifier regardless of build time or environment.

blake3:7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730

Format: blake3:<64-character-hex-digest>

This content-addressed design provides:

  • Deduplication across the cache and registry
  • Integrity verification without trusting the transport layer
  • Reproducibility — same source always produces the same CID

CommandDescription
janus init [name]Scaffold a new project
janus pkg resolveResolve and lock dependencies
janus pkg pack <src> <name> <ver>Create a .jpk archive
janus pkg seal <pkg> --key <key>Sign a package
janus pkg verify <pkg>Verify integrity and trust
janus pkg publish <pkg> --key <key>Publish to registry
janus pkg keygen <name>Generate Ed25519 keypair
janus pkg trust add <did>Trust a signer
janus pkg trust listList trusted identities
janus pkg trust remove <did>Revoke trust
janus pkg statusShow project status
janus pkg graph [--format]Visualize dependency graph
janus pkg auditSecurity audit
janus pkg cache statusCache statistics
janus pkg cache pruneClean cache
janus pkg log showShow ledger entries
janus pkg log statusLedger health check