Skip to content

Commit ae70246

Browse files
committed
Clarify Copilot CLI installation and setup instructions: Update the 'How To Use' guide to specify that the CLI can be installed from any directory, and emphasize the requirement of running commands from within the repository. Include detailed steps for creating a .env file with the PERSONAL_ACCESS_TOKEN for successful setup.
1 parent 8fbe06f commit ae70246

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

docs/how-to-use.mdx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Quick setup with copilot setup, then customize labels, templates, a
55

66
## Quick installation (CLI)
77

8-
To install the Copilot CLI globally from source:
8+
You can install the Copilot CLI **from any directory**. For example, from your home or projects folder:
99

1010
```bash
1111
git clone https://github.com/vypdev/copilot.git
@@ -15,7 +15,7 @@ npm install . -g
1515

1616
If the repo does not include the compiled `build/` folder (e.g. it is gitignored), run `npm install` and `npm run build` before `npm install . -g`.
1717

18-
You can then run `copilot setup`, `copilot check-progress -i 123`, and other [CLI commands](/single-actions/workflow-and-cli) from any directory.
18+
Once installed, the `copilot` command is available globally. **All Copilot CLI commands** (including `copilot setup`, `copilot check-progress -i 123`, etc.) must be run **from inside the repository** where you want Copilot to run. That repository must have a **`.env`** file in its root with **`PERSONAL_ACCESS_TOKEN`** set so the CLI can access the repo. See [CLI commands](/single-actions/workflow-and-cli).
1919

2020
---
2121

@@ -27,19 +27,29 @@ You can then run `copilot setup`, `copilot check-progress -i 123`, and other [CL
2727
Follow the [Authentication](/authentication) guide to create a **fine-grained PAT** with the right permissions (Actions, Administration, Contents, Issues, Metadata, Pull requests, etc.) and store it as a secret (e.g. `PAT`) in your repository or organization.
2828
</Step>
2929

30-
<Step title="2. Clone your repo and run copilot setup">
31-
From your **repository root** (the repo where you want Copilot to run):
30+
<Step title="2. Run copilot setup in your repository root">
31+
Go to the **root of the repository** where you want Copilot (clone it if needed), then run:
3232

3333
```bash
34-
git clone https://github.com/YOUR_ORG/YOUR_REPO.git
35-
cd YOUR_REPO
34+
cd /path/to/your/repo
3635
copilot setup
3736
```
3837

38+
**About the token the first time:**
39+
The first time you run `copilot setup`, there will usually be **no `.env` file** in that repo with the PAT. The command will copy setup files (workflows, templates, etc.) but may fail or skip the step that needs GitHub access (labels, issue types). In that case:
40+
41+
- Create a **`.env`** file in the **repository root** with your token:
42+
```bash
43+
PERSONAL_ACCESS_TOKEN=your_fine_grained_token_here
44+
```
45+
- Run **`copilot setup` again**. This time it will have access to the repository and will create labels and issue types.
46+
47+
Alternatively, you can create the `.env` file with `PERSONAL_ACCESS_TOKEN` and its value **before** the first run and execute `copilot setup` once; it will then complete all steps (copy files + create labels and issue types) in a single pass.
48+
3949
`copilot setup` will:
4050
- Create `.github/`, `.github/workflows/`, and `.github/ISSUE_TEMPLATE/` if they do not exist.
4151
- Copy all files from the Copilot `setup/` folder into your repo (workflows, issue templates, pull request template). Existing files are **not** overwritten.
42-
- Verify GitHub access with your token (you will be prompted or use `PAT` from env).
52+
- Verify GitHub access using `PERSONAL_ACCESS_TOKEN` from `.env` (or the token you pass when prompted).
4353
- Create all required **labels** in the repository (type, action, priority, size, progress 0%–100%).
4454
- Create all required **issue types** in the organization (Task, Bug, Feature, Release, Hotfix, etc.), if your plan supports it.
4555

0 commit comments

Comments
 (0)