Skip to content

NixHub - API #2828

Description

@Malix-Labs

Problem

Using NixHub from the terminal

Solution

An API for NixHub

Alternatives

Activity

  1. jameswarren commented on Jul 7, 2026

    @jameswarren

    The jetify docs cover the Nixhub API: https://www.jetify.com/docs/nixhub

    I had to do a little digging to find the base URL for the endpoints, but otherwise it works as described:

    > curl -s -H "Accept: application/json" https://search.devbox.sh/v2/pkg\?name\=emacs | jq | head -n 20
    {
      "name": "emacs",
      "summary": "Extensible, customizable GNU text editor",
      "homepage_url": "https://www.gnu.org/software/emacs/",
      "license": "GPL-3.0-or-later",
      "releases": [
        {
          "version": "30.2",
          "last_updated": "2026-06-27T07:37:20Z",
          "platforms": [
            {
              "arch": "x86-64",
              "os": "Linux",
              "system": "x86_64-linux",
              "attribute_path": "emacs",
              "commit_hash": "3d46470bb3030020f7e1361f33514854f5bfa86d",
              "date": "2026-06-27T07:37:20Z",
              "outputs": [
                {
                  "name": "out",
    ...
    
  2. Malix-Labs commented on Jul 7, 2026

    @Malix-Labs
    Author

    Cool, thanks!

    I'll let the issue stay open so they can hopefully see it and add that link somewhere

  3. Malix-Labs commented on Aug 10, 2026

    @Malix-Labs
    Author
  4. mikeland73 commented on Sep 28, 2026

    @mikeland73
    Collaborator

    Triage: looks easy, p3

    A public API already exists. It is the same one the devbox CLI uses (the host can be overridden with DEVBOX_SEARCH_HOST, internal/envir/env.go:18):

    curl -s 'https://search.devbox.sh/v2/pkg?name=sshm' | jq .name          # "sshm"
    curl -s 'https://search.devbox.sh/v2/resolve?name=nodejs&version=22' | jq .version
    

    https://www.jetify.com/docs/nixhub describes the endpoints, but the page I fetched doesn't clearly state the base URL (https://search.devbox.sh), which is what the reporter hit. devbox search <pkg> also covers the terminal use case.

    Suggested fix: add the base URL and a curl example to the Nixhub API docs, and maybe link to it from nixhub.io.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions