> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory Hooks CLI

> Configure memory hooks via command line

Configure and manage memory hooks from the command line.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    User([User]) --> CLI[CLI]
    CLI --> Svc[Memory Hooks]

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Svc agent
    class User,CLI tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    npx praisonai memory hooks logging --enable
    ```
  </Step>

  <Step title="With Configuration">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    npx praisonai memory hooks status --json
    ```
  </Step>
</Steps>

## Enable Logging

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Enable memory logging
npx praisonai memory hooks logging --enable

# Disable logging
npx praisonai memory hooks logging --disable

# Show current status
npx praisonai memory hooks status
```

## Configure Hooks

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Add validation hook
npx praisonai memory hooks add validation --reject-empty

# Add encryption hook (uses env var for key)
npx praisonai memory hooks add encryption --key-env MEMORY_KEY

# List active hooks
npx praisonai memory hooks list
```

## Remove Hooks

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Remove specific hook
npx praisonai memory hooks remove validation

# Remove all hooks
npx praisonai memory hooks clear
```

## Test Hooks

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Test hooks with sample data
npx praisonai memory hooks test --key "test-key" --value "test-value"

# Verbose output
npx praisonai memory hooks test --verbose
```

## Programmatic (TypeScript)

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { 
  MemoryHooks, 
  createLoggingHooks, 
  createValidationHooks,
  createEncryptionHooks 
} from 'praisonai';

const hooks = createLoggingHooks();
// or
const hooks = createValidationHooks((key, value) => ({ valid: !!value }));
```

## Related

<CardGroup cols={2}>
  <Card title="Memory Hooks" icon="brain" href="/docs/js/memory-hooks">
    SDK documentation
  </Card>

  <Card title="Memory CLI" icon="brain" href="/docs/js/memory-cli">
    Memory commands
  </Card>
</CardGroup>
