Dependencies

Hot uses a flexible dependency system that supports local paths, Git repositories, and the Hot package registry.

Dependency Format

Dependencies are declared using the deps setting with a map of package coordinates to dependency specifications:

hot.project.my-app.deps {
  "hot.dev/package-name": "1.0.0"
}

Package Coordinates

Package coordinates use the format org/package-name:

  • hot.dev/anthropic - The Anthropic package from Hot Dev
  • hot.dev/aws-s3 - AWS S3 bindings
  • my-org/my-package - A custom package

Dependency Specifications

The simplest way to specify a dependency is with a version string:

hot.project.my-app.deps {
  "hot.dev/anthropic": "1.0.0",
  "hot.dev/openai": "2.1.3"
}

This fetches the exact version from the Hot package registry. A version is always required—there is no "latest" resolution.

Note: The hot.dev registry currently hosts official Hot packages. Support for publishing your own packages to pkg.hot.dev is coming soon! In the meantime, you can share packages via Git repositories (see Git Dependencies below).

Specification Object

For more control, use a specification object. The resolver follows this priority:

  1. Local path exists (local) → Use local
  2. Registry coordinate (pkg) → Fetch from the package registry (a failed download errors rather than falling back to Git)
  3. Git specified (git) → Clone from Git
  4. Empty spec {} → Resolve from default local/installed locations (hot.dev/* packages only)

Local Dependencies

Point to a local directory:

hot.project.my-app.deps {
  "hot.dev/my-lib": { "local": "./libs/my-lib" }
}

Git Dependencies

Clone from a Git repository:

hot.project.my-app.deps {
  "hot.dev/stripe": {
    "git": "git@github.com:hot-dev/hot.git",
    "path": "hot/pkg/stripe",    // Path within the repo
    "tag": "v0.1.0"              // Or use "branch": "main"
  }
}

Hot clones only the branch or tag you name. A commit SHA needs the whole history, so its first clone takes longer. A tag or commit is cloned once and then read from the cache, and a branch is updated on each resolve.

Local with Git Fallback

The recommended pattern for packages in a monorepo - prefer local during development, fall back to Git for distribution:

hot.project.my-app.deps {
  "hot.dev/aws-core": {
    "local": "../aws-core",
    "git": "git@github.com:hot-dev/hot.git",
    "path": "hot/pkg/aws-core"
  }
}

This means:

  • If ../aws-core exists, use it (great for local development)
  • If not, clone from Git (works for published packages)

Default Resolution

An empty spec {} resolves from standard locations:

hot.project.my-app.deps {
  "hot.dev/anthropic": {}
}

Resolution order:

  1. $HOT_HOME/pkg/<package-name>
  2. ./hot/pkg/<package-name> (development)
  3. The running hot's own install: <prefix>/share/hot/pkg/<package-name> for a hot at <prefix>/bin/hot (such as ~/.local or /opt/homebrew), or resources/pkg/<package-name> beside it
  4. System install paths (/usr/local/share/hot/pkg/ on macOS, /usr/share/hot/pkg/ on Linux)

Transitive Dependencies

Hot automatically resolves transitive dependencies. If you depend on aws-s3, and aws-s3 depends on aws-core, you don't need to declare aws-core yourself.

// You only need to declare aws-s3
hot.project.my-app.deps {
  "hot.dev/aws-s3": { "local": "./hot/pkg/aws-s3" }
}
// aws-core is automatically included via aws-s3's pkg.hot

Project Overrides

Your project-level deps take precedence over transitive deps. This lets you use a local version of a transitive dependency:

hot.project.my-app.deps {
  "hot.dev/aws-s3": { "local": "./hot/pkg/aws-s3" },
  // Override aws-core to use your local modified version
  "hot.dev/aws-core": { "local": "./my-modified-aws-core" }
}

Dependency Specification Fields

When using a specification object, these fields are available:

FieldTypeDescription
localStringLocal filesystem path (relative or absolute)
pkgStringRegistry coordinate with its version, <org>/<package>/<version>, such as "hot.dev/anthropic/1.0.0"
gitStringGit repository URL (HTTPS or SSH)
branchStringGit branch name, on any branch of the repository (mutually exclusive with tag)
tagStringGit tag or commit SHA, of at least seven characters (mutually exclusive with branch)
pathStringPath within the Git repository (for monorepos)

A version string is shorthand for pkg: "hot.dev/anthropic": "1.0.0" is the same as "hot.dev/anthropic": { "pkg": "hot.dev/anthropic/1.0.0" }. A pkg dependency comes from the registry only. It is tried after an existing local path and before git, and a failed download is an error, not a fall back to git.

A version field in a specification object is not supported. A spec such as { "version": "1.0.0" } stops with Registry dependencies not yet supported. Use the version string or pkg.

Examples

Minimal Project (Registry)

hot.project.my-app.src.paths ["./src"]
hot.project.my-app.deps {
  "hot.dev/anthropic": "1.0.0"
}

hot.set.project "my-app"

Local Development

hot.project.my-app.src.paths ["./src"]
hot.project.my-app.deps {
  "hot.dev/anthropic": { "local": "./hot/pkg/anthropic" }
}

hot.set.project "my-app"
// Project settings
hot.set.project "production-api"

// Source and test paths
hot.project.production-api.src.paths ["./src", "./lib"]
hot.project.production-api.test.paths ["./test"]
hot.project.production-api.test.capture true

// Dependencies
hot.project.production-api.deps {
  // Registry packages (recommended for published packages)
  "hot.dev/anthropic": "1.0.0",
  "hot.dev/openai": "2.1.3",

  // Local development packages
  "hot.dev/my-lib": { "local": "./hot/pkg/my-lib" },

  // Git-based package with specific version
  "hot.dev/stripe": {
    "git": "git@github.com:hot-dev/hot.git",
    "path": "hot/pkg/stripe",
    "tag": "v0.2.0"
  },

  // Custom internal package
  "my-org/internal-utils": {
    "git": "git@github.com:my-org/hot-packages.git",
    "path": "packages/internal-utils",
    "branch": "main"
  }
}