> 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.

***

## Subcommands

| Subcommand                 | Purpose                                                 |
| -------------------------- | ------------------------------------------------------- |
| `snapshot`                 | Fetch every resource 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, apis, and iclients, builds a dependency graph, and writes the whole thing to `~/.celigo/indexes/<profile>.json` (mode `0600`).

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.

**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 by resource type (e.g. `flow`, `connection`, `export`, `import`, `script`, `stack`, `api`, `iclient`, `integration`). |
| `--limit <n>`   | number  | `20`    | Maximum number of results to return.                                                                                                 |
| `--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 built from `flow → integration/export/import/script`, `export/import → connection/script`, and script hooks.

**Signature**

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

**Arguments**

| Argument | Type   | Required | Description                                                                                                  |
| -------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `<type>` | string | Yes      | Resource type: `flow`, `integration`, `connection`, `export`, `import`, `script`, `stack`, `api`, `iclient`. |
| `<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).

**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.                                                                                                                                                                                                   |
| `orphaned-import`           | warning  | Import not referenced by any flow.                                                                                                                                                                                                   |
| `orphaned-connection`       | warning  | Connection not used by any export or import.                                                                                                                                                                                         |
| `no-trigger`                | warning  | Enabled flow with no `schedule` and no `WebhookExport` in its page generators. Skips abstract templates (which never run directly) and instance flows (whose trigger lives on the abstract's structure plus per-instance overrides). |

### 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).
4. **Partial snapshots are not fatal.** If one resource type fails to fetch, `snapshot` logs a yellow warning and continues with an empty list for that type — dependency and lint results will reflect the gap.
5. **`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.
6. **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), [apis](/cli/commands/apis.md), [iclients](/cli/commands/iclients.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.celigo.com/cli/commands/account.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
