# GitHub

## Access

Prefer an available, authorized GitHub connector or MCP server. Otherwise use the `gh` CLI after confirming `gh auth status`. Pass `--repo OWNER/REPO` on every command rather than relying on the current directory.

## Destination and visibility

```bash
gh repo view OWNER/REPO --json nameWithOwner,visibility
```

Issues in a public repository are public. Recheck outgoing content with that in mind.

## Duplicates and labels

```bash
gh issue list --repo OWNER/REPO --state all --search "<keywords>" --limit 50
gh label list --repo OWNER/REPO --limit 200
gh label create "<name>" --repo OWNER/REPO --description "<description>" --color "<hex without #>"
```

## Create and read back

Write each reviewed body to a securely created temporary file so arbitrary Markdown is never interpolated into a shell command:

```bash
gh issue create --repo OWNER/REPO --title "Title" --body-file <reviewed-body-file> --label "bug" --label "security"
gh issue view <number> --repo OWNER/REPO --json number,title,body,labels,url
```

## Dependencies

Record each dependency as a `Blocked by: #<number>` line in the body's Dependencies section; it is visible everywhere and survives any tooling. If the connector supports GitHub's native issue dependencies or sub-issues, you may set those too.

## Images

`gh` cannot attach a local image to an issue. Describe what the screenshot shows, or reference an image already committed to the repository, unless the user approves another supported upload path.
