Tangram is a build system and package manager that makes your builds fast and reliable. Tangram locks all your project's dependencies in a lockfile, including all compilers, interpreters, binaries, and libraries, and breaks down your builds into small, independently cacheable steps. This allows Tangram to reuse work from other machines with confidence, and distribute work across as many machines as possible. Tangram is programmable with TypeScript, which makes it easy to write builds with autocomplete and type checking. It uses a content addressed storage system accessed through a virtual filesystem to minimize disk use and network transfer.

To get started, run the install script below, or download the latest release and add it to $PATH.

curl -fsSL https://tangram.dev/install.sh | sh

Create a file at the root of your project called tangram.ts with the following content.

export default tg.target(() => tg.file("Hello, World!"));

Run tg build.

$ tg build
fil_01tvcqmbbf8dkkejz6y69ywvgfsh9gyn1xjweyb9zgv0sf4752446g
$ tg cat fil_01tvcqmbbf8dkkejz6y69ywvgfsh9gyn1xjweyb9zgv0sf4752446g
Hello, World!

As a build system

Use Tangram to build your existing projects faster and more reliably. This example builds a Rust project. Because all dependencies, including toolchains and native libraries, are locked with Tangram's lockfile, incremental build artifacts can be cached and shared between machines.

import openssl from "openssl";
import { cargo } from "rust";
import * as std from "std";
import source from "./packages/hello";
export default tg.target(() => {
return cargo.build({
env: std.env(openssl()),
source,
});
});

Run tg run to build and run the program.

$ tg run
Hello, World!

As a package manager

Use Tangram to build reproducible environments that start instantly. This example builds an environment that contains specific versions of jq and ripgrep locked Tangram's lockfile.

import jq from "jq";
import ripgrep from "ripgrep";
import * as std from "std";
export default tg.target(() => std.env(jq(), ripgrep()));

Run tg run -- sh to build the environment and run a shell in it.

$ tg run -- sh
$ jq --version
jq-1.7.1
$ rg --version
ripgrep 14.1.1
$ exit