# How to Install the GPT-Image2 Agent Skill Using the npm CLI

> Install the GPT-Image2 agent skill easily using the npm CLI. Follow this guide to add the gpt-image-2-style-library package and enable it for your agents.

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

---

**TLDR:** Install the `gpt-image-2-style-library` package globally with npm, then execute `gpt-image-2-style-library install all` to copy the skill definition into the local agent directories used by Codex, Claude Code, and generic agents.

The `freestylefly/awesome-gpt-image-2` repository distributes the GPT-Image2 agent skill as an npm package named `gpt-image-2-style-library`. This package provides a CLI tool that automates the installation of skill definitions into the standard directories where AI agents discover capabilities.

## Global CLI Installation

The recommended method for development machines is to install the package globally. This exposes the `gpt-image-2-style-library` command system-wide, allowing you to sync the skill across multiple agent environments.

Run the following command to install the CLI globally:

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

```

After installation, execute the `install all` command to copy the skill files into the default local directories:

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

```

This command, implemented in `agents/skills/gpt-image-2-style-library/bin/install.mjs`, copies the skill definition from [`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) into `~/.codex/skills`, `~/.claude/skills`, and `~/.agents/skills`.

## Using npx Without Global Installation

If you prefer not to install the package permanently, or you are running the installation in a CI pipeline, use the `npx` command to execute the CLI directly:

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

```

This approach downloads and runs the package in a single step, syncing the GPT-Image2 agent skill to your local directories without modifying your global npm packages.

## Installing from GitHub Packages

For users who require the scoped package hosted on GitHub Packages, use the scoped name `@freestylefly/gpt-image-2-style-library` and specify the registry:

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

```

After installation, run the same `install all` command to sync the skill files to your local agent directories.

## Local Repository Installation

If you have cloned the `freestylefly/awesome-gpt-image-2` repository, you can use the shortcut script defined in the root [`package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/package.json). This method executes the same installation routine from the local source:

```bash
npm run install:skill

```

This command runs the local version of the CLI script, ensuring you are installing the skill definition directly from the repository state.

## Verifying the Installation

After running the installation command, verify that the skill files exist in the target directories. For example, check the Codex skills directory:

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

```

You should see the [`SKILL.md`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/SKILL.md) file and supporting assets. Restart any running agent process (Codex, Claude Code, or generic agents) to load the newly installed GPT-Image2 skill.

## Summary

- The **GPT-Image2 agent skill** is distributed as the npm package `gpt-image-2-style-library` according to [`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).
- The CLI entry point at `agents/skills/gpt-image-2-style-library/bin/install.mjs` handles copying files to `~/.codex/skills`, `~/.claude/skills`, and `~/.agents/skills`.
- **Global installation** via `npm install -g` provides persistent access to the `gpt-image-2-style-library` command.
- **Temporary execution** via `npx` avoids global package pollution.
- **Scoped packages** from GitHub Packages require the `--registry` flag.
- The root [`package.json`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/package.json) provides an `npm run install:skill` shortcut for local development.

## Frequently Asked Questions

### How do I update the GPT-Image2 agent skill after installation?

Run `npm update -g gpt-image-2-style-library` to fetch the latest version of the package, then execute `gpt-image-2-style-library install all` again to overwrite the skill files in the local directories with the updated versions from [`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).

### Can I install the skill for only one specific agent instead of all three?

The current CLI implementation in `agents/skills/gpt-image-2-style-library/bin/install.mjs` does not support targeting individual agents. The `install all` command always copies the skill definition to Codex, Claude Code, and generic agent directories simultaneously.

### What should I do if the CLI command is not found after global installation?

Ensure that your npm global bin directory is in your system PATH. You can verify the installation location by running `npm list -g gpt-image-2-style-library` and check that the directory containing the binary is exported in your shell configuration file.

### Is the npm package name different from the repository name?

Yes, while the repository is named `awesome-gpt-image-2`, the published npm package is `gpt-image-2-style-library` as 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). When installing via npm, always use the package name `gpt-image-2-style-library` rather than the repository name.