Skip to content
Agentmart
Submit a tool

straylight-script

Write Haskell scripts using Straylight.Script instead of bash.

Skill by justinfleek

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/justinfleek-straylight-script

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Write Haskell scripts using Straylight.Script instead of bash. Use when writing scripts, shell automation, bash replacement, command-line tools, or when the user mentions bash, shell, scripts, or command-line operations.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/straylight-script

What's inside

Skill name
straylight-script
Description
Write Haskell scripts using Straylight.Script instead of bash. Use when writing scripts, shell automation, bash replacement, command-line tools, or when the user mentions bash, shell, scripts, or command-line operations.
License
MIT
Compatibility
opencode
Instructions
235 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Straylight Script - Typed Unix

Write Haskell scripts using Straylight.Script instead of bash.

## Core Principle

**ALL scripts in Haskell. ZERO bash logic.**

If it has a branch, it's not bash. Rewrite in Haskell.

## Directory Structure

```
nix/scripts/
├── Straylight/
│   ├── Script.hs                 # Main prelude (1193 lines)
│   ├── Nix.hs                    # WASM plugin interface
│   ├── Config/                   # Dhall type definitions
│   │   ├── Base.dhall            # StorePath, MemMiB, CpuCount
│   │   ├── Firecracker.dhall     # VM config schema
│   │   └── NvidiaSdk.dhall       # NVIDIA extraction config
│   └── Script/
│       ├── Config.hs             # FromDhall instances
│       ├── Clap.hs               # Parser for clap-based CLI tools
│       ├── Getopt.hs             # Parser for GNU getopt_long tools
│       ├── Oci.hs                # OCI container operations
│       ├── Vm.hs                 # VM rootfs construction
│       ├── Vfio.hs               # GPU passthrough (VFIO/IOMMU)
│       └── Tools/                # 24 tool wrappers
│           ├── Rg.hs, Bwrap.hs, Crane.hs, Jq.hs, ...
├── nvidia-extract.hs             # NVIDIA SDK extraction
├── oci-gpu.hs                    # GPU container runner
├── fc-run.hs                     # Firecracker runner
└── vfio-bind.hs                  # GPU passthrough
```

## Writing a New Script

### Step 1: Create the Script

```haskell
-- nix/scripts/my-tool.hs
{-# LANGUAGE OverloadedStrings #-}

import Straylight.Script
import System.Environment (getArgs)

main :: IO ()
main = do
    args <- getArgs
    case args of
        [arg1, arg2] -> script $ doThing (pack arg1) (pack arg2)
        _ -> script $ do
            echoErr "Usage: my-tool <arg1> <arg2>"
            exit 1

doThing :: Text -> Text -> Sh ()
doThing x y = do
    echoErr $ ":: Processing " <> x
    output <- run "echo" [x, y]
    echo output
```

### Step 2: Register in script.nix

```nix
compiled = {
  my-tool = mkCompiledScript {
    name = "my-tool";
    deps = [ final.jq final.crane ];
  };
};
```

### Step 3: Run It

```bash
# Compiled (production)
nix run .#straylight.script.compiled.my-tool -- arg1 arg2

# Interpreted (development)
nix run .#straylight.script.shell
runghc -i. my-tool.hs arg1 arg2
```

## API Reference

### Running Scripts
```haskell
script      :: Sh a -> IO a   -- Silent, errors on failure
scriptV     :: Sh a -> IO a   -- Verbose (shows commands)
scriptDebug :: Sh a -> IO a   -- Very verbose
```

### Running Commands
```haskell
run       :: FilePath -> [Text] -> Sh Text  -- Capture stdout
run_      :: FilePath -> [Text] -> Sh ()    -- Ignore stdout
bash      :: Text -> Sh Text                -- Run bash -c "..."
which     :: FilePath -> Sh (Maybe FilePath)
```

### Output
```haskell
echo      :: Text -> Sh ()       -- Print to stdout
echoErr   :: Text -> Sh ()       -- Print to stderr (USE THIS)
die       :: Text -> Sh a        -- Print error and exit
exit      :: Int -> Sh ()
```

### Filesystem
```haskell
ls, cp, mv, rm, mkdir, mkdirP
pwd, cd, home, withTmpDir
test_f, test_d, test_e         -- Existence tests
symlink, readlink, canonicalize
```

### Text (Data.Text)

From justinfleek/ComfyUI-Lattice-Compositor, MIT.

More from justinfleek/ComfyUI-Lattice-Compositor

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Feb 7, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from justinfleek

Cite this page

straylight-script skill. Agent Mart. https://agentmart.dev/skills/justinfleek-straylight-script (last updated 2026-10-24)