# How to Install the gpt-image-2-style-library Skill via npm

> Easily install the gpt-image-2-style-library skill using npm. Follow our quick guide to add this powerful tool to Codex, Claude Code, or your shared agents.

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

---

**Install the gpt-image-2-style-library skill globally with `npm install -g gpt-image-2-style-library`, then run `gpt-image-2-style-library install <target>` to copy the skill into Codex, Claude Code, or your shared agents folder.**

The **gpt-image-2-style-library** is distributed as a standard npm package that bundles a command-line installer. According to the [freestylefly/awesome-gpt-image-2](https://github.com/freestylefly/awesome-gpt-image-2) source code, the package exposes a binary entry point—defined in [`package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/package.json) as `"bin": { "gpt-image-2-style-library": "bin/install.mjs" }`—that handles copying skill files into your chosen agent directories. This guide covers every step to install and deploy the skill using npm.

---

## Global Installation: System-Wide Access

The recommended approach for most users is a global install. This places the `gpt-image-2-style-library` command on your system `$PATH`, making it available from any directory.

```bash
npm install -g gpt-image-2-style-library

```

Once installed, verify the binary is accessible:

```bash
gpt-image-2-style-library --help

```

The global installation is ideal when you want the skill available across multiple projects without per-directory setup.

---

## Local Installation: Project-Scoped Usage

For teams using the skill within a specific codebase, install locally to keep dependencies version-controlled:

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

```

With a local install, invoke the binary through `npx` to avoid polluting your global environment:

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

```

This approach ensures all team members use the exact version specified in your project's [`package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/package.json).

---

## Running the Installer

The installer copies four components from the package—[`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md), `agents/`, `assets/`, and `references/`—into target directories derived from environment variables or sensible defaults.

### Available Targets

| Target | Destination | Environment Variable |
|--------|-------------|----------------------|
| `codex` | `~/.codex/skills/gpt-image-2-style-library` | `CODEX_HOME` |
| `claude-code` | `~/.claude/skills/gpt-image-2-style-library` | `CLAUDE_HOME` |
| `agents` | `~/.agents/skills/gpt-image-2-style-library` | `AGENTS_HOME` |
| `all` | All three locations above | — |

### Installation Commands

```bash

# Install to every supported host agent (default behavior)

gpt-image-2-style-library install all

# Install only for OpenAI Codex

gpt-image-2-style-library install codex

# Install only for Claude Code by Anthropic

gpt-image-2-style-library install claude-code

# Install only to the shared agents folder

gpt-image-2-style-library install agents

```

The installer script at `agents/skills/gpt-image-2-style-library/bin/install.mjs` handles recursive directory copying and automatically creates missing parent directories.

---

## Alternative: Using npm Scripts

The repository includes a wrapper script at `scripts/install-style-skill.mjs` that you can invoke directly from the project root:

```bash
npm run install:skill

```

This executes the equivalent of `node scripts/install-style-skill.mjs` as defined in the root [`package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/package.json). Use this when working from a cloned copy of the freestylefly/awesome-gpt-image-2 repository rather than the published npm package.

---

## How the Installation Works

Understanding the mechanics helps troubleshoot issues and customize deployment.

### Binary Registration

In [`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):

```json
{
  "name": "gpt-image-2-style-library",
  "bin": {
    "gpt-image-2-style-library": "bin/install.mjs"
  },
  "scripts": {
    "install:skill": "node bin/install.mjs",
    "pack:skill": "npm pack"
  }
}

```

The `bin` field tells npm to symlink `bin/install.mjs` as an executable named `gpt-image-2-style-library`.

### Target Resolution Logic

The `bin/install.mjs` script resolves destinations in priority order:

1. Environment variable (`CODEX_HOME`, `CLAUDE_HOME`, `AGENTS_HOME`)
2. Default home directory paths (`~/.codex`, `~/.claude`, `~/.agents`)

If a target directory doesn't exist, the script creates it before copying files.

### Verification

After running the installer, confirm success by checking the output path printed to your terminal:

```bash
ls ~/.codex/skills/gpt-image-2-style-library/SKILL.md

```

The presence of [`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md) confirms the skill is ready for your host agent to discover and load.

---

## Summary

- **Package name**: `gpt-image-2-style-library` (published to npm registry)
- **Binary entry**: `bin/install.mjs` (declared in [`package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/package.json))
- **Global install**: `npm install -g gpt-image-2-style-library` → run `gpt-image-2-style-library install <target>`
- **Local install**: `npm install gpt-image-2-style-library` → run `npx gpt-image-2-style-library install <target>`
- **Targets**: `codex`, `claude-code`, `agents`, or `all`
- **Key source files**: `agents/skills/gpt-image-2-style-library/bin/install.mjs`, [`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)

---

## Frequently Asked Questions

### What is the exact npm package name for the gpt-image-2-style-library skill?

The package is published as **`gpt-image-2-style-library`**. This is defined in [`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) and matches the repository's skill directory name. Install it with `npm install -g gpt-image-2-style-library` or `npm install gpt-image-2-style-library` for local use.

### Where does the installer copy the skill files?

The installer copies to `~/.codex/skills/`, `~/.claude/skills/`, or `~/.agents/skills/` by default, depending on your chosen target. These paths are configurable through environment variables (`CODEX_HOME`, `CLAUDE_HOME`, `AGENTS_HOME`) as implemented in `bin/install.mjs`. The installer recreates the full skill structure including [`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md), `agents/`, `assets/`, and `references/` at each destination.

### Can I install the skill without using npm?

Yes, though npm is the recommended distribution method. You can manually copy the `agents/skills/gpt-image-2-style-library/` directory from a cloned repository into your desired host agent's skills folder. However, this bypasses the automated path resolution and environment-variable handling provided by `bin/install.mjs`.

### What happens if I run the installer multiple times?

The installer performs a fresh copy on each invocation, overwriting existing files in the target directory. This ensures you always have the latest version from the installed npm package. The `bin/install.mjs` script uses recursive directory copying without merge logic, so manual modifications to previously installed skill files will be lost.