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.
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())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 harmontnpm install @harmont/hm
# or: pnpm add @harmont/hm
# or: bun add @harmont/hmWhere to go next
Chains & steps
The Step primitive, forking, and waits — how the graph is built.
Toolchains
Install, build, and test for Rust, Python, Go, Node, CMake, and more.
Caching
TTL, on-change, and forever cache policies.
Triggers
Run pipelines on push or pull request.
Reference
Every public function, class, and toolchain, generated from the source.