Skip to content
Back to skills

Proc Fs

ASecurity

Use when F# code (build scripts, tools, tests) needs to run commands: a sequence of commands like a shell script, capturing output, piping, or changing directory and environment for a few commands. Proc.Fs gives shell { }, exec { } and the Cmd module on top of Proc.

  • 30 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
toolsgoshelldockergitapi

Works with

  • api

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add nullean/proc --skill proc-fs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Proc Fs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Proc Fs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nullean-proc-fs/badge)](https://www.skillsdirectory.com/skills/nullean-proc-fs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: proc-fs
description: >-
  Use when F# code (build scripts, tools, tests) needs to run commands: a sequence of commands like a shell script,
  capturing output, piping, or changing directory and environment for a few commands. Proc.Fs gives shell { },
  exec { } and the Cmd module on top of Proc.
---

# Proc.Fs

`open Proc.Fs`. `shell { }` runs commands in order like a shell script; the first failure throws
`ProcExecException` and stops the block. `shellx { }` also prints each command first, like `set -x`.

```fsharp
let sha = shell {
    sh $"git fetch"
    let! sha = text $"git rev-parse HEAD"                  // stdout, trimmed
    let! files = lines $"git diff --name-only | grep \.fs$" // stdout as lines; | pipes
    for file in files do
        sh $"dotnet fantomas {file}"                       // {file} is always exactly one argument
    let! code = exitCode $"git diff --quiet"               // no throw
    let! ok = succeeds $"which docker"                     // exit code 0, no throw
    return sha
}
```

Directory and environment, for the rest of the block or a scope:

```fsharp
shell {
    env "CI" "true"                                  // for the rest of the block, like export
    unsetEnv "NUGET_API_KEY"
    for project in ["src/Proc"; "src/Proc.Fs"] do
        use! _ = inDir project                       // restored after the loop body, even on an exception
        use! _ = withEnv ["Configuration", "Release"]
        sh $"dotnet pack"
}
```

Background processes, clean-up and steps that run at the same time:

```fsharp
shell {
    use! api = background (sh $"dotnet run" |> Cmd.waitFor (fun l -> l.Contains "Now listening")) // stopped at scope end
    use! _ = defer (sh $"docker compose down")       // runs at scope end, also after a failure
    let! results = concurrently [ steps { sh $"dotnet test a" }; steps { sh $"dotnet test b" } ]
    return results
}
```

## Gotchas

- `sh` takes an interpolated string and splits only the text you wrote: whitespace separates arguments, quotes group
  them, and an interpolated value never splits. Do not build the command string with `sprintf` first.
- Unquoted `>`, `<`, `;` and `&` throw: there is no redirection or chaining. Quote them to pass them literally, and
  use separate `sh` lines instead of `;` or `&&`.
- A `shell { }` block runs as soon as it is evaluated; use `steps { }` for a block that runs later, where it is used.
- A background process that exits with a non-zero exit code fails the next command of the block.
- `parallel` is reserved in F#: the step is `concurrently`.
- The package's README has the full list of steps, `exec { }` and `Cmd`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.