cli-remote-runner
v1.0.2
Published
Remote terminal runner for Cli Remote project
Maintainers
Readme
Cli Remote Runner
Remote terminal runner for Cli Remote project. This package provides:
- A CLI (
runner) - A programmatic npm API (
Runner,createRunner, clients/utilities)
Installation
Global Installation (Recommended)
npm install -g cli-remote-runnerLocal Installation
npm install cli-remote-runnerUsage
Quick Start
runner --url https://your-broker.com --id my-runner --secret your-secretProgrammatic Usage
import { createRunner } from 'cli-remote-runner';
const runner = createRunner();
runner.start();
process.on('SIGINT', () => {
runner.stop();
process.exit(0);
});Command Line Options
runner [options]
Options:
--url <url> Broker server URL (default: http://localhost:3000)
--id <id> Runner ID (default: runner-1)
--secret <secret> Runner secret for authentication
--help, -h Show help messageConfiguration
You can configure the runner using:
- Command line arguments (highest priority)
- Environment variables
- Configuration file
Environment Variables
Create a .env file in your project directory or .runner.env in your home directory:
BROKER_URL=https://your-broker.com
RUNNER_ID=my-runner
RUNNER_SECRET=your-secretConfiguration File Priority
.envin current directory.runner.envin home directory
Examples
Using environment variables
export BROKER_URL=https://broker.example.com
export RUNNER_ID=my-runner
export RUNNER_SECRET=my-secret
runnerUsing configuration file
Create .runner.env in your home directory:
BROKER_URL=https://broker.example.com
RUNNER_ID=my-runner
RUNNER_SECRET=my-secretThen simply run:
runnerOverride with command line
runner --url https://another-broker.com --id another-runnerRequirements
- Node.js >= 16.0.0
- A running broker server
Exports
Package root exports:
Runner,createRunnerloadConfig,SocketClient,RunnerClientPtyManager,PairingCodeGeneratorlogger,Logger,LogLevel
License
MIT
