Kimbia

Kimbia

A minimal cross-platform task runner.

Install ⚡

Install Kimbia using ...

curl -sSL https://kimbia.mwco.app/install.sh | bash

Configure 🔧

Configure Kimbia using a simple configuration file kimbia.yaml.

kimbia init

Usage 🐆

Run Kimbia using the tasks defined in the configuration file.

If one task fails, Kimbia will stop the execution and return the error code.

kimbia run lint test build deploy

Why? 🤔

What are the benefits of using Kimbia?

You can use Kimbia to run a series of tasks like linting, testing, building, and deploying your application.

You could also use a Makefile, bash- or npm-scripts, but Kimbia is easier to use and reason about.

Additionally, Kimbia supports dotenv files out of the box, is cross-platform, has documentation built-in and a simple and clean configuration file format.

Example 🧐

See this npm script example:

{
  "scripts": {
    "publish": "bun run build && bun publish",

    "create-release": "bun run build && node --experimental-sea-config sea-config.json && npm run create-release:platforms",

    "create-release:linux-arm64": "cp $(command -v node) dist/kimbia-linux-arm64 && postject dist/kimbia-linux-arm64 NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2",
    "create-release:linux-x64": "cp $(command -v node) dist/kimbia-linux-x64 && postject dist/kimbia-linux-x64 NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2",
    "create-release:mac-arm64": "cp $(command -v node) dist/kimbia-macos-arm64 && codesign --remove-signature dist/kimbia-macos-arm64 && chmod 755 dist/kimbia-macos-arm64 && postject dist/kimbia-macos-arm64 NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA",
    "create-release:mac-x64": "cp $(command -v node) dist/kimbia-macos-x64 && codesign --remove-signature dist/kimbia-macos-x64 && chmod 755 dist/kimbia-macos-x64 && postject dist/kimbia-macos-x64 NODE_SEA_BLOB dist/sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA",
    "create-release:windows-x64": "node -e \"require('fs').copyFileSync(process.execPath, 'dist/kimbia-x64.exe')\" && pwsh -ExecutionPolicy Bypass -File scripts\\sign.ps1 && pwsh -ExecutionPolicy Bypass -File scripts\\postiject.ps1",

    "upload-release:linux-arm64": "gh release create v$(jq -r .version package.json) --generate-notes || true && gh release upload --clobber v$(jq -r .version package.json) dist/kimbia-linux-arm64",
    "upload-release:linux-x64": "gh release create v$(jq -r .version package.json) --generate-notes || true && gh release upload --clobber v$(jq -r .version package.json) dist/kimbia-linux-x64",
    "upload-release:mac-x64": "gh release create v$(jq -r .version package.json) --generate-notes || true && gh release upload --clobber v$(jq -r .version package.json) dist/kimbia-macos-x64",
    "upload-release:mac-arm64": "gh release create v$(jq -r .version package.json) --generate-notes || true && gh release upload --clobber v$(jq -r .version package.json) dist/kimbia-macos-arm64",
    "upload-release:windows-x64": "pwsh -ExecutionPolicy Bypass -File scripts\\gh-release.ps1",

    "web": "cd web && bun install --frozen-lockfile && bun run dev"
  }
}

And now see the equivalent Kimbia configuration file:

# yaml-language-server: $schema=https://kimbia.mwco.app/schema.json
---
tasks:

  - name: publish
    description: Publish the project
    commands:
      - platforms:
          - linux
          - windows
          - mac
        run:
          - bun run build
          - bun publish

  - name: create-release
    description: Publish the project
    commands:

      - platforms:
          - linux
          - windows
          - mac
        run:
          - bun run build
          - node --experimental-sea-config sea-config.json

      - platforms:
          - linux
        arch:
          - arm64
        run:
          - cp $(command -v node) dist/kimbia-linux-arm64
          - |
            postject dist/kimbia-linux-arm64 NODE_SEA_BLOB dist/sea-prep.blob \
              --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2

      - platforms:
          - linux
        arch:
          - x64
        run:
          - cp $(command -v node) dist/kimbia-linux-x64
          - |
            postject dist/kimbia-linux-x64 NODE_SEA_BLOB dist/sea-prep.blob \
            --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2

      - platforms:
          - mac
        arch:
          - arm64
        run:
          - cp $(command -v node) dist/kimbia-macos-arm64
          - codesign --remove-signature dist/kimbia-macos-arm64
          - chmod 755 dist/kimbia-macos-arm64
          - |
            postject dist/kimbia-macos-arm64 NODE_SEA_BLOB dist/sea-prep.blob \
              --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
              --macho-segment-name NODE_SEA

      - platforms:
          - mac
        arch:
          - x64
        run:
          - cp $(command -v node) dist/kimbia-macos-x64
          - codesign --remove-signature dist/kimbia-macos-x64
          - chmod 755 dist/kimbia-macos-x64
          - |
            postject dist/kimbia-macos-x64 NODE_SEA_BLOB dist/sea-prep.blob \
              --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
              --macho-segment-name NODE_SEA

      - platforms:
          - windows
        arch:
          - x64
        run:
          - node -e "require('fs').copyFileSync(process.execPath, 'dist/kimbia-x64.exe')"
          - pwsh -ExecutionPolicy Bypass -File scripts\sign.ps1
          - pwsh -ExecutionPolicy Bypass -File scripts\postiject.ps1

  - name: upload-release
    description: Upload the release
    commands:

      - platforms:
          - linux
        arch:
          - arm64
        run:
          - |
            gh release \
            create v$(jq -r .version package.json) \
            --generate-notes || true
            gh release upload \
            --clobber v$(jq -r .version package.json) \
            dist/kimbia-linux-arm64

      - platforms:
          - linux
        arch:
          - x64
        run:
          - |
            gh release \
            create v$(jq -r .version package.json) \
            --generate-notes || true
            gh release upload \
            --clobber v$(jq -r .version package.json) \
            dist/kimbia-linux-x64

      - platforms:
          - mac
        arch:
          - x64
        run:
          - |
            gh release \
            create v$(jq -r .version package.json) \
            --generate-notes || true
            gh release upload \
            --clobber v$(jq -r .version package.json) \
            dist/kimbia-macos-x64

      - platforms:
          - mac
        arch:
          - arm64
        run:
          - |
            gh release \
            create v$(jq -r .version package.json) \
            --generate-notes || true
            gh release upload \
            --clobber v$(jq -r .version package.json) \
            dist/kimbia-macos-arm64

      - platforms:
          - windows
        arch:
          - x64
        run:
          - pwsh -ExecutionPolicy Bypass -File scripts\gh-release.ps1

  - name: web
    description: Run the website locally
    commands:
      - platforms:
          - linux
          - mac
        run:
          - cd web && bun install --frozen-lockfile && bun run dev

Which one do you prefer, when it comes to readability and maintainability?

But also one crucial difference is that with Kimbia, you can run the same tasks on different platforms and architectures and it will automatically select the right command for you. See the the Kimbia GitHub release workflow as an example.

Get involved 📦

Kimbia is open-source and we welcome contributions.

github.com/mistweaverco/kimbia