httpcmd

command module
v0.0.0-...-4420025 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 16 Imported by: 0

README

httpcmd

Tiny HTTP server that runs pre-configured commands in pre-configured working directories.

Usage

cp config.example.json config.json

go run . -config config.json

Then hit the endpoints (GET or POST):

curl http://localhost:8080/status

Config

config.json must include a list of endpoints with path, command, and work_dir.

{
  "addr": ":8080",
  "default_timeout_seconds": 30,
  "endpoints": [
    {
      "path": "/status",
      "command": ["/bin/sh", "-c", "echo ok"],
      "work_dir": "/tmp",
      "timeout_seconds": 5,
      "pty": true
    }
  ]
}
  • addr: optional; defaults to :8080
  • default_timeout_seconds: optional; 0 means no timeout
  • timeout_seconds: optional per endpoint; overrides default
  • pty: optional; when true, runs the command in a pseudo-terminal (stdout/stderr combined)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL