# Products and repos

Connect GitHub through the EasyCode GitHub App, add repos, and group them into products your teamspaces can reach.

A _product_ is what a team ships, such as _Northwind Storefront_. It is built from one or more repos, and people
reach it through grants. Repos come into EasyCode through the EasyCode GitHub App.

## Connect GitHub

The GitHub App lets EasyCode list your repos. It never gives EasyCode your own GitHub login: your sessions still
push and open pull requests with your own `git` and `gh`.

As an owner or admin, open **Settings → Repos**. It says **GitHub isn't connected**.

Click **Install on GitHub**. On GitHub, pick your GitHub organization or account, and choose **All repositories**
or **Selected repositories**.

GitHub sends you back. The page now says **Connected to GitHub**, with the account, the repository access and the
date.

To give the App more or fewer repos later, click **Update on GitHub**, or **Manage on GitHub** to open the
installation's own settings. If GitHub suspends the installation, the page shows **Suspended** and repos stop
updating until you unsuspend it on GitHub.

> **Not an admin?**
>
> A member who opens **Repos** before GitHub is connected sees **Ask to connect GitHub**. GitHub sends the request to
> your GitHub org's owners, and your EasyCode admins hear about it.

One GitHub account connects to one EasyCode org. If you see _This GitHub account is already connected to another
EasyCode org_, disconnect it there first, or install the App on a different account.

## Add repos

Repos the App can see appear on the **Repos** page. To add more, click **Add repos from GitHub** (admins only) and
pick them on GitHub. A repo GitHub archived stays listed, and its knowledge is no longer refreshed.

### Register your repos

If your org has the Knowledge module, the setup checklist step is **Register your repos** instead of
**Create products**. It lets EasyCode propose your products for you.

On **Register your repos**, tick the repos EasyCode should learn. Repos that aren't archived and were pushed in the
last 12 months are ticked by default. Click **Save and scan**.

The desktop app scans the repos on a computer that can clone them. Code never leaves that computer. Follow it with
**See scan progress**. A repo that waits for a reader needs someone who can read it on GitHub to link their GitHub
account on their profile.

On **Review the proposed products**, fix what needs a look, then accept the clean repos. You can accept what is
scanned while the rest scans.

Repos the App sees after you register arrive unpicked, under **New since you registered**. Use **Change picks** to
add them.

## Create a product by hand

Open **Settings → Products** and click **New product**.

Enter a **Name** and, optionally, a **Slug**. Pick the **Owner team**: **Everyone**, so the whole team works on it as
contributors, or a teamspace, which gets a locked owner grant.

Set the **Base access**: what every full member of the org can do here. Pick **No base access** to keep it to the
people you grant.

Click **Create product**. In the product's settings, under **Repos**, click **Link repo**. Pick the repo, its **Role** (**Primary** is where
the product lives, **Shared** is used by several products) and, optionally, up to 20 **Paths** inside it, such as
`packages/ui`.

A repo can be in many products. A product whose repo has no paths covers the whole repo.

## Give people access

In the product's settings, under **Access**, click **Add grant** and pick a teamspace or a person and a role:

| Role            | What it allows                                                 |
| --------------- | -------------------------------------------------------------- |
| **Maintainer**  | Manage the product's grants, repos and details, and work on it |
| **Contributor** | Work on it                                                     |
| **Viewer**      | See it                                                         |

Admins and maintainers manage grants. Only admins change the base access and the slug, or use **Archive product**.
An archived product leaves the lists for everyone but admins.

## Next

- [Set up knowledge for a repo](/guides/set-up-knowledge), so agents know the code before they start.
- [Org, members and teamspaces](/setup/org-members-teamspaces), to create the teamspaces you grant.
