# Getting started

This path installs the `jetlag` binary, starts a program with its clock 30 days ahead, and then puts the clock back to real time while the program keeps running.

You need Linux on x86-64 and `curl`. You do not need root, Nix or a dev shell.

The first success is a running program that prints a date 30 days from now, then today's date again, without a restart.

## Install Jetlag

Download the 0.1.0 release binary, a self-extracting file, and make it executable.

```
mkdir -p ~/.local/bin
curl -fsSL -o ~/.local/jetlag "https://gitlab.techtailors.net/api/v4/projects/slopkit%2Fjetlag/packages/generic/jetlag/0.1.0/jetlag-linux-amd64"
chmod +x ~/.local/bin/jetlag
```

If `~/.local/bin` is not on your `PATH`, add it for this shell, then check the install:

```
export PATH="$HOME/.local/bin:$PATH"
jetlag version
```

```
jetlag 0.1.0
```

The binary updates itself. Run `jetlag update` later to move to the newest release on the `stable` channel. Today it prints:

```
jetlag update
```

```
cram: jetlag 0.1.0 is already up to date
```

## Start a program 30 days ahead

1. Print the date, then print it again through Jetlag.

```
date -u
jetlag run --offset 30d -- date -u
```

`jetlag run` starts the command with its clock already shifted. It needs no privilege. Your dates will differ. The second one is 30 days after the first, and the line that starts with `jetlag:` goes to stderr.

```
Fri Dec  4 10:49:42 PM UTC 2026
jetlag: started date as pid 2638374
Sun Jan  3 10:49:42 PM UTC 2027
```

## Reset the clock of a running program

This step uses two terminals.

1. In the first terminal, start a loop that prints the date every second. `--listen` serves the Jetlag API for this program.

```
jetlag run --offset 30d --listen 127.0.0.1:7420 -- sh -c 'while true; do date -u; sleep 1; done'
```

The loop prints dates 30 days ahead.

```
jetlag: started sh as pid 2638391
jetlag: listening on http://127.0.0.1:7420
Sun Jan  3 10:49:42 PM UTC 2027
Sun Jan  3 10:49:43 PM UTC 2027
```

2. In the second terminal, ask Jetlag for the state of the program. `child` is the program that `jetlag run` started and what it started.

```
jetlag status --server http://127.0.0.1:7420 --target child
```

The first number after `tree:` is the pid of `sh`, so yours will differ. `+30d` is the Offset.

```
tree:2638391: 2 processes
  PID      COMM   MODE       OFFSET  WALL CLOCK
  2638391  sh     advancing  +30d    2027-01-03T22:49:46Z
  2638413  sleep  advancing  +30d    2027-01-03T22:49:46Z
```

3. Put the clock back to real time.

```
jetlag reset --server http://127.0.0.1:7420 --target child
```

```
tree:2638391: 2 processes
  PID      COMM   MODE  OFFSET  WALL CLOCK
  2638391  sh     real  0s      2026-12-04T22:49:46Z
  2638413  sleep  real  0s      2026-12-04T22:49:46Z
```

4. Look at the first terminal. The same loop, which Jetlag did not restart, now prints today's date. Press Ctrl-C to stop it.

```
Sun Jan  3 10:49:45 PM UTC 2027
Fri Dec  4 10:49:46 PM UTC 2026
Fri Dec  4 10:49:47 PM UTC 2026
```

## Check what you installed

The binary is the only file Jetlag added.

```
~/.local/bin/jetlag
```

## Next steps

Open the [docs](https://jetlag.slopkit.dev/docs/) for every command, the Target forms, the HTTP API and what a process Jetlag did not start needs. To build from source instead, see the [repo README](https://gitlab.techtailors.net/slopkit/jetlag#install-and-build).

## Verified

Run on this machine (Linux x86-64) with `HOME` and every XDG directory pointed at an empty scratch directory, no dev shell and no root, in the order shown, with the real output above. The two terminals were one script that ran the loop in the background.

Passed:

- The `curl` download of the 0.1.0 release binary with no credentials, `chmod +x`, `jetlag version`, `jetlag update`.
- `jetlag run --offset 30d -- date -u`, then the loop with `--listen`, `jetlag status --target child` and `jetlag reset --target child`, and the loop printing today's date afterwards.

Not run:

- Building from source in the dev shell (see the repo README).
- Kubernetes, `jetlag shift` on a process Jetlag did not start, and the HTTP API from another client.
