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

# Laravel Cloud - GitHub Copilot SDK voor Laravel

> Praktische aanwijzingen voor het draaien van de Laravel Copilot SDK op Laravel Cloud: Copilot CLI-installatie, omgevingsvariabelen en stdio-/TCP-modus.

## Gebruik op Laravel Cloud

## Installatie

Voeg het volgende toe aan **Settings > Deployments > Build commands** en deploy.

```shell theme={null}
export PATH="$PATH:/var/www/.local/bin"
curl -fsSL https://gh.io/copilot-install | bash
/var/www/.local/bin/copilot --version
```

Het pad van de CLI is `/var/www/.local/bin/copilot`, dus stel het volgende in bij **Custom environment variables**.

```dotenv theme={null}
COPILOT_CLI_PATH=/var/www/.local/bin/copilot
COPILOT_GITHUB_TOKEN=
```

Voor `COPILOT_GITHUB_TOKEN` kun je elke authenticatiemethode gebruiken die de Copilot CLI ondersteunt, zoals `GH_TOKEN` of `GITHUB_TOKEN`.

Als je de standaard stdio-modus gebruikt, is deze installatie voldoende.

## Draaien in TCP-modus

Stel bij **App cluster > Background processes > Custom worker** het commando `/var/www/.local/bin/copilot --headless --port 12345` in.
Het draait dan continu als achtergrondproces en wordt bij een deploy automatisch herstart.

Het poortnummer is vrij te kiezen.

Stel bij **Custom environment variables** de variabele `COPILOT_URL` in.

```dotenv theme={null}
COPILOT_URL=tcp://127.0.0.1:12345
# COPILOT_CLI_PATH is in TCP-modus niet nodig. Als beide zijn ingesteld, heeft TCP-modus voorrang.
```

Omdat het proces continu draait, is het geheugengebruik hoog en kan een server met minimaal 2 GiB RAM nodig zijn.
Gebruik binnen een HTTP-request mislukt vaak omdat het niet binnen 60 seconden klaar is; uitvoering via een queue wordt daarom aanbevolen.

Op Laravel Cloud is de TCP-modus niet erg praktisch, dus wordt de stdio-modus aanbevolen.

Je kunt ook het Worker cluster van de hogere abonnementen gebruiken. Dat is handig als je geheugentekort in het App cluster wilt vermijden.

## Aandachtspunten

* Goedkope servers lopen snel tegen geheugentekort aan.
* De standaard HTTP-timeout is 20 seconden. Verhoog deze bij veel mislukkingen tot maximaal 60 seconden.

<Info>
  Raadpleeg de [GitHub-repository](https://github.com/invokable/laravel-copilot-sdk) voor de meest actuele informatie.
</Info>


## Related topics

- [GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/index.md)
- [GitHub Actions - GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/github-actions.md)
- [Testen - GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/fake.md)
- [Aan de slag - GitHub Copilot SDK voor Laravel](/nl/packages/laravel-copilot-sdk/getting-started.md)
- [Authenticatie - GitHub Copilot SDK for Laravel](/nl/packages/laravel-copilot-sdk/auth.md)
