https://github.com/zrosenbauer/lauf
Discover, validate, and execute TypeScript scripts with Zod-powered arguments.
https://github.com/zrosenbauer/lauf
Last synced: 4 months ago
JSON representation
Discover, validate, and execute TypeScript scripts with Zod-powered arguments.
- Host: GitHub
- URL: https://github.com/zrosenbauer/lauf
- Owner: zrosenbauer
- License: mit
- Created: 2026-02-23T01:04:46.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-03-26T21:49:55.000Z (4 months ago)
- Last Synced: 2026-03-27T08:42:29.420Z (4 months ago)
- Language: TypeScript
- Homepage: https://zrosenbauer.github.io/lauf/
- Size: 573 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README

Typed script runner for monorepos
Discover, validate, and execute TypeScript scripts with Zod-powered arguments.
---
## Features
- ð **Auto-discovery** â Scans every workspace package for scripts matching your configured glob patterns.
- â
**Zod-powered validation** â Define args with Zod schemas and get runtime validation + full TypeScript inference.
- ðĶ **Package management** â Declare npm packages in scripts or workspace config, auto-installed to cache without polluting project dependencies.
- ð§Đ **Workspace-agnostic** â Auto-detects pnpm, npm, yarn, bun, lerna, and single-package projects.
- ðŽ **Auto-prompting** â Missing required args are interactively prompted, so scripts work both in CI and locally.
- ðŠķ **Tiny API surface** â One function (`lauf()`), one schema library (`z`), one convention (`scripts/` directory).
---
## Quick Start
Install the `laufen` package.
```bash
pnpm add -D laufen
```
Setup a `lauf` script, including defining args, env variables, and packages.
```ts
import { lauf, z, infisical } from 'laufen';
export default lauf({
description: 'Say hello',
env: infisical({ path: '/ops/ci', env: 'dev' }),
packages: {
chalk: '^5.0.0', // Auto-installed to cache, no project dependency needed
},
args: {
name: z.string().default('world'),
loud: z.boolean().default(false),
},
async run(ctx) {
const { default: chalk } = await ctx.import('chalk');
const greeting = `Hello, ${ctx.args.name}!`;
const message = ctx.args.loud ? greeting.toUpperCase() : greeting;
ctx.logger.info(chalk.blue(message));
},
});
```
Run the script using the args you defined.
```bash
lauf run @my-org/my-package/hello --name=Zac --loud=true
```
> [!TIP]
> Requires Node.js >= 22.0.0
## Quick Reference
```bash
lauf init # scaffold lauf.config.ts
lauf create # generate a new script from a template
lauf list # discover all scripts across the workspace
lauf run # execute a script by name
lauf info # view a script's args and description
```
---
## ð Documentation
For full docs â configuration, script API, CLI reference, examples, and more â visit the **[documentation site](https://zrosenbauer.github.io/lauf/)**.
## ð License
[MIT](LICENSE)