***

title: Soul Module
subtitle: 'Export, import, and list portable NPC souls via API-backed thunks'
slug: npm/soul
--------------

The current SDK exposes Soul workflows through thunks and CLI commands.

## Export Soul

```typescript
import { createSDKStore, setNPCInfo, remoteExportSoulThunk } from '@forbocai/core';

const store = createSDKStore();

store.dispatch(setNPCInfo({ id: 'npc_1', persona: 'A careful merchant' }));

const exported = await store.dispatch(remoteExportSoulThunk({
  npcId: 'npc_1',
  apiUrl: 'https://api.forboc.ai',
  apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();

console.log(exported.txId, exported.url);
```

## Import Soul by Transaction ID

```typescript
import { importSoulFromArweaveThunk } from '@forbocai/core';

const soul = await store.dispatch(importSoulFromArweaveThunk({
  txId: 'arweave_tx_id_here',
  apiUrl: 'https://api.forboc.ai',
  apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();

console.log(soul.name, soul.persona);
```

## List Souls

```typescript
import { getSoulListThunk } from '@forbocai/core';

const souls = await store.dispatch(getSoulListThunk({
  limit: 20,
  apiUrl: 'https://api.forboc.ai',
  apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();

console.log(souls.length);
```

## CLI

```bash
npx forbocai soul export <npcId>
npx forbocai soul import <txId-or-local-json-file>
npx forbocai soul list 20
npx forbocai soul chat <npcId>
```
