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

# Integrate GitHub Enterprise Server (GHES)

## Introduction

In this page you'll learn how to configure those items:

1. Get GHES to push events (ex: “new PR created”) to Cosmos via webhooks
2. Configure a Cosmos Daemon on a VM (where the GHES local repos will be cloned locally)
3. Get Cosmos to interact with GHES via the `gh` cli
4. Deploy your first Cosmos PR experts and v1.0 software factory

Below is the flow showing how a PR deep code reviewer expert will automatically trigger when a PR is created:

```mermaid theme={null}
sequenceDiagram
	autonumber
	participant A as Augment Code | Cosmos
	participant VM as VM
	participant GIT as GitHub Enterprise Server (GHES)
	GIT->>A: Webhook: Pull Request created (PR payload)
	A->>VM: run experts locally via Daemon
	VM->>VM: Start Expert (spawn/run expert agent)
	VM->>VM: Expert analyzes PR (diff + context)
	VM->>GIT: POST PR comment (gh CLI: create comment)
	GIT-->>VM: 201 Created (comment posted)
```

Below is a high level architecture diagram of the components at play:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-51.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=8b2dc4a12820d2254efe47609fc413e3" alt="Image" width="2316" height="1296" data-path="images/image-51.png" />

## Prerequisites

To configure the one-time connectivity between Cosmos and GHES:

**Cosmos**

* must be an admin to create a Augment service account and webhooks

**GHES**

* must have admin role to create a new user acting as service account
* must be an enterprise owner (and owner of the organizations that owns the repos) to add the service account as collaborator on repos
* allow inbound connections from other VMs on your VPC into GHES (inbound calls will come from within your network)

**Your infra**

* must have the ability to deploy VMs in a VPC that has network connectivity to your GHES. Must enable outbound network connectivity to \*.[augmentcode.com](http://augmentcode.com/) (see [https://docs.augmentcode.com/setup-augment/network-configuration](https://docs.augmentcode.com/setup-augment/network-configuration))

## Step 1 - Configure GHES to notify a Cosmos Webhook

### Webhook receiver in Cosmos

Let’s create a new webhook in Cosmos (so Cosmos can listen to GHES events):

* As an admin go to Cosmos [cosmos.augmentcode.com](https://cosmos.augmentcode.com/) > Settings > Webhooks > Create a webhook > Click on GitHub:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-48.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=ed39d96c88ceb8e837107ca86a9dac64" alt="Image" width="1666" height="1048" data-path="images/image-48.png" />

* Enter Description: **GHES + \<url-to-your-GHES-instance>** > Click on Create

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-9.15.29-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=4e867338134fcb071bd50943c42a4c11" alt="Screenshot 2026 09 07 At 9 15 29 AM" width="1758" height="928" data-path="images/Screenshot-2026-09-07-at-9.15.29-AM.png" />

You'll obtain a Webhook URL and a Secret token. Copy them and click on Done:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-56.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=233b959d787846af14e4e98c9381f704" alt="Image" width="1564" height="1608" data-path="images/image-56.png" />

### Webhook sender in GHES

GHES enterprise owners can create a global webhook to subscribe to events that occur within their enterprise (recommended). Alternatively you can create a global webhook per organization in your enterprise.

Create a new webhook config in GHES (so GHES can POST to a given url when certain GHES events occur): as an Enterprise Owner, go to your GHES instance > click on your profile picture > click on Enterprise settings > Settings > Hooks > Add webhook > Add those details:

* Payload URL: the webhook url provided by Cosmos
* Content-Type: **application/json**
* Secret token: the secret provided by Cosmos
* Enable SSL verification: **keep it selected**
* Which events would you like to trigger this webhook?: select **Let me select individual events**
* Select those events:
  * **Check runs**
  * **Commit comments**
  * **Issue comment**
  * **Pull request review comments**
  * **Pull requests**
  * **Pull request reviews**
  * **Pushes**
  * **Statuses**
  * **Workflow runs**
* Active: **keep it selected**
* Click on Add webhook

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-55.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=4bd9ca04a8e644818bfa307e5bb15375" alt="Image" width="1119" height="664" data-path="images/image-55.png" />

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-58.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=738233493ff2299a04b4b16fc5143013" alt="Image" title="Image" className="mx-auto" style={{ width:"49%" }} width="380" height="119" data-path="images/image-58.png" />

You should see a banner confirming the hook has been created and a test payload has been sent:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-57.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=b66c9b60b8c294ead0363f964df41f44" alt="Image" width="1343" height="521" data-path="images/image-57.png" />

Now go back to Cosmos and check that Cosmos received the event: [cosmos.augmentcode.com](https://cosmos.augmentcode.com/) > Settings > Automations > Events Log. You should see your event with source “Webhook · Github”:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-12.30.01-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=f2a0ce8e75307f6c524e82503e16f42c" alt="Screenshot 2026 09 06 At 12 30 01 PM" width="1644" height="526" data-path="images/Screenshot-2026-09-06-at-12.30.01-PM.png" />

Click on the event to inspect the test payload:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-12.31.02-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=00bc30438bc695fd3b14fbd395f7ce01" alt="Screenshot 2026 09 06 At 12 31 02 PM" width="2236" height="1830" data-path="images/Screenshot-2026-09-06-at-12.31.02-PM.png" />

At this point GHES will automatically notify Cosmos whenever a PR is created/updated/commented on ✅

## Step 2 - Create a GHES Service Account

For headless automation and to start agentic workflows based on GHES events, you’ll create a dedicated GHES user acting as service account. Cosmos will use its access token to authenticate to GHES.

Here we'll assume you've configured SSO authentication for all your GHES users. Two steps to create your GHES dedicated service account user:

* first, you need to provision the new user **[cosmos@yourcompanydomain.com](mailto:cosmos@yourcompanydomain.com)** in your identity provider (Okta, EntraID)
* then in a separate browser, authenticate to GHES as **[cosmos@yourcompanydomain.com](mailto:cosmos@yourcompanydomain.com)**: you'll be redirected to SSO, and then back to GHES (your GHES account is automatically created when you sign in the first time)

Now, this service account needs to be granted access to the GHES repos in scope, either at the enterprise level, or at the organization level, or per repo. If per repo: ask a human repo owner to navigate to the repo > Settings tab > Collaborators > Add people > invite the service account. The repo owner should now see the service account as a collaborator:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/image-60.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=5c6f38cf32a289fdb6a480ed143d3b46" alt="Image" width="1736" height="1100" data-path="images/image-60.png" />

As you're signed-in using that GHES service account user, click on your avatar top right > Settings > Developer settings > Personal access tokens > Fine-grained tokens > Generate new token, with those details:

* Token name: **cosmos-token-01**
* Resource owner: keep the selection as the GHES dedicated service account user **[cosmos@yourcompanydomain.com](mailto:cosmos@yourcompanydomain.com)**
* Expiration: pick the furthest date possible
* Repository access: select the repos where **[cosmos@yourcompanydomain.com](mailto:cosmos@yourcompanydomain.com)** was added as collaborator earlier.
* Permissions:
  * **Content**: `Read and write`
  * **Issues**: `Read and write`
  * **Metadata**: `Read-only`
  * **Pull requests**: `Read and write`
* Click on Generate token

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-3.56.23-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=b013c3bb82e5e81d2fdbe839a6b88348" alt="Screenshot 2026 09 06 At 3 56 23 PM" width="2062" height="1714" data-path="images/Screenshot-2026-09-06-at-3.56.23-PM.png" />

You should see this popup:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-4.02.38-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=a174cdbc0ad65e1a6972cf6c66de5be0" alt="Screenshot 2026 09 06 At 4 02 38 PM" title="Screenshot 2026 09 06 At 4 02 38 PM" className="mx-auto" style={{ width:"66%" }} width="946" height="282" data-path="images/Screenshot-2026-09-06-at-4.02.38-PM.png" />

Click on Generate token, you'll see your PAT token value. Copy it you'll need it later:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-4.03.05-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=00c5b3545995bb844b76df7d024082e1" alt="Screenshot 2026 09 06 At 4 03 05 PM" width="1170" height="404" data-path="images/Screenshot-2026-09-06-at-4.03.05-PM.png" />

## Step 3 - Create a Augment service account

Before we start the websocket tunnel from your VM to Cosmos, you’ll need to create a dedicated Augment service account, which will be used to authenticate and start the tunnel.

As an admin go to [https://app.augmentcode.com](https://app.augmentcode.com) > Global Settings > Service accounts > Add Service Account > Enter:

* Account Name: **Daemon-on-VM-to-access-GHES**
* Description: **Authenticate daemon pool from the VM that accesses GHES**

Click on Add:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.46.57-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=ef5f9fba5e884faaa8876105274593ed" alt="Screenshot 2026 09 06 At 7 46 57 PM" title="Screenshot 2026 09 06 At 7 46 57 PM" className="mx-auto" style={{ width:"62%" }} width="676" height="372" data-path="images/Screenshot-2026-09-06-at-7.46.57-PM.png" />

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.48.49-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=86949994fb08b19329c48c0137331ec6" alt="Screenshot 2026 09 06 At 7 48 49 PM" title="Screenshot 2026 09 06 At 7 48 49 PM" className="mx-auto" style={{ width:"62%" }} width="662" height="276" data-path="images/Screenshot-2026-09-06-at-7.48.49-PM.png" />

Click on Add API Token > token name: **token01** > Click on Add:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.52.39-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=f736dab9163fe0eb797c40178bf92b6d" alt="Screenshot 2026 09 06 At 7 52 39 PM" title="Screenshot 2026 09 06 At 7 52 39 PM" className="mx-auto" style={{ width:"53%" }} width="672" height="262" data-path="images/Screenshot-2026-09-06-at-7.52.39-PM.png" />

Click on Download JSON:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.50.28-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=c424c89749d9f54e74d60218a9aaf753" alt="Screenshot 2026 09 06 At 7 50 28 PM" title="Screenshot 2026 09 06 At 7 50 28 PM" className="mx-auto" style={{ width:"52%" }} width="660" height="636" data-path="images/Screenshot-2026-09-06-at-7.50.28-PM.png" />

You'll obtain a session.json, it will be used to authenticate the Cosmos daemon pool later on.

## Step 4 - Create a Cosmos daemon pool

Since you’ll be leveraging a VM to host your daemon, it’s important to think about uptime and resilience: your VM could loose network connectivity or have an outage. The best practice is to create a daemon pool and attach your daemons to that daemon pool. Then you can later have N daemons (1 per VM) all tied to the same daemon pool, and Cosmos will use that pool which will automatically route to the next available daemon. In this guide you’ll create 1 daemon pool and 1 daemon running in 1 VM, but you can extend that approach to spin up 2 more VMs (and their respective daemons) for max resilience. More VMs and daemons also mean scaling horizontally the number of Cosmos sessions running at a given time.

Go to [cosmos.augmentcode.com](https://cosmos.augmentcode.com/) > Settings > Environments > Create an environment > Daemon Pool:

<img src="https://mintcdn.com/augment-mtje7p526w/8BrHp0zhabcfYque/images/cosmos-integrations/gitlab-self-hosted/gitlab-self-hosted-19.png?fit=max&auto=format&n=8BrHp0zhabcfYque&q=85&s=c12edc37c50a7bb4b217c083a3121874" alt="" width="1502" height="312" data-path="images/cosmos-integrations/gitlab-self-hosted/gitlab-self-hosted-19.png" />

Configure the pool with:

* Name: **Team01-Pool-GHES**
* Daemon connector: select the dedicated service account you created in the section earlier (**Daemon-on-VM-to-access-GHES)**
* Shared: **toggle on**
* Workspace behavior: `Isolated workspace`

Then click on Create Pool:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.57.22-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=7c99a5803a762cb38b55750b3323ac98" alt="Screenshot 2026 09 06 At 7 57 22 PM" width="1566" height="1776" data-path="images/Screenshot-2026-09-06-at-7.57.22-PM.png" />

You’ll get the confirmation that the pool has been created, note the pool-id:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.58.17-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=db4769310568ae4417d01a4e41536dbd" alt="Screenshot 2026 09 06 At 7 58 17 PM" title="Screenshot 2026 09 06 At 7 58 17 PM" className="mx-auto" style={{ width:"61%" }} width="786" height="330" data-path="images/Screenshot-2026-09-06-at-7.58.17-PM.png" />

Go back to your list of environments, you should see your pool (with no daemon online yet):

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-06-at-7.59.48-PM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=a769d3bbaa17192439ece275d4157c45" alt="Screenshot 2026 09 06 At 7 59 48 PM" width="1550" height="618" data-path="images/Screenshot-2026-09-06-at-7.59.48-PM.png" />

## Step 5 - Configure your VM with local GHES repos, gh cli and Cosmos daemon

In this section you’ll configure a VM with the following:

* locally cloned GHES repos
* `gh` cli so Cosmos local agents can communicate to GHES
* a Cosmos pool + daemon (to establish an outbound websocket tunnel from the VM to Cosmos)

### Create the VM, with git and NVM/node

Create a new Linux VM (ex: Ubuntu x86\_64) in a VPC that will be able to reach your GHES instance.

Minimum config recommended: **4 vCPU, 16 GB RAM, 100 GB SSD.**

Then SSH onto the VM.

Install git:

```shellscript theme={null}
sudo apt update && sudo apt install git -y
```

Verify the installation

```bash theme={null}
which git
git --version
```

You should get:

```text theme={null}
nico@gcp-vm-behind-firewall:~$ which git
/usr/bin/git
nico@gcp-vm-behind-firewall:~$ git --version
git version 2.34.1
```

Install NVM

```shellscript wrap theme={null}
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
```

Refresh the terminal profile

```shellscript theme={null}
source ~/.bashrc
```

Install the latest Long-Term Support (LTS) version of Node & NPM

```shellscript theme={null}
nvm install --lts
```

Verify the node install

```bash theme={null}
node -v
npm -v
```

You should get:

```text theme={null}
nico@gcp-vm-behind-firewall:~$ node -v
v24.20.0
nico@gcp-vm-behind-firewall:~$ npm -v
11.19.0
```

### Git clone your GHES repos locally

Create a local \~/workspace/ folder

In that workspace folder create folders for your GHES organizations

In the corresponding organization folders, git clone your repos (you need at a minimum an empty git repo with at least one commit for the git worktree configuration to be valid and for the agent to start)

You should have a “2 layers” folder structure like this:

* \~/workspace/\<GHES-ORG-NAME-A>/\<REPO-NAME-A>/.git
* \~/workspace/\<GHES-ORG-NAME-A>/\<REPO-NAME-B>/.git
* \~/workspace/\<GHES-ORG-NAME-B>/\<REPO-NAME-C>/.git
* \~/workspace/\<GHES-ORG-NAME-B>/\<REPO-NAME-D>/.git

<Note>
  Note: at this moment you have to own making sure that the git repos are locally cloned and are kept up to date regularly. In a future release, daemons will be able to handle that on your behalf - stay tuned
</Note>

### Install and authenticate the gh CLI

Install the `gh` cli: make sure you’re in your root folder, install the `gh` cli using this command (source [https://cli.github.com/](https://cli.github.com/)):

```shell wrap theme={null}
(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
	&& sudo mkdir -p -m 755 /etc/apt/keyrings \
	&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
	&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
	&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
	&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
	&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
	&& sudo apt update \
	&& sudo apt install gh -y
```

Verify the version, run:

```shellscript theme={null}
gh --version
```

You should get:

```text theme={null}
nico@gcp-vm-behind-firewall:~$ gh --version
gh version 2.100.0 (2026-09-03)
https://github.com/cli/cli/releases/tag/v2.100.0
```

Then authenticate the `gh` cli against your GHES instance, run:

```shellscript wrap theme={null}
echo "<YOUR_GHES_PAT_TOKEN>" | gh auth login --hostname <YOUR_GHES_HOSTNAME_WITHOUT_HTTPS> --with-token
```

Then verify `gh` is properly authenticated, run:

```shellscript theme={null}
gh auth status
```

You should see:

```plain text theme={null}
nico@gcp-vm-behind-firewall:~$ gh auth status
ghes.internal
  ✓ Logged in to ghes.internal account nico (/home/nico/.config/gh/hosts.yml)
  - Active account: true
  - Git operations protocol: https
  - Token: github_pat_********************************************************
```

### Start the daemon

cd into \~/workspace/

Run

```shell theme={null}
nano ~/.augment/session.json
```

Paste in there the content of session.json you retrieved earlier when creating the Augment service account. Then CTRL-O + RETURN to save the file and CTRL-X + RETURN to exit

Install Auggie

```bash theme={null}
npm install -g @augmentcode/auggie
```

Start the Cosmos daemon using the Augment service account and attach the daemon to the pool, run:

```shell wrap theme={null}
auggie daemon --pool-id <YOUR-POOL-ID> --discover-workspaces=2 --allow-indexing
```

That will start the daemon, you should see this:

```text theme={null}
nico@gcp-vm-behind-firewall:~/workspace$ auggie daemon --pool-id pool-352df5e6-8b03-4c55-b622-32ce65e21bf8 --discover-workspaces=2 --allow-indexing
2026-09-07 14:12:41.582 [info] 'daemon':    Git version: 2.34.1 (daemon minimum: 2.31.0)
2026-09-07 14:12:41.595 [info] 'git-worktree-support': Git worktree support unavailable; treating workspace as UNSUPPORTED
2026-09-07 14:12:41.614 [info] 'git-worktree-support': Git worktree support unavailable; treating workspace as UNSUPPORTED
2026-09-07 14:12:41.625 [info] 'daemon': Launch dir is a non-git container; adopting 1 discovered git repo(s) as workspaces:
2026-09-07 14:12:41.626 [info] 'daemon':    Discovered workspace: /home/nico/workspace/nico/ecomm-stack (git)
2026-09-07 14:12:41.626 [info] 'daemon':    Git worktree support: supported
2026-09-07 14:12:41.634 [info] 'DaemonState': Loaded existing daemon state with VM ID: 7f6ae36c-f3a6-4e06-93ea-946d3a43a70b
2026-09-07 14:12:41.635 [info] 'daemon': Loaded VM ID from state: 7f6ae36c-f3a6-4e06-93ea-946d3a43a70b
2026-09-07 14:12:41.635 [info] 'daemon': Joining daemon pool: pool-352df5e6-8b03-4c55-b622-32ce65e21bf8
2026-09-07 14:12:41.645 [info] 'daemon': Daemon auto-update is DISABLED because it is gated by the cli_daemon_auto_update_enabled feature flag, which is off for this account
2026-09-07 14:12:41.646 [info] 'daemon': Configured 1 additional workspace(s):
2026-09-07 14:12:41.646 [info] 'daemon':    Additional workspace: /home/nico/workspace/nico/ecomm-stack (git)
2026-09-07 14:12:41.649 [info] 'daemon': Indexing enabled for workspace: /home/nico/workspace
2026-09-07 14:12:41.649 [info] 'daemon': Indexing enabled for workspace: /home/nico/workspace/nico/ecomm-stack
2026-09-07 14:12:41.650 [info] 'daemon': Starting Auggie Daemon...
2026-09-07 14:12:41.650 [info] 'daemon':    VM ID: 7f6ae36c-f3a6-4e06-93ea-946d3a43a70b
2026-09-07 14:12:41.650 [info] 'daemon':    Name: gcp-vm-behind-firewall:workspace
2026-09-07 14:12:41.650 [info] 'daemon':    Workspace: /home/nico/workspace
2026-09-07 14:12:41.650 [info] 'daemon':    Max Agents: 100
2026-09-07 14:12:41.650 [info] 'daemon':    Additional Workspaces: 1
2026-09-07 14:12:41.650 [info] 'daemon':      - /home/nico/workspace/nico/ecomm-stack
2026-09-07 14:12:41.652 [info] 'daemon': Connecting to Cosmos...
2026-09-07 14:12:41.652 [info] 'daemon':    URL: wss://e2.api.augmentcode.com/cloudagents/vm/ws?vm_id=7f6ae36c-f3a6-4e06-93ea-946d3a43a70b&last_seq_id=0&connection_type=AUGGIE_DAEMON&daemon_name=gcp-vm-behind-firewall%3Aworkspace&max_agents=100&workspace_path=%2Fhome%2Fnico%2Fworkspace&additional_workspace_path=%2Fhome%2Fnico%2Fworkspace%2Fnico%2Fecomm-stack&git_worktree_support=1&git_credential_mode=1&pool_id=pool-352df5e6-8b03-4c55-b622-32ce65e21bf8&cli_version=0.36.0&supports_diff=1&client_capabilities=worktree_cleanup&client_capabilities=git-user-oauth-v1&client_capabilities=git-github-app-v1&client_capabilities=pty&command_capability=EXECUTE_DAEMON_DIFF_OP&command_capability=EXECUTE_DAEMON_FS_OP
2026-09-07 14:12:41.696 [info] 'daemon': WebSocket connected
2026-09-07 14:12:41.779 [info] 'daemon': Daemon registered with Cosmos (multi-workspace: 2 repos)
2026-09-07 14:12:41.779 [info] 'daemon': Heartbeat enabled (5000ms interval)
2026-09-07 14:12:41.780 [info] 'daemon': Received command: CONNECTED (seq: 0)
2026-09-07 14:12:41.781 [info] 'daemon': --> Processing command: CONNECTED
```

Note in your daemon logs:

* “Launch dir is a non-git container; adopting N discovered git repo(s) as workspaces \[…]” ⇒ check that all your local git repos have been discovered under /workspace/
* “Git worktree support: supported”
* “Joining daemon pool: \<YOUR-POOL-ID>”
* “Indexing enabled for workspace: \[…]”
* “Starting Auggie Daemon \[…]”
* “Connecting to Cosmos...”

You can now see the daemon running from Cosmos: [cosmos.augmentcode.com](https://cosmos.augmentcode.com/) > Settings > Environments:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.18.46-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=74c0a1c23db94592e20c629d73a2a841" alt="Screenshot 2026 09 07 At 7 18 46 AM" width="1908" height="540" data-path="images/Screenshot-2026-09-07-at-7.18.46-AM.png" />

Click on the pool. Note that 1 daemon is online, and you can see the VM IP/name under Connected daemons. Top right you can set this pool as default environment to run your agents:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.19.04-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=dba5630b19f32ffe6a63e60ffd102367" alt="Screenshot 2026 09 07 At 7 19 04 AM" width="1892" height="1252" data-path="images/Screenshot-2026-09-07-at-7.19.04-AM.png" />

## Step 6 - Connectivity test

Now you’ll create a session in Cosmos (cloud) and verify it can connect to the VM (internal network), make sense of the local repos and from that VM reach out to GHES via the `gh` CLI.

Go to Cosmos [cosmos.augmentcode.com](https://cosmos.augmentcode.com) > New Session.

Under the prompt, click on the dropdown list with the cloud icon > select Daemon > select your daemon pool:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.24.37-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=2522a8333605dd6d6ddd78443758cd4f" alt="Screenshot 2026 09 07 At 7 24 37 AM" width="1230" height="540" data-path="images/Screenshot-2026-09-07-at-7.24.37-AM.png" />

Hover over Integrations and make sure "Github App" isn't selected (that's only for github.com):

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.25.32-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=8c752063fd7e90af9833d621bde1e0b8" alt="Screenshot 2026 09 07 At 7 25 32 AM" width="1240" height="764" data-path="images/Screenshot-2026-09-07-at-7.25.32-AM.png" />

Prompt the session with **What are those repos about?**, you should see a response powered by the Augment Context Engine that already made sense of your repos:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.27.14-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=a5de507f62d4b04b01cb44792bd966df" alt="Screenshot 2026 09 07 At 7 27 14 AM" width="1798" height="2232" data-path="images/Screenshot-2026-09-07-at-7.27.14-AM.png" />

The connectivity between Cosmos (cloud) and your remote VM has been verified ✅

Now prompt the session with:

```text theme={null}
Use the gh cli to look up <INSERT-LINK-TO-ONE-OF-YOUR-GHES-PR>
```

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.29.27-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=1e1297091d9e2c2e97a83a4b35d360db" alt="Screenshot 2026 09 07 At 7 29 27 AM" width="1756" height="1060" data-path="images/Screenshot-2026-09-07-at-7.29.27-AM.png" />

Observe that the Cosmos session was able to use the `gh` cli to lookup the PR.

## Step 7 - Create your Cosmos Experts

Now that connectivity is established, you can focus on creating your Cosmos experts.

You're now ready to deploy the yellow code producing loop of the v1.0 software factory there [https://docs.nicopowered.com/cosmos-core-loops-software-factory](https://docs.nicopowered.com/cosmos-core-loops-software-factory)

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-7.43.58-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=0c1fc77a14697007e1483e8266c9bcd4" alt="Screenshot 2026 09 07 At 7 43 58 AM" width="3216" height="1742" data-path="images/Screenshot-2026-09-07-at-7.43.58-AM.png" />

Go to Cosmos [cosmos.augmentcode.com](https://cosmos.augmentcode.com) > New Session > Select Cosmos Advisor > Make sure your GHES daemon pool is selected as environment, then edit and prompt with:

```text wrap theme={null}
Create a PR Author, a PR Risk Analyzer, a Deep Code Reviewer, a PR Fixer, a Pair Reviewer. You must use the gh cli (do not use the github app anywhere. I already configured the webhook that listens to GHES events <YOUR-COSMOS-GHES-WEBHOOK-URL>. My GHES repos are cloned on the VM available via the attached daemon pool. You must use the attached daemon pool for all the experts you're about to deploy. Make sure the experts are shared with <YOUR-EMAIL> as owner, and can-view with the rest of the organization.
```

You should see this before submitting:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-9.30.14-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=fb44c9ff00db93723a291bcd8c61d993" alt="Screenshot 2026 09 07 At 9 30 14 AM" width="1270" height="1214" data-path="images/Screenshot-2026-09-07-at-9.30.14-AM.png" />

<Tip>
  In the prompt you explicitly asked "Make sure the experts are shared with \<YOUR-EMAIL> as owner" as by default the owner would be the Augment service account you authenticated the daemon pool with
</Tip>

You should see this after submitting:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-8.39.54-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=754787e6fabdaf5f7d215b47d96563c9" alt="Screenshot 2026 09 07 At 8 39 54 AM" width="1798" height="2428" data-path="images/Screenshot-2026-09-07-at-8.39.54-AM.png" />

<Tip>
  Advisor will also recommend experts you should consider, as it did above for the Code Review Memory Manager. In a separate session you could also ask Advisor "what are all the experts you could help me deploy for my software factory"
</Tip>

Your experts are now deployed, you can see them under [cosmos.augmentcode.com](https://cosmos.augmentcode.com) > Settings > Experts > All tab:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-8.13.43-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=ba9da2e3776956a18b8c095381697fd5" alt="Screenshot 2026 09 07 At 8 13 43 AM" width="1772" height="912" data-path="images/Screenshot-2026-09-07-at-8.13.43-AM.png" />

When you click on an expert > Share expert you can see Advisor applied the permissions you requested:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-8.48.41-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=124f3feb1a0c4adc5b806252a39b8abb" alt="Screenshot 2026 09 07 At 8 48 41 AM" title="Screenshot 2026 09 07 At 8 48 41 AM" className="mx-auto" style={{ width:"53%" }} width="802" height="652" data-path="images/Screenshot-2026-09-07-at-8.48.41-AM.png" />

The experts are 'stitched' together under [cosmos.augmentcode.com](https://cosmos.augmentcode.com) > Settings > Automations > All tab. You can expand the first Deep Code Reviewer (GHES) automation and observe the high level events this expert will react to:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-8.50.18-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=22a06b07d29a62c56613a7e4937dc7cf" alt="Screenshot 2026 09 07 At 8 50 18 AM" width="1782" height="1068" data-path="images/Screenshot-2026-09-07-at-8.50.18-AM.png" />

<Tip>
  You can instruct Advisor to update your experts and use other native integrations (ex: Jira/Atlassian) as often you'll want to author PRs based on a ticket
</Tip>

## Step 8 - Test your PR author

Create a sample PR to test your PR author. Go to [cosmos.augmentcode.com](https://cosmos.augmentcode.com) > New session > Select PR Author (GHES) and prompt with:

```text theme={null}
create a hello world banner on the top of the main UI
```

or, if you already deployed your experts with the native Jira integration:

```text theme={null}
implement this Jira ticket <URL-OF-THE-JIRA-TICKET-ALREADY-SPECED-OUT>
```

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-8.59.32-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=5bd5c92c68d0391cf1488b9c1f7127d7" alt="Screenshot 2026 09 07 At 8 59 32 AM" width="1262" height="1230" data-path="images/Screenshot-2026-09-07-at-8.59.32-AM.png" />

You should see this:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-9.05.27-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=cd5c76fd518020fa265d190f4521caa7" alt="Screenshot 2026 09 07 At 9 05 27 AM" width="1784" height="1116" data-path="images/Screenshot-2026-09-07-at-9.05.27-AM.png" />

The PR Author created the PR, and downstream the PR Risk Analyzer, Deep Code Reviewer, PR Fixer and Pair Reviewer will trigger automatically. The PR Author is a powerful orchestrator that will handle all that for you, and keep tabs on the comments, CI statuses etc. Click on the PR link that the PR Author created, and you'll see all the code producing experts at play to get the PR ready for a final review:

<img src="https://mintcdn.com/augment-mtje7p526w/RZVrMVl0y_uogG6Y/images/Screenshot-2026-09-07-at-9.13.48-AM.png?fit=max&auto=format&n=RZVrMVl0y_uogG6Y&q=85&s=a70b60b3863c996101e6d7589de9a890" alt="Screenshot 2026 09 07 At 9 13 48 AM" width="1442" height="2236" data-path="images/Screenshot-2026-09-07-at-9.13.48-AM.png" />

<Tip>
  When you start the PR author manually/interactively as you did earlier, it may author the PR in draft. Switch it to ready for review to observe the experts at play. Your PR author can also be invoked via automation and other expert like Project Builder
</Tip>

Congratulations, you’ve deployed your first experts and v1 software factory code producing loop with GHES! 🎉
