Run, Isolate, and Act: A Minimal Primitive for Container Workflows

You’ve probably wanted to run a one-off command in a clean environment, or pipe a task into an AI tool and do something with the result—commit the changes, export a patch, run tests—without wiring up a full pipeline. dockpipe is a small open-source CLI that does exactly that: one primitive, any command, optional follow-up action.

This post is a short intro to what it is, why it’s useful, and how you can use it for automation and chained workflows (including AI).

What is dockpipe?

dockpipe is a single primitive for running commands in disposable containers and optionally acting on the result. It’s not a workflow engine, not an AI framework, and not tied to any vendor. It’s a composable building block you plug into your own scripts and automation.

The model:

  1. Spawn — Start a container from an image (default is a light dev image; you can use your own).
  2. Run — Execute whatever you pass in: a one-liner, a script, or a tool (e.g. Claude, Codex, npm test).
  3. Act — Optionally run an action script after the command (e.g. commit all changes, export a patch, print a summary).

Your current directory is mounted at /work in the container, so the command sees your project. The action runs inside the same container right after the command, with access to exit code and work dir. That’s it.

Why use it?

Isolation without commitment — Run risky or messy commands (deps, globals, one-off experiments) in a container. When the run finishes, the container is gone. Your host stays clean.

Same flow for everything — One pattern for “run tests,” “run a linter,” “run Claude and commit,” or “run my custom script.” You choose the image, the command, and the action. No special cases in the tool.

Pipe-friendly — Stdin and stdout work normally. You can pipe a prompt in, pipe output to the next step, or chain multiple dockpipe invocations in a shell script.

Composable — The command can be a script. The action can be your own script. You can chain dockpipe with other tools (e.g. dockpipe -- ./step1.sh | dockpipe -- ./step2.sh or use it inside a Makefile or CI). It’s designed to be composed into larger workflows.

AI workflows without lock-in — Great for “run an AI assistant in a container, then commit (or patch).” The core doesn’t know or care that it’s AI; you pass the AI tool as the command and use an action to persist the result. Same primitive works for non-AI automation.

Chaining and automation

Because dockpipe is a single primitive, you can:

  • Chain steps — Run one script in a container, pipe or pass its output to the next (e.g. plan → implement → review, each in its own clean run).
  • Automate AI workflows — “Pipe prompt → run Claude (or another agent) in container → action commits or exports patch.” The repo includes an example (clone, worktree, Claude, commit) you can copy or adapt.
  • CI-like local runsdockpipe -- make test or dockpipe -- bash -c "npm ci && npm test" in a clean environment without polluting your machine.
  • One-off experiments — Try a new tool or version in a container; no global installs, no cleanup.

You stay in control: you pick the image, the command, and the action. The tool doesn’t impose workflow structure—it just runs and (optionally) acts.

Examples

Generic command (default image):

dockpipe -- ls -la
dockpipe -- bash -c "npm test"

Pipe in a prompt, run Claude, commit the result:

echo "refactor the auth module" 
  | dockpipe --template claude --action examples/actions/commit-worktree.sh 
  -- claude --dangerously-skip-permissions -p "$(cat)"

Custom image and workdir:

dockpipe --image my-dev --workdir /path/to/repo -- bash -c "npm ci && npm test"

Run your script, then run an action (e.g. commit or export patch):

dockpipe --action examples/actions/commit-worktree.sh -- ./my-script.sh

When it fits

  • You want isolation for one-off or repeated commands without maintaining a full orchestration stack.
  • You’re building automation (scripts, cron, local pipelines) and want a simple “run in container, then do X” step.
  • You’re chaining AI tools (or any CLI) and want a clean boundary: run in container, then commit/patch/summarize.
  • You like Unix-style composition: small tools, pipes, and scripts rather than a big framework.

Install and try it

Linux (.deb): Download the latest release and install:

sudo dpkg -i dockpipe_*_all.deb

Requires Bash and Docker. From source: clone the repo and add bin to your PATH.

Quick sanity check:

dockpipe -- echo "hello from container"

Summary

dockpipe gives you one primitive: spawn → run → act. Use it for isolated runs, automation, chained steps, or AI workflows. It stays minimal and composable so you can plug it into your own scripts and tooling without adopting a framework.

If you try it and have ideas or feedback, the repo is github.com/jamie-steele/dockpipe.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

Meet Tars: The Local-First, Autonomous AI Sidekick for Your Terminal

Next Post

How I Fixed a Silent 500 Error in My Supabase Edge Function

Related Posts