Skip to content

Configuration

Configuration is stored in ~/.config/.binmate/config.json. It defines the binaries binmate knows about, along with optional global defaults.

A full breakdown of every field is available in the configuration reference.

Basic configuration

json
{
  "$schema": "https://binmate.cturner8.dev/schema.json",
  "version": 1,
  "binaries": [
    {
      "id": "gh",
      "name": "gh",
      "provider": "github",
      "path": "cli/cli",
      "format": ".tar.gz"
    }
  ]
}

VS Code schema validation

If using VS Code, you'll need to allow use of the binmate JSON schema in .vscode/settings.json:

jsonc
// .vscode/settings.json
{
  "json.schemaDownload.trustedDomains": {
    "https://binmate.cturner8.dev": true
  }
}

Global configuration

You can define global defaults that apply to all binaries unless overridden:

json
{
  "$schema": "https://binmate.cturner8.dev/schema.json",
  "version": 1,
  "global": {
    "installPath": "/usr/local/bin",
    "providers": {
      "github": {
        "authenticated": true
      }
    }
  },
  "binaries": [
    {
      "id": "gh",
      "name": "gh",
      "provider": "github",
      "path": "cli/cli",
      "format": ".tar.gz"
    },
    {
      "id": "fzf",
      "name": "fzf",
      "provider": "github",
      "path": "junegunn/fzf",
      "format": ".tar.gz",
      "installPath": "/opt/bin"
    },
    {
      "id": "mkcert", 
      "name": "mkcert", 
      "provider": "github",
      "path": "filosottile/mkcert",
      "format": "raw"
    },
    {
      "id": "bun",
      "name": "bun",
      "provider": "github",
      "path": "oven-sh/bun",
      "format": ".zip",
      "releaseRegex": "bun-"
    }
  ]
}

In this example:

  • All binaries use /usr/local/bin as the install path by default as defined in the global section.
  • All binaries use GitHub authentication by default to avoid rate limits.
  • The fzf binary overrides the global install path with /opt/bin.
  • gh and fzf release assets are expected to be tar archives.
  • bun release assets are expected to be a zip archive.
  • mkcert release assets are expected to be raw uncompressed binaries.

See the authentication guide for the full list of supported token sources, askpass script setup, and the askpassMode option.

Syncing changes

After editing the configuration file by hand, run binmate sync to reconcile the configuration with the database:

bash
binmate sync

Next steps

Released under the MIT License.