# Use the Fluxerly CLI

This guide describes SDK version 1004.0.0

Generate a starter bot, check project setup offline, triage issues, build installation URLs and sync coding-agent rules

The `@neontechspace/fluxerly` package ships the `fluxerly` command for project setup, offline verification, agent-assisted triage, installation URL generation and coding-agent rules. Pass `--help` or `--version` to inspect available commands and the installed SDK version. Every subcommand accepts `--help` (`-h`) and `--flag=value` syntax, and `doctor` and `triage` run even on Node.js older than 26.13 so they report the Node.js version check cleanly instead of crashing on load

Run installed subcommands with `npx --no`, `pnpm exec` or `bunx --no-install` so the package manager executes the local package rather than downloading an unscoped `fluxerly` package from npm

## Generate a starter with init

Create a new JavaScript, TypeScript or Effect bot project without replacing existing files, then install dependencies:

```sh
npx @neontechspace/fluxerly init
```

Available options:

- `--template js|ts|effect`: Selects the JavaScript, TypeScript or Effect starter without prompting
- `--dir <folder>`: Writes the starter into `<folder>`, creating it if needed
- `--pm npm|pnpm|bun`: Selects the package manager instead of detecting the launcher
- `--no-install`: Skips package installation and prints the install commands instead

The [quick start](https://fluxerly.neontechspace.com/docs/quick-start.md) walks through the generated files, `.env` setup and first run

## Check setup offline with doctor

Verify Node.js version, ESM setup, `tsconfig.json` (including legacy `moduleResolution` settings such as `node`, `node10` or `classic`), TypeScript 7, `@types/node`, Effect peer range, local or monorepo-hoisted `node_modules` drift, forbidden `require()` or deep `/dist/` and `/src/` imports, `AGENTS.md` and tool rule freshness, `.gitignore` hygiene, `.env` token prefixes and POSIX `.env` permissions (`chmod 600 .env`) without printing secrets or contacting Fluxer:

```sh
npx --no fluxerly doctor
```

Available options:

- `--dir <folder>`: Targets a bot folder other than the current directory
- `--json`: Prints structured JSON check results (`schemaVersion`, `ok`, `summary`, `versions`, `checks`) for scripts or CI
- `--strict`: Exits non-zero when warnings or failures are found

## Investigate failures with triage

Gather redacted project facts, redacted `tsconfig.json` compiler options, safe proxy and `NODE_OPTIONS` hints, the pinned Fluxer server commit, static `doctor` checks, an automatic **Detected SDK codes** table matched from attached logs or traces, and Fluxerly's triage playbook to diagnose whether an issue comes from application code, Fluxer or the SDK:

```sh
npx --no fluxerly triage
```

Available options:

- `[problem]`: Optional short description of what failed
- `--agent antigravity|claude|codex|opencode|t3code|other`: Chooses which coding-agent CLI to start, or `other` for a harness-agnostic prompt
- `--model <id>`: Passes a model identifier through to the chosen coding-agent CLI
- `--dir <folder>`: Targets a bot folder other than the current directory
- `--log <file|->`: Attaches a redacted, ANSI-stripped tail (up to 16 KB from a bounded read, symlink-checked to refuse credential files) of a local log file or standard input (`-`)
- `--run <command>`: Runs `<command>` once with `FLUXERLY_DEBUG=rest,gateway` and attaches redacted output
- `--timeout <duration>`: Sets the timeout for `--run` (for example `45s`, `60000` or `2m`, default 30 seconds)
- `--debug <categories>`: Overrides `FLUXERLY_DEBUG` categories used by `--run`
- `--print`: Prints the triage playbook and redacted context without launching an agent
- `--out <file>`: Writes the redacted Markdown triage brief to a file (mode `0600` on POSIX, refusing credential-like targets) without launching an agent
- `--json`: Prints structured JSON triage facts, doctor checks and detected SDK codes

For manual diagnosis steps without an agent, see [troubleshooting](https://fluxerly.neontechspace.com/docs/troubleshooting.md)

## Build an installation URL with invite

Generate a Fluxer bot installation URL offline from a decimal application ID, validating every permission name locally:

```sh
npx --no fluxerly invite 1234567890123456789 --permissions ViewChannel,SendMessages,ReadMessageHistory
```

Available options:

- `--permissions <value>`: Accepts comma-separated permission names or a decimal bitfield
- `--instance <url>`: Targets a self-hosted Fluxer instance origin instead of hosted Fluxer

See [create a bot](https://fluxerly.neontechspace.com/docs/create-a-bot.md#3-invite-the-bot-to-a-community) for application setup and community authorization steps

## Sync coding-agent rules with agents

Add, refresh or verify Fluxerly's bundled rules for coding agents after installing or updating the SDK:

```sh
npx --no fluxerly agents
```

Available options:

- `--target agents|skill|cursor|claude|gemini|all`: Chooses which agent instruction files to write
- `--check`: Exits non-zero when `AGENTS.md` is missing or out of date
- `--print`: Prints the Fluxerly rules section without modifying files
