cli / static files / regex injection

Inject dynamic values into static files without manual copy-paste.

Devsyringe is a Go CLI that runs a command, extracts a value with a regex, and injects it into one or more files. You define the rules once in `devsyringe.yaml`, then run one command.

Install: go install github.com/alchemmist/devsyringe/cmd/dsy@latest

$ dsy inject -c devsyringe.yaml
→ Update ./.env.
→ Update ./static/config.js.
status: ok

mode: strict
          
Why

Static files do not have runtime config injection. When your tunnel URL, token, or build value changes, you end up copying it into HTML, JS configs, or legacy files. Devsyringe automates the update without turning your project into a templating system.

The core idea is simple: run a command, extract the value with a regex, and inject it into one or more target files using clues.

no templates

Works on plain text. No build system, no runtime hooks, no dependencies.

one source, many files

Extract once with a regex, inject into any number of targets.

local and CI

Run `dsy inject` locally, or in CI to keep docs and configs up to date.

observable

Built-in TUI shows running processes, status, and logs.

Flow

Define sources and targets in YAML, then run one command.

1. run

Start a command and read its live output.

2. match

Use `mask` (regex) to capture the dynamic value.

3. locate

Find target lines by `clues` — multiple words on the same line.

4. inject

Replace the matched value and write back to disk.

Tip: run dsy without arguments to open the TUI process table.

Use Cases

Designed for situations where simple files still need dynamic values.

tunnel URLs

Extract a live URL from a tunnel command and inject it into `.env` and client configs.

tokens and keys

Pull tokens from CLIs and keep infra configs in sync.

build metadata

Inject git SHA or build versions into docs and status pages.

docs automation

Update README or LaTeX files with live stats pulled from APIs.

infra updates

Fetch addresses, endpoints, or secrets and update static config files.

Demo

A single command starts a tunnel, grabs the URL, and updates multiple files in place.

Devsyringe demo animation
Install

Choose the package manager you already use.

# Go
go install github.com/alchemmist/devsyringe/cmd/dsy@latest

# Arch (AUR)
paru -S devsyringe
# or: yay -S devsyringe

# macOS (brew)
brew tap alchemmist/homebrew-tap
brew install devsyringe
CLI

Core commands that power the workflow.

inject

Start an injection based on a YAML config.

list

Show the dynamic list of running processes.

logs

Read logs for a running process by title.

stop / delete

Stop a process or delete it with logs.

Run dsy help or dsy [command] --help for options.

flow map mode: strict latency: depends on source
source command lt --port 8080 live output stream
mask (regex) https://...loca.lt first match wins
targets + clues .env and src/config.js replace only matched lines
source: command output match: regex targets: clues file update
live snippet format: YAML engine: devsyringe

Each `serum` describes one dynamic value: how to obtain it, how to match it, and where to inject it.

serums:
  localtunnel:
    source: lt --port 8080
    mask: https://[a-z0-9\\-]+\\.loca\\.lt
    targets:
      env_file:
        path: ./.env
        clues: ["API_BASE_URL"]
      frontend_config:
        path: ./src/config.js
        clues: ["API_URL", "const"]
        

What it does: starts `lt`, waits for a tunnel URL in the output, then replaces the value on lines that contain the clues in both `.env` and `src/config.js`.

Run: dsy inject -c devsyringe.yaml.

Step by step:

1. command

Launches `lt --port 8080` and reads the stream output.

2. match

Captures the first URL matching the regex mask.

3. replace

Finds lines that include the clues and replaces the matched value.

4. write

Saves both files and prints update logs to the terminal.