> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# OS scheduler bridge

> Emit launchd or systemd user units that fire the project through one engine law.

> [!NOTE]
>
> **Live project control plane.** The released engine
> discovers `nika.yaml` from the working directory toward its
> ancestors. The file is optional when built-in defaults are enough. Its
> project-shape grammar is closed: `nika` ·
> `ceiling` · `arm` · `traces` ·
> `registry`. Direct runs and the cadence path
> (`nika arm` · `nika serve`) read the same file.

Use the host scheduler when it already owns wakeups, restarts and process
lifetime. Nika emits the bridge; the engine still owns cadence policy, spend,
locking, firing and proof.

## Preview generated units

```sh theme={"system"}
nika arm --emit launchd
nika arm --emit systemd
```

Without `--write`, the exact unit prints to stdout. Review its working
directory, binary, calendar and environment-file path before installation.

## Write a user-scoped unit

```sh theme={"system"}
nika arm --emit systemd --write \
  --mode user \
  --nika-bin /usr/local/bin/nika \
  --env-file /srv/nika/project.env
```

The live default is user scope. `launchd` writes a macOS user agent. `systemd`
writes a user timer and service pair.

| Option | Purpose |
| - | - |
| `--write` | Install rather than print |
| `--out <dir>` | Override the generated output directory |
| `--mode user` | Keep the unit under the operator account |
| `--env-file <file>` | Load provider keys without embedding their values |
| `--nika-bin <path>` | Pin the executable instead of trusting a login `PATH` |

## One firing law

OS WAKEUP · ENGINE DECISION

<pre tabIndex="0">
  launchd calendar ─┐
  &#x20;                    ├── nika arm fire \<label>
  &#x20;   systemd timer ─────┘          │
  &#x20;                               └── lock · ceiling · run · ledger
</pre>

The generated unit does not reimplement Nika policy. It wakes the engine and
the engine applies the same firer used by `nika serve`.

## Keep secrets out of emitted bytes

The unit carries the path to an environment file, never provider secret
values. `nika.yaml` carries project policy, not credentials. The workflow
declares secret names under its own `secrets:` contract.

## Disarm as a state, not a deletion

```yaml theme={"system"}
nika: my-project

arm:
  - workflow: workflows/nightly-report.nika
    cadence: "TZ=UTC 0 3 * * *"
    plafond: 0.25
    manqué: sauter
    actif: false
    raison: downstream maintenance
    jusqu_au: 2026-10-01
```

The suspension remains reviewable. `nika arm disarm <label> --write` can remove
generated unit files and teaches the host unload command, but it does not
pretend that removing a unit edited project intent.

## Continue

> [card] [Resident server](https://docs.nika.sh/sdk/operations/resident-server.md)
>
> Use the wall-clock loop where no OS scheduler exists.

> [card] [Install the binary](https://docs.nika.sh/getting-started/installation.md)
>
> Install the binary for headless operation.

> [card] [Security boundary](https://docs.nika.sh/sdk/operations/security.md)
>
> Keep authority outside generated files.

> [card] [Arm reference](https://docs.nika.sh/reference/arm.md)
>
> Full command, policy and exit semantics.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.