Stop copy-pasting dynamic values.

Devsyringe runs your command, extracts the value you need, and updates every file that needs it.

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

One small config.
One repeatable update.

Some files cannot read environment variables at runtime. Tunnel URLs, tokens, IDs, and build values end up copied into them by hand. Devsyringe automates that update without introducing a template engine.

  1. Run

    Start any shell command and read its output.

  2. Capture

    Match the dynamic value with a regular expression.

  3. Locate

    Find target lines using simple textual clues.

  4. Inject

    Write the value into every target file.

See the whole operation.

A single run starts a tunnel, captures its live URL, and updates the files that reference it.

Devsyringe capturing a value and updating target files

The config says exactly what happens.

A serum connects one source command to one or more target files. Run it with dsy inject -c devsyringe.yaml.

devsyringe.yaml
serums:
  localtunnel:
    source: lt --port 8080
    mask: https://[a-z0-9\-]+\.loca\.lt
    targets:
      env:
        path: ./.env
        clues: ["API_BASE_URL"]
      frontend:
        path: ./src/config.js
        clues: ["const", "API_URL"]
source
The command to run.
mask
The value to capture from its output.
targets
The files and lines to update.

Install it your way.

Gogo install github.com/alchemmist/devsyringe/cmd/dsy@latest
Homebrewbrew tap alchemmist/homebrew-tap
brew install devsyringe
Arch · AURparu -S devsyringe