GibilGibil

gibil run

Execute a command on a remote server

Execute a shell command on a running server and stream the output back. The workhorse for both human and agent workflows.

Usage

gibil run <name> "<command>" [options]

Description

Executes a command on a running Gibil server via SSH and streams the output back. Returns the exit code.

Options

FlagDescriptionDefault
--jsonOutput as JSONfalse

Examples

# Run a simple command
gibil run my-app "uname -a && node --version"

# Run tests
gibil run my-app "cd /root/project && pnpm test"

# Chain commands
gibil run my-app "cd /root/project && pnpm install && pnpm build && pnpm test"

# JSON output for AI agents
gibil run my-app "cd /root/project && pnpm test" --json

JSON output

{
  "stdout": "✓ 53 tests passing\n",
  "stderr": "",
  "exit_code": 0
}

Shell quoting matters. If your command contains quotes or variables, wrap the outer string in double quotes and use single quotes inside — or use gibil exec --script to avoid escaping entirely.

Next steps

On this page