Introduction

Install

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

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

Hello, World!

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

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

This creates a command which outputs a file with the contents Hello, World!. Run tg build to build the command.

$ tg build
fil_01tvcqmbbf8dkkejz6y69ywvgfsh9gyn1xjweyb9zgv0sf4752446g

Run tg checkout to check out the output.

# Check out the file to `hello.txt`.
$ tg checkout fil_01tvcqmbbf8dkkejz6y69ywvgfsh9gyn1xjweyb9zgv0sf4752446g hello.txt
# Print the file's contents.
$ cat hello.txt
Hello, World!

Run v. Build

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

Run tg run.

$ tg run
info process pcs_deadbeef
Hello, World!

Run tg run again.

$ tg run
info process pcs_cafebabe
Hello, World!

Each time you invoke tg run, a new process is run and you will see Hello, World! printed to the console.

Now invoke tg build.

$ tg build
info process pcs_feedface

And invoke tg build again.

$ tg build
info process pcs_feedface

You will see the same process id. When you invoke build, you are running a process in a sandbox. The process is cached and each re-invocation will fetch the cached process.