# flowrunner-cli — moved to `@flowrunner/cli`

> **This package is deprecated. It has moved to [`@flowrunner/cli`](https://www.npmjs.com/package/@flowrunner/cli).**
>
> Same CLI, same `flowrunner` command, same behaviour — only the npm package name changed, to sit in the
> `@flowrunner` organisation alongside the rest of the platform's packages.
>
> This package will not receive further releases. Install `@flowrunner/cli` instead.

```bash
npm install --save-dev @flowrunner/cli
```

## Migrating an existing project

Three steps. Nothing about your services, flows or deployed extensions changes — this is a package rename,
not a version upgrade.

**1. Swap the dependency**

```bash
npm uninstall flowrunner-cli
npm install @flowrunner/cli -D 
```

**2. Update the one line that names the package**

`init` copied a test harness into your project, and `sandbox/service.js` loads the runtime by package name.
It is the only file in a scaffolded project that resolves `flowrunner-cli` at runtime:

```diff
  } = require('flowrunner-cli/runtime')
+ } = require('@flowrunner/cli/runtime')
```

Miss this and `npm test` fails with `Cannot find module 'flowrunner-cli/runtime'`. Everything else in
`sandbox/` mentions the old name only in comments.

**3. Re-run the AI wiring, if you use it**

```bash
npx flowrunner init-claude
```

The bundled authoring reference now ships at `node_modules/@flowrunner/cli/ai-docs/`, so the subagents and
the `CLAUDE.md` block have to be refreshed to point at the new path. `init-claude` rewrites only its own
region and leaves the rest of `CLAUDE.md` byte-for-byte intact.

**If you installed the CLI globally**

```bash
npm uninstall -g flowrunner-cli
npm install -g @flowrunner/cli
```

The global install is only a launcher — it puts `flowrunner` on your `PATH` and hands each command to the
copy in your project's `node_modules`. Your project's pinned version is still what runs.

### Nothing else changes

- The command is still `flowrunner`. No script, alias or CI step needs editing.
- `flowrunner.json`, `.flowrunner/token`, `services/` and every deployed extension are untouched.
- The `CLAUDE.md` markers are still `<!-- flowrunner-cli:ai:start -->` / `<!-- flowrunner-cli:ai:end -->`.
  **Do not rename them.** They identify a block already written into your file; changing them orphans it and
  the next `init-claude` appends a second copy.

## For an AI agent doing this migration

If you are an agent asked to migrate a project off `flowrunner-cli`, apply exactly the following. The rename
is `flowrunner-cli` → `@flowrunner/cli`; the executable name does **not** change.

**Replace** — in `package.json`, `sandbox/**/*.js`, and any project docs:

| Find | Replace with |
|---|---|
| `flowrunner-cli/runtime` | `@flowrunner/cli/runtime` |
| `node_modules/flowrunner-cli/` | `node_modules/@flowrunner/cli/` |
| `"flowrunner-cli"` as a dependency key | `"@flowrunner/cli"` |
| `npm i -g flowrunner-cli`, `npm i -D flowrunner-cli` | the same with `@flowrunner/cli` |

**Never replace** — these are correct as they stand:

| Leave alone | Why |
|---|---|
| `<!-- flowrunner-cli:ai:start -->`, `<!-- flowrunner-cli:ai:end -->` | Markers identifying an existing block in `CLAUDE.md`. Renaming them orphans the block. |
| the `flowrunner` command in any script or docs | The executable name is unchanged. |
| `flowrunner.json`, `.flowrunner/` | Project config and token paths, unrelated to the package name. |

**Then run** `npm install` and `npm test`. A green suite is the check that step 2 landed — a missed
`require` fails as `Cannot find module 'flowrunner-cli/runtime'`.

**Verify** that no *functional* reference survives. This matches only the three shapes that resolve the
package — a `require`, a dependency key, and an `ai-docs` path — so it ignores the markers and any mention
in prose:

```bash
grep -rnE "require\(['\"]flowrunner-cli|\"flowrunner-cli\" *:|node_modules/flowrunner-cli" . --exclude-dir=node_modules
```

Empty output means done. A remaining mention of `flowrunner-cli` in a comment is harmless and needs no edit.

## What this package was

The `flowrunner` CLI: author and deploy **custom extensions** — your own connectors — from your own
repository, for **[FlowRunner](https://flowrunner.ai/)**, the orchestration layer for AI agents in
production.

Full documentation now lives with [`@flowrunner/cli`](https://www.npmjs.com/package/@flowrunner/cli).
