# How to Install the gpt-image-2-style-library Skill from GitHub Packages

> Install the gpt-image-2-style-library skill from GitHub Packages. Authenticate npm with a personal access token, install the scoped package, and run the install all command to deploy assets.

- Repository: [苍何/awesome-gpt-image-2](https://github.com/freestylefly/awesome-gpt-image-2)
- Tags: how-to-guide
- Published: 2026-09-06

---

**To install the gpt-image-2-style-library skill from GitHub Packages, authenticate npm with a GitHub personal access token, install the scoped npm package globally, then run the skill's `install all` command to deploy assets to your local agent directories.**

The **gpt-image-2-style-library** skill provides a reusable style library for GPT-Image2 agents, drawing from a curated collection of visual styles stored in [[`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json). As implemented in [freestylefly/awesome-gpt-image-2](https://github.com/freestylefly/awesome-gpt-image-2), this skill is published to GitHub Packages as `@freestylefly/gpt-image-2-style-library` and can be installed using standard npm workflows for scoped packages.

## Prerequisites: GitHub Personal Access Token

Before installing from GitHub Packages, you need a **personal access token (PAT)** with the `read:packages` scope. This token authenticates npm to fetch private or scoped packages from the GitHub registry.

- Generate a classic token at **Settings > Developer settings > Personal access tokens > Tokens (classic)**
- Select only the `read:packages` scope for minimal permissions

## Installation Steps

### Step 1: Authenticate to GitHub Packages

Run the following command to configure npm authentication for the `@freestylefly` scope:

```bash
npm login --scope=@freestylefly --registry=https://npm.pkg.github.com

```

When prompted:
- **Username:** Your GitHub username
- **Password:** Your personal access token (not your GitHub password)

This creates or updates `~/.npmrc` with your authentication credentials for subsequent installs.

### Step 2: Install the Skill Globally

Install the CLI binary from GitHub Packages and add it to your system `$PATH`:

```bash
npm install -g @freestylefly/gpt-image-2-style-library --registry=https://npm.pkg.github.com

```

The `--registry` flag ensures npm pulls from GitHub Packages rather than the default npm registry.

### Step 3: Deploy to Local Agent Directories

The skill includes a CLI command that syncs assets to standard agent skill locations. Run:

```bash
gpt-image-2-style-library install all

```

This command copies the skill's files to:
- `~/.codex/skills`
- `~/.claude/skills`
- `~/.agents/skills`

**Restart any running agent sessions** after this step to load the newly installed skill.

## What Gets Installed

The npm package contains three critical components that the `install all` command distributes:

| Component | Source Location | Purpose |
|-----------|---------------|---------|
| **Skill definition** | [[`agents/skills/gpt-image-2-style-library/SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/agents/skills/gpt-image-2-style-library/SKILL.md)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/agents/skills/gpt-image-2-style-library/SKILL.md) | Human-readable description and usage examples for agents |
| **Package metadata** | [[`agents/skills/gpt-image-2-style-library/package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/agents/skills/gpt-image-2-style-library/package.json)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/agents/skills/gpt-image-2-style-library/package.json) | npm configuration defining the scoped package name and scripts |
| **Style data** | [[`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) | Central JSON catalog of all style definitions |

## Using the Skill After Installation

Once deployed, invoke the skill in any supported agent (Claude Code, Codex, or compatible agents) with natural language:

```text
Use gpt-image-2-style-library to create an infographic prompt about Codex.

```

The skill references [[`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) to return a formatted prompt suitable for GPT-Image2's image generation API.

## Complete Installation Example

```bash

# 1️⃣ Authenticate with GitHub Packages

npm login --scope=@freestylefly --registry=https://npm.pkg.github.com

# 2️⃣ Install the CLI globally from GitHub Packages

npm install -g @freestylefly/gpt-image-2-style-library --registry=https://npm.pkg.github.com

# 3️⃣ Deploy skill assets to agent directories

gpt-image-2-style-library install all

# 4️⃣ Restart your agent session

```

## Troubleshooting Common Issues

**Authentication failures** – Verify your PAT has `read:packages` scope and hasn't expired. Re-run `npm login` if you receive 401 or 403 errors.

**Command not found after global install** – Check that your npm global `bin` directory is in your `$PATH`. Run `npm bin -g` to locate it.

**Skill not recognized by agent** – Confirm the `install all` command completed successfully and restart the agent. Check `~/.codex/skills` or equivalent for the `gpt-image-2-style-library` folder.

## Summary

- The **gpt-image-2-style-library** skill is published to GitHub Packages as `@freestylefly/gpt-image-2-style-library`
- **Authentication required:** Use `npm login` with a `read:packages` scoped PAT before installing
- **Three-step workflow:** Authenticate → `npm install -g` → `gpt-image-2-style-library install all`
- The `install all` command deploys to `~/.codex/skills`, `~/.claude/skills`, and `~/.agents/skills`
- The skill reads from [[`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json) to generate image prompts

## Frequently Asked Questions

### What is the gpt-image-2-style-library skill used for?

The skill provides GPT-Image2 agents with a curated collection of visual styles stored in [[`data/style-library.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json)](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/data/style-library.json). Agents invoke it to generate properly formatted prompts for image generation tasks, ensuring consistent style application across workflows.

### Why do I need a personal access token for GitHub Packages?

GitHub Packages requires authentication for scoped packages like `@freestylefly/gpt-image-2-style-library`. The token with `read:packages` scope proves your identity and authorization to download the package. Without it, npm returns 401 Unauthorized errors.

### Where does the `install all` command put the skill files?

The command copies the skill's assets to three standard directories: `~/.codex/skills`, `~/.claude/skills`, and `~/.agents/skills`. This multi-location deployment ensures compatibility across different agent implementations that may check different paths.

### Can I install the skill without global npm installation?

No—the skill is designed as a CLI tool distributed via npm. Global installation (`-g`) places the `gpt-image-2-style-library` binary on your `$PATH`, which is required for the `install all` deployment step. Local installation would not expose the CLI command.