Project

buildonce

0.0
There's a lot of open issues
Embeds Once primitives in Ruby through the native Once library.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 1.16
 Project Readme

Once

Continuous integration Latest release License Documentation

Once

🧱 Build once. ♻️ Reuse everywhere.

Once turns repository automation into typed, cacheable actions that humans and coding agents can discover, run, and reuse. Give every action explicit inputs, outputs, and environment, and Once content-addresses the result so it only ever runs when something actually changed, locally or on a shared cache, across developers, coding agents, continuous integration, and machines.

✨ Why Once

  • 🧱 Build once: declare inputs, outputs, and environment; results are content-addressed.
  • ♻️ Reuse everywhere: restore outputs instantly from a local or shared cache.
  • πŸš€ Run anywhere: send only the declared inputs to a fresh local or hosted sandbox.
  • πŸ€– Agent-native: a built-in Model Context Protocol server lets coding agents discover and run actions.
  • 🌍 Multi-ecosystem: native support for Apple, Android, Kotlin, Rust, Go, C/C++, Elixir, Ruby, JavaScript, Zig, and more.

πŸ“¦ Install

Install the current release with mise:

mise use -g "github:tuist/once@$(mise latest github:tuist/once)"
mise exec -- once --version

Use mise use github:tuist/once@... inside a repository when the project should pin Once in its own mise.toml.

πŸ€– Connect a coding harness

Once includes a Model Context Protocol server. Add it to a coding harness that supports servers over standard input and output, and start it through mise so global installs and project pins both work:

{
  "mcpServers": {
    "once": {
      "command": "mise",
      "args": [
        "-C",
        "/absolute/path/to/your/project",
        "exec",
        "--",
        "once",
        "mcp",
        "--workspace",
        "/absolute/path/to/your/project",
        "--allow-run"
      ]
    }
  }
}

Remove --allow-run if the harness should not edit manifests, build, test, run, or start runtime sessions.

Then ask the harness something like:

Use Once to initialize this directory as a Rust binary package. Discover the
available target kinds, fetch the Rust binary starter, create the files, and
build the target.

The harness discovers target kinds, fetches starter metadata, materializes it, validates the graph, and verifies the result, all through live discovery. The same loop supports a request such as "build an Android app with Once." See the coding harness guide for typed graphs, annotated scripts, result checks, and project memory.

πŸ“œ Run a script

Add a small contract to an existing script so Once knows the inputs, outputs, environment, and working directory that shape the action:

#!/usr/bin/env bash
# once input "../assets/**/*"
# once output "../dist/"
# once cwd ".."

npm run build-assets

Run it as a cached action, locally or on a remote sandbox:

once exec -- bash scripts/build-assets.sh
once exec --remote --compute microsandbox -- bash scripts/build-assets.sh

Scripts can also run directly with a Once shebang:

#!/usr/bin/env -S once exec -- bash

πŸ“š Documentation

Read the full documentation at buildonce.dev/docs. A few good starting points:

πŸ“ License

Once is open source under the MIT License.