Harmont docs
Pipeline SDK

Pipeline SDK

Define Harmont pipelines in code — Python or TypeScript.

A Harmont pipeline is a small program. You import the SDK, build a graph of shell steps, and register it so the CLI can find it. You write pipelines as Python or TypeScript programs rather than YAML, and hm runs them.

The same pipeline can be written in Python or TypeScript. Pick a language with the switch on any code sample; your choice follows you across the docs.

.hm/pipeline.py
import harmont as hm

@hm.pipeline("ci", triggers=[hm.push(branch="main")])
def ci() -> tuple[hm.Step, ...]:
    project = hm.rust.toolchain(path=".")
    return (project.build(), project.test())
.hm/pipeline.ts
import { pipeline, push, type PipelineDefinition } from "@harmont/hm";
import { rust } from "@harmont/hm/toolchains";

const project = rust.toolchain({ path: "." });

const pipelines: PipelineDefinition[] = [
  {
    slug: "ci",
    triggers: [push({ branch: "main" })],
    pipeline: pipeline([project.build(), project.test()]),
  },
];

export default pipelines;

Install

Install the SDK for your language so your editor gives you types and autocomplete as you write pipelines.

pip install harmont
# or: uv add harmont
npm install @harmont/hm
# or: pnpm add @harmont/hm
# or: bun add @harmont/hm

Where to go next

On this page