GibilGibil
CLI Reference

gibil job

Manage background jobs started with gibil run --background

Manage background jobs started with gibil run --background. Poll for completion, view logs, cancel running jobs.

Usage

gibil job status <id> [--json]
gibil job list [--json]
gibil job cancel <id> [--json]
gibil job logs <id> [--json] [-f]

Subcommands

SubcommandDescription
status <id>Poll a job's status — returns exit code and output when done
listList all background jobs across all instances
cancel <id>Kill the remote process and mark the job as cancelled
logs <id>Fetch the output log from the remote server

Options

FlagDescriptionDefault
--jsonOutput as JSONfalse
-f, --followFollow log output in real time (logs only)false

Examples

# Start a background job
gibil run my-app "cd /root/project && pnpm build && pnpm test" --background --json
# → { "job_id": "j-a3f1b2c8", "instance": "my-app", "status": "running" }

# Check if it's done
gibil job status j-a3f1b2c8 --json
# → { "status": "running" } or { "status": "done", "exit_code": 0, "stdout": "..." }

# List all jobs
gibil job list

# View output
gibil job logs j-a3f1b2c8

# Follow output in real time
gibil job logs j-a3f1b2c8 -f

# Cancel a stuck job
gibil job cancel j-a3f1b2c8

How it works

  1. gibil run --background fires the command via nohup on the remote server
  2. Output is captured to /root/.gibil-jobs/{id}.log
  3. When the command finishes, exit code is written to /root/.gibil-jobs/{id}.exit
  4. gibil job status SSHes in and checks for the exit file
  5. Job metadata is stored locally in ~/.gibil/jobs/{id}.json

Jobs are cleaned up automatically when you destroy the instance with gibil destroy.

MCP equivalent

Background execution is also available via MCP tools:

vm_bash({ command: "pnpm test", background: true })
→ { job_id: "j-a3f1b2c8", status: "running" }

vm_job_status({ job_id: "j-a3f1b2c8" })
→ { status: "done", exit_code: 0, stdout: "..." }

Next steps

On this page