Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmuellr/cmd-runner
runs commands
https://github.com/pmuellr/cmd-runner
Last synced: about 1 month ago
JSON representation
runs commands
- Host: GitHub
- URL: https://github.com/pmuellr/cmd-runner
- Owner: pmuellr
- Created: 2019-06-30T22:01:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T03:18:08.000Z (about 2 years ago)
- Last Synced: 2024-04-09T21:04:44.059Z (9 months ago)
- Language: JavaScript
- Size: 1.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cmd-runner - runs commands
================================================================================`cmd-runner` is a tool to help run multiple command-line programs and manage
their output. Each command is defined in a stand-alone file, and when run,
will generate a new instance of it's output which will be available live,
and historically.install
--------------------------------------------------------------------------------npm -g install pmuellr/cmd-runner
usage
--------------------------------------------------------------------------------cmd-runner
`start` is the default sub-command
subcommands:
start - starts the server
options:
-c --config
-h --help
-v --versionenvironment variables:
PORT used as the `port` option, if it isn't specified
DEBUG generate diagnostic outputhttp api
--------------------------------------------------------------------------------The http api generally accepts and returns JSON objects in request and
response bodies. The shape of the APIs trends towards REST-yErrors returned from the HTTP API will have the following JSON shape:
{ error: string }
### JSON structures
**`InvocationParameters`**
{
command: string,
env: [string],
args: [string],
cwd: string,
}**`Command`**
{
id: string,
name: string,
...InvocationParameters,
osx: InvocationParameters,
linux: InvocationParameters,
windows: InvocationParameters,
}**`Output`**
{
id: string,
command: Command,
pid: number,
timeStart: string, // iso date
timeEnd: string, // iso date
timeRun: number, // seconds of timeEnd - timeStart
length: number,
processInfo: ProcessInfo,
data: string
}**`ProcessInfo`**
see: https://www.npmjs.com/package/pidusage
{
cpu: number, // percentage (from 0 to 100*vcore)
memory: number, // bytes
ppid: number, // PPID
pid: number, // PID
ctime: number, // ms user + system time
elapsed: number, // ms since the start of the process
timestamp: number // ms since epoch
}### GET /api
returns information about the HTTP API
result:
200: { version: string }
### GET /api/commands
returns the list of commands available to run
result:
200: { commands: [Command] }
### POST /api/commands/:commandID
run a command
result:
200: { command: Command, outputID: string }
### GET /api/outputs/
get a list of commands which have output available
result:
200: { commands: [Command] }
### GET /api/outputs/:commandID
get summary data of the outputs of a specific command
note the `data` property in the Output objects is not returned
result:
200: {
outputs: [Output]
}### GET /api/outputs/:commandID/:outputID?since=lastLength
get the data about a specific output
when the `since` query parameter is used, the `data` property will only
contain data appended to the output after the specified lengthresult:
200: {
output: Output
}