> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/account.md).

# account

Local account index commands: build a snapshot of every resource, then search, walk the dependency graph, lint, and count from it offline.

**Note**: `account` commands operate on a LOCAL index file (`~/.celigo/indexes/<profile>.json`). They are not REST-backed; no "Corresponds to" API endpoint. For token identity see [`profile whoami`](/cli/commands/profile.md#celigo-profile-whoami); for applications in use see [`connections applications`](/cli/commands/connections.md#celigo-connections-applications).

```
celigo account <subcommand> [args] [flags]
```

Supports all [global flags](/cli/getting-started/global-flags.md). The index is created by `account snapshot` and read by `search`, `dependencies`, `lint`, and `stats`. All four readers auto-refresh when the index is older than 15 minutes (or `CELIGO_INDEX_STALE_MINUTES`); pass `--no-refresh` to skip. Since celigo-cli 2026.10.1 they also rebuild an index that another CLI version wrote, one built from another API host, and a partial one — see [Gotchas](#gotchas).

***

## Subcommands

| Subcommand                 | Purpose                                                             |
| -------------------------- | ------------------------------------------------------------------- |
| `snapshot`                 | Fetch the indexed resource types and write the local account index. |
| `search <query>`           | Scored keyword search across the index.                             |
| `dependencies <type> <id>` | Show the dependency graph for one resource.                         |
| `lint`                     | Run anomaly-detection rules against the index.                      |
| `stats`                    | Resource counts by type.                                            |

***

## `celigo account snapshot`

Fetches integrations, flows, connections, exports, imports, scripts, stacks, lookup caches, Event Streams topics, apis, tools, and iClients, builds a dependency graph, and writes the whole thing to `~/.celigo/indexes/<profile>.json` (mode `0600`). The graph holds every reference the local tree's registry finds in a flow, export, import, api, or tool — the references [`celigo pull`](/cli/local-tree/pull.md) links — so an API's or a tool's steps, the lookup caches and scripts they use, and the topic an Event Streams listener or publisher binds are edges too. The index also records the API host it was built from and a format version.

Since celigo-cli 2026.10.1 the snapshot fetches lookup caches, topics, and tools, and reads the references in apis and tools. Until then the graph took references from flows, exports, and imports only: `account dependencies api <id>` answered `uses: []`, and a resource that only an API or a tool used showed no dependents.

Since celigo-cli 2026.10.1 a listing that cannot be read is recorded in the index, and the two causes are told apart:

| Listing                                                                   | Recorded as                   | Effect                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Refused for this token (`401` or `403`)                                   | `forbidden`, with the refusal | The account's answer, not a failure: the index counts as complete for this token and is reused within the cache window. `snapshot` prints `<type>: not visible to this token (<reason>)` and a note, and exits `0`.                                                                                         |
| Failed (the network, a 5xx, a `429` past its retries, a malformed answer) | `failed`, with the reason     | The index is partial. `snapshot` prints `<type>: failed (<reason>)`, saves the index, and exits `1` naming the type. The next `account` command rebuilds it however recent, and until a snapshot lists every type, `search`, `dependencies`, `lint`, and `stats` warn on stderr which listings are missing. |

In both cases `lint` skips the rules that read the missing type and names them, rather than report what the snapshot could not see as unused.

Since celigo-cli 2026.8.7 the flow listing includes instance flows (the same `includeInstances` behavior as [`flows list --include-instances`](/cli/commands/flows.md#celigo-flows-list)), so the reference graph carries abstract↔instance edges — `account dependencies flow <abstractId> --direction used-by` enumerates an abstract flow's instances.

**Signature**

```bash
celigo account snapshot
```

**Arguments**

None.

**Flags**

None (beyond global flags).

**Example**

```bash
celigo account snapshot
# Fetching resources...
#   integration: 12
#   flow: 186
#   ...
# Snapshot saved: 912 resources indexed at 2026-04-22T18:52:06.208Z
```

This is a local index for fast offline queries — not a per-file backup. For a Git-friendly dump of resource bodies, use `celigo <resource> list --format json` and `celigo <resource> get <id>` in a loop.

***

## `celigo account search`

Scored keyword search across `name`, `_id`, `type`, `adaptorType`, and `_connectionId` on every indexed resource. Terms are space-split; score is the number of matching terms. With no match the command prints `No matches.` on stderr. Since celigo-cli 2026.10.1 a blank query (spaces only) matches nothing; it used to match every resource.

**Signature**

```bash
celigo account search <query> [flags]
```

**Arguments**

| Argument  | Type   | Required | Description                   |
| --------- | ------ | -------- | ----------------------------- |
| `<query>` | string | Yes      | Space-separated search terms. |

**Flags**

| Flag            | Type    | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                             |
| --------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--type <type>` | string  | —       | Filter results to one type the snapshot indexes: `integration`, `flow`, `connection`, `export`, `import`, `script`, `stack`, `lookupcache`, `topic`, `api`, `tool`, or `iclient`. Since celigo-cli 2026.10.1 any other value is refused before the search — a typo naming every type the CLI knows, a type the snapshot does not index (such as `mcpserver`) naming the ones it covers; it used to answer `No matches.` |
| `--limit <n>`   | number  | `20`    | Maximum number of results to return. A positive integer: since celigo-cli 2026.10.1 anything else is refused (`Invalid --limit '-1'. Use a positive integer.`).                                                                                                                                                                                                                                                         |
| `--no-refresh`  | boolean | —       | Skip auto-refresh of a stale index.                                                                                                                                                                                                                                                                                                                                                                                     |

**Example**

```bash
celigo account search "shopify orders"
celigo account search "shopify orders" --type flow --limit 10
```

***

## `celigo account dependencies`

Prints the dependency graph for one resource: what it `uses` (outgoing edges) and/or what `usedBy` references it (incoming edges). Edges are every reference the local tree's registry finds in a flow, export, import, api, or tool — steps, connections, scripts and hooks, lookup caches, topics, and the integration. A reference is listed even when its target is not indexed: a type the snapshot does not fetch (a file definition, an async helper) or a resource deleted since.

Since celigo-cli 2026.10.1 the command refuses:

* a `--direction` other than `uses`, `used-by`, or `both`, before it reads the index: `Invalid --direction 'usedby'. Expected one of: uses, used-by, both.` A typo used to answer an empty graph.
* a `<type>` the index does not know, naming the types it does.
* an id of an indexed type that the index does not hold, because an empty answer would read as "nothing depends on it": `flow 5f83a9b2c7d3e8f1a2b3c4d5 is not in the account index (snapshot of 2026-04-22T18:52:06.208Z). Check the id, or run 'celigo account snapshot' if it was created since.`

**Signature**

```bash
celigo account dependencies <type> <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description                                                                                                                                                                                                                                                                                                           |
| -------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<type>` | string | Yes      | The index's singular type name: `flow`, `integration`, `connection`, `export`, `import`, `script`, `stack`, `lookupcache`, `topic`, `api`, `tool`, `iclient` — or a type the snapshot does not fetch, such as `filedefinition` or `asynchelper`, whose resources the graph knows only through the references to them. |
| `<id>`   | string | Yes      | Resource `_id`.                                                                                                                                                                                                                                                                                                       |

**Flags**

| Flag                | Type                          | Default | Description                         |
| ------------------- | ----------------------------- | ------- | ----------------------------------- |
| `--direction <dir>` | `uses` \| `used-by` \| `both` | `both`  | Which side of the graph to print.   |
| `--no-refresh`      | boolean                       | —       | Skip auto-refresh of a stale index. |

**Example**

```bash
# What does this flow depend on?
celigo account dependencies flow 5f83a9b2c7d3e8f1a2b3c4d5 --direction uses

# What references this connection?
celigo account dependencies connection 6a1b2c3d4e5f6a7b8c9d0e1f --direction used-by
```

***

## `celigo account lint`

Runs anomaly-detection rules against the index and prints issues with `severity`, `rule`, `resourceType`, `resourceName`, and `message`. Exits 0 regardless of issue count — gate on the output yourself (see CI example below).

Since celigo-cli 2026.10.1, when the index holds no listing of a type — the token may not read it, or the listing failed — the rules that read that type are skipped and named on stderr instead of reporting what was never read as unused; a clean run then says `No issues found by the rules that ran.`

**Signature**

```bash
celigo account lint [flags]
```

**Arguments**

None.

**Flags**

| Flag           | Type    | Default | Description                         |
| -------------- | ------- | ------- | ----------------------------------- |
| `--no-refresh` | boolean | —       | Skip auto-refresh of a stale index. |

**Example**

```bash
celigo account lint --format table
celigo account lint --format json
```

### Lint rules

| Rule                        | Severity | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `offline-connection-in-use` | error    | An offline connection referenced by at least one enabled flow (directly or via an export/import).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `orphaned-export`           | warning  | Export not referenced by any flow, export, import, api, or tool.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `orphaned-import`           | warning  | Import not referenced by any flow, export, import, api, or tool.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `orphaned-connection`       | warning  | Connection not referenced by any flow, export, import, api, or tool.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `no-trigger`                | warning  | Enabled flow with no schedule, webhook, or Event Streams listener trigger. A flow counts as triggered when it or one of its page generators has a `schedule`; when a source is a listener — webhook, real-time (`distributed`), CDC stream (`stream`), Event Streams topic, AS2, or VAN; when another enabled flow chains to it (`_runNextFlowIds`, `_runNextExportIds`); or when a delta `_keepDeltaBehindFlowId` / `_keepDeltaBehindExportId` orders it. Skips abstract templates (which never run directly), instance flows (whose trigger lives on the abstract's structure plus per-instance overrides), and Integration App flows. |

Since celigo-cli 2026.10.1 the three orphan rules count every edge in the index, so a resource that only an API, a tool, or an AI agent's MCP tool uses is no longer reported as orphaned, and `no-trigger` no longer reports flows started by an Event Streams, real-time (`distributed`), CDC stream (`stream`), AS2, or VAN listener, a chain, a page generator's schedule, or delta ordering, nor Integration App flows.

### CI example

```bash
# Block merge if lint finds any errors
celigo account lint --format json \
  | jq -e '[.[] | select(.severity == "error")] | length == 0' \
  || { echo "Lint errors; fix and retry."; exit 1; }
```

***

## `celigo account stats`

Emits a count per resource type plus a `total` and the index `timestamp`.

**Signature**

```bash
celigo account stats [flags]
```

**Arguments**

None.

**Flags**

| Flag           | Type    | Default | Description                         |
| -------------- | ------- | ------- | ----------------------------------- |
| `--no-refresh` | boolean | —       | Skip auto-refresh of a stale index. |

**Example**

```bash
celigo account stats --format json
celigo account stats --format table
```

***

## Gotchas

1. **Local index only.** The snapshot lives at `~/.celigo/indexes/<profile>.json` and is written mode `0600`. Delete the file to force a cold rebuild; there is no server-side copy.
2. **Per-profile.** Each profile has its own index file. Switching profiles reads (and refreshes) the corresponding file — snapshots never mix.
3. **Staleness threshold is 15 minutes.** Override with `CELIGO_INDEX_STALE_MINUTES` (integer, minutes). Pass `--no-refresh` to skip the auto-refresh entirely (useful in CI when you've just run `snapshot` explicitly). Since celigo-cli 2026.10.1, an index whose timestamp is in the future or does not parse counts as stale.
4. **A failed listing makes the index partial; a refused one does not.** Since celigo-cli 2026.10.1 a type the token may not list (`401`/`403`) is recorded as `forbidden` and the index stays complete for that token, while any other failure is recorded as `failed`: `snapshot` exits `1`, the index is never served as fresh, and every reader says which listings are missing — see [`account snapshot`](#celigo-account-snapshot). Until then a failed type was saved as an empty list with only a warning — a missing flow listing, for example, made `lint` report every export as unused.
5. **The index belongs to one host and one CLI format.** Since celigo-cli 2026.10.1 it records the API host it was built from and a format version, and a reader rebuilds an index built from another host — a profile whose token or base URL now reaches another account no longer answers from the old account's resources — or written by another CLI version (an index from before 2026.10.1 has no tools, lookup caches, topics, or api/tool references). Under `--no-refresh` the index is read as it is, with a note on stderr.
6. **`snapshot` is not a backup.** It stores enough fields to search and graph, not enough to re-create resources. Use `celigo <resource> get <id> --format json` for Git-friendly dumps.
7. **Legacy migration.** A pre-profile `~/.celigo/account-index.json` is auto-migrated to `~/.celigo/indexes/default.json` on first read.

## Related

* [profile](/cli/commands/profile.md) — manage the profile whose index is read/written here; `profile whoami` resolves the active token's identity.
* [connections](/cli/commands/connections.md) — `connections applications` lists the external applications in use across the account.
* [config](/cli/commands/config.md) — `~/.celigo/config.json` lives alongside `~/.celigo/indexes/`.
* Per-resource pages the index is built from: [integrations](/cli/commands/integrations.md), [flows](/cli/commands/flows.md), [connections](/cli/commands/connections.md), [exports](/cli/commands/exports.md), [imports](/cli/commands/imports.md), [scripts](/cli/commands/scripts.md), [stacks](/cli/commands/stacks.md), [lookup-caches](/cli/commands/lookup-caches.md), [topics](/cli/commands/topics.md), [apis](/cli/commands/apis.md), [tools](/cli/commands/tools.md), [iclients](/cli/commands/iclients.md).
