> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-docs-new-agent-experience.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Skills

> Install the agent skill so coding agents can drive difyctl

[`skills install`](#install-the-skill) writes the `difyctl` skill (a `SKILL.md` file) into the skill directories of the coding agents on your machine.

The skill deliberately lists no commands: it points the agent at `difyctl help -o json` and lets it discover the live command surface itself.

See the [help reference](/en/cli/reference/help#machine-readable-help) for that discovery surface, and [Install the difyctl Skill](/en/cli/integrate-agents/install-the-difyctl-skill) for the full integration.

## Install the Skill

```text theme={null}
difyctl skills install [dir] [flags]
```

This command is fully local: it needs no sign-in and never contacts a server.

### Arguments

* `dir`: optional. Install into this single directory, bypassing agent detection. The skill lands at `<dir>/SKILL.md`. Cannot be combined with `--agent`.

### Flags

| Flag        | Type               | Default | Description                                                                                                                                                                                                                                                                                                                                          |
| :---------- | :----------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-y, --yes` | boolean            | `false` | Write the skill. Without it, the command is a dry run: it lists where the skill would land and writes nothing.                                                                                                                                                                                                                                       |
| `--agent`   | string, repeatable | none    | Restrict the install to specific detected agents, using the names from [Agent Detection](#agent-detection).<br /><br />With no `--agent`, the skill installs into every detected agent. To install into several agents but not all, repeat the flag or pass a comma-separated list.<br /><br />Naming an agent that isn't detected is a usage error. |
| `--stdout`  | boolean            | `false` | Print the skill to stdout and write nothing. Cannot be combined with `--yes`, `--agent`, or `dir`.                                                                                                                                                                                                                                                   |

### Examples

Preview where the skill would be installed (dry run, the default):

```bash theme={null}
difyctl skills install
```

Install into every detected agent:

```bash theme={null}
difyctl skills install --yes
```

Install into one agent only:

```bash theme={null}
difyctl skills install --yes --agent claude-code
```

Install into several specific agents (repeat the flag or comma-separate):

```bash theme={null}
difyctl skills install --yes --agent claude-code --agent cursor
```

Install into an explicit directory, for an agent the CLI doesn't detect:

```bash theme={null}
difyctl skills install ./my-skills/difyctl --yes
```

Print the skill without writing anything:

```bash theme={null}
difyctl skills install --stdout
```

### Agent Detection

Detection checks whether each agent's configuration directory exists. The CLI never probes `PATH` or launches anything. The skill is written to each agent's documented user-level skill location:

| Agent         | Detected when               | Skill lands in                               |
| :------------ | :-------------------------- | :------------------------------------------- |
| `claude-code` | `~/.claude` exists          | `~/.claude/skills/difyctl/SKILL.md`          |
| `codex`       | `~/.codex` exists           | `~/.agents/skills/difyctl/SKILL.md`          |
| `opencode`    | `~/.config/opencode` exists | `~/.config/opencode/skills/difyctl/SKILL.md` |
| `cursor`      | `~/.cursor` exists          | `~/.cursor/skills/difyctl/SKILL.md`          |
| `pi`          | `~/.pi` exists              | `~/.pi/agent/skills/difyctl/SKILL.md`        |

An agent that's installed but has never been launched may not have its configuration directory yet. Install into its skill directory explicitly with `difyctl skills install <dir>`.

### Output

A dry run lists the detected agents and the target paths, then tells you how to proceed:

```text theme={null}
Detected 2 agents: claude-code, cursor

would write to claude-code: /Users/you/.claude/skills/difyctl/SKILL.md
would write to cursor: /Users/you/.cursor/skills/difyctl/SKILL.md

Re-run with --yes to write all, or --agent <name> to write only some.
Agent not listed? Install into its directory with `difyctl skills install <dir>`.
```

With `--yes`, each write is confirmed:

```text theme={null}
wrote /Users/you/.claude/skills/difyctl/SKILL.md
wrote /Users/you/.cursor/skills/difyctl/SKILL.md
```

When nothing is detected, the command explains the alternatives and exits 0:

```text theme={null}
No agents detected (looked for ~/.claude, ~/.codex, ~/.config/opencode, ~/.cursor, ~/.pi).
Install into a directory manually with `difyctl skills install <dir>`, or
print the skill with `difyctl skills install --stdout`.
```

The installed skill carries a version stamp matching the CLI that wrote it. Re-running `skills install --yes` after upgrading replaces the file with the current version. Re-running is always safe.

### Exit Codes

| Code | Meaning                                                                                                                               |
| :--- | :------------------------------------------------------------------------------------------------------------------------------------ |
| `0`  | Success, including a dry run and the nothing-detected case                                                                            |
| `1`  | Local failure, such as a target directory that isn't writable                                                                         |
| `2`  | Usage error: `--stdout` combined with a write option, `dir` combined with `--agent`, or `--agent` naming an agent that isn't detected |
