PHPackages                             webgrafia/cheshire-cat-sdk-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. webgrafia/cheshire-cat-sdk-laravel

ActiveLibrary[API Development](/categories/api)

webgrafia/cheshire-cat-sdk-laravel
==================================

Laravel SDK for interacting with Cheshire Cat AI API

v0.3.2(11mo ago)5811GPL-3.0PHPPHP &gt;=8.0

Since Mar 26Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/webgrafia/cheshire-cat-sdk-laravel)[ Packagist](https://packagist.org/packages/webgrafia/cheshire-cat-sdk-laravel)[ RSS](/packages/webgrafia-cheshire-cat-sdk-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (24)Used By (1)

Cheshire Cat SDK for Laravel
============================

[](#cheshire-cat-sdk-for-laravel)

[![Cheshire Cat Logo](assets/logo-bg.png)](assets/logo-bg.png)Laravel SDK for interacting with [Cheshire Cat AI](https://github.com/cheshire-cat-ai/) API, providing seamless integration with endpoints for messages, user management, settings, memory, plugins, and more.

---

API Reference and Versioning
----------------------------

[](#api-reference-and-versioning)

This SDK is built to interact with the Cheshire Cat API. For a comprehensive list of all available endpoints, their parameters, and expected responses, please refer to the [OpenAPI specification file](docs/openapi.json).

**Version Compatibility:** The `openapi.json` file also indicates the specific version of the Cheshire Cat API that this SDK is designed to work with. This ensures compatibility and helps you understand the features and functionalities supported by the SDK.

**Current API Version:** 1.9.0 (as per openapi.json)

---

Installation
------------

[](#installation)

1. Install the package via Composer:

    ```
    composer require webgrafia/cheshire-cat-sdk-laravel
    ```
2. Publish the configuration file:

    ```
    php artisan vendor:publish --tag=config --provider="CheshireCatSdk\CheshireCatServiceProvider"
    ```
3. Update `.env` with Cheshire Cat API credentials:

    ```
    CHESHIRE_CAT_BASE_URI=http://localhost:1865/
    CHESHIRE_CAT_WS_BASE_URI=ws://localhost:1865/ws
    CHESHIRE_CAT_API_KEY=your_api_key_here
    ```

---

Default Routes
--------------

[](#default-routes)

The SDK provides 2 default route `/meow/status` and `/meow/hello` that can be used to check the status of the Cheshire Cat API.

### Usage

[](#usage)

To check the status of the API, simply navigate to `http://your-app-domain/meow/status` in your browser. To say Hello to Cheshire simply navigate to `http://your-app-domain/meow/hello` in your browser.

This routes will return a message indicating whether the API connection was successful or not, along with the status response or any error messages.

---

Configuration
-------------

[](#configuration)

The published configuration file is located at `config/cheshirecat.php`:

```
return [
    'base_uri' => env('CHESHIRE_CAT_BASE_URI', 'http://localhost:1865/'),
    'ws_base_uri' => env('CHESHIRE_CAT_WS_BASE_URI', 'ws://localhost:1865/ws'),
    'api_key' => env('CHESHIRE_CAT_API_KEY'),
];
```

---

Usage
-----

[](#usage-1)

Use the `CheshireCat` Facade or the `CheshireCat` class directly.

Examples
--------

[](#examples)

### Methods

[](#methods)

#### 1. Status Check

[](#1-status-check)

```
use CheshireCatSdk\Facades\CheshireCatFacade as CheshireCat;

$response = CheshireCat::status();

if ($response->getStatusCode() === 200) {
    echo "API is up and running!";
}
```

#### 2. Send a Message

[](#2-send-a-message)

```
$response = CheshireCat::message('Hello, Cheshire Cat!');
$data = json_decode($response->getBody(), true);

echo $data['text'];
```

#### 3. Get Available Permissions

[](#3-get-available-permissions)

```
$response = CheshireCat::getAvailablePermissions();
$permissions = json_decode($response->getBody(), true);

print_r($permissions);
```

#### 4. User Management

[](#4-user-management)

- **Create a User**

    ```
    $response = CheshireCat::createUser([
        'username' => 'testuser',
        'password' => 'securepassword',
    ]);
    $user = json_decode($response->getBody(), true);

    echo $user['id'];
    ```
- **Get Users**

    ```
    $response = CheshireCat::getUsers(0, 10);
    $users = json_decode($response->getBody(), true);

    print_r($users);
    ```
- **Update a User**

    ```
    $response = CheshireCat::updateUser('user_id', [
        'username' => 'updateduser',
    ]);
    echo $response->getStatusCode();
    ```
- **Delete a User**

    ```
    $response = CheshireCat::deleteUser('user_id');
    echo $response->getStatusCode();
    ```

#### 5. Manage Settings

[](#5-manage-settings)

- **Get All Settings**

    ```
    $response = CheshireCat::getSettings();
    $settings = json_decode($response->getBody(), true);

    print_r($settings);
    ```
- **Create a Setting**

    ```
    $response = CheshireCat::createSetting([
        'name' => 'new_setting',
        'value' => 'some_value',
    ]);
    echo $response->getStatusCode();
    ```
- **Update a Setting**

    ```
    $response = CheshireCat::updateSetting('setting_id', [
        'value' => 'updated_value',
    ]);
    echo $response->getStatusCode();
    ```
- **Delete a Setting**

    ```
    $response = CheshireCat::deleteSetting('setting_id');
    echo $response->getStatusCode();
    ```

#### 6. Memory Management

[](#6-memory-management)

- **Get Memory Points**

    ```
    $response = CheshireCat::getMemoryPoints('collection_id');
    $points = json_decode($response->getBody(), true);

    print_r($points);
    ```
- **Create a Memory Point**

    ```
    $response = CheshireCat::createMemoryPoint('collection_id', [
        'content' => 'This is a memory point.',
    ]);
    echo $response->getStatusCode();
    ```
- **Delete a Memory Point**

    ```
    $response = CheshireCat::deleteMemoryPoint('collection_id', 'point_id');
    echo $response->getStatusCode();
    ```

#### 7. Plugin Management

[](#7-plugin-management)

- **Get Plugins**

    ```
    $response = CheshireCat::getAvailablePlugins();
    $plugins = json_decode($response->getBody(), true);

    print_r($plugins);
    ```
- **Install a Plugin**

    ```
    $file = fopen('/path/to/plugin.zip', 'r');

    $response = CheshireCat::installPlugin([
        [
            'name' => 'file',
            'contents' => $file,
        ],
    ]);
    echo $response->getStatusCode();
    ```
- **Toggle a Plugin**

    ```
    $response = CheshireCat::togglePlugin('plugin_id');
    echo $response->getStatusCode();
    ```

---

### WebSocket Connection

[](#websocket-connection)

The SDK supports WebSocket connections for real-time communication with the Cheshire Cat AI server.

#### WebSocket Basic Usage Example

[](#websocket-basic-usage-example)

```
use CheshireCatSdk\Facades\CheshireCatFacade as CheshireCat;
$payload = ['text' => 'Hello, who are you?'];
        CheshireCat::sendMessageViaWebSocket($payload);

        // Ciclo per ricevere più messaggi
        while (true) {
            // Ricevi la risposta
            $response = CheshireCat::wsClient()->receive();
            $response = json_decode($response, true);

            if($response["type"] == "chat"){
                echo $response["text"];
                break;
            }
        }

        // Chiudi la connessione WebSocket
        CheshireCat::closeWebSocketConnection();
```

---

### Rabbit Hole File Upload

[](#rabbit-hole-file-upload)

Upload a file to the API via the `/rabbithole/` endpoint.

```
use CheshireCatSdk\Facades\CheshireCatFacade as CheshireCat;

$filePath = 'tests/mocks/sample.pdf';
$fileName = 'sample.pdf';
$contentType = 'application/pdf';

$metadata = [
    "source" => "sample.pdf",
    "title" => "Test title",
    "author" => "Test author",
    "year" => 2020,
];

$response = CheshireCat::uploadFile($filePath, $fileName, $contentType, $metadata);

if ($response->getStatusCode() === 200) {
    echo "File uploaded successfully!";
}
```

**Parameters**:

- `$filePath` - The path to the file to be uploaded.
- `$fileName` - The name of the file.
- `$contentType` - MIME type of the file (e.g., `application/pdf`).
- `$metadata` - Associative array containing optional metadata related to the file.

**Response**:

- Returns an HTTP response object containing the details of the API's response.

---

Custom route for Testing
------------------------

[](#custom-route-for-testing)

example of route in web.php for testing

```
use Illuminate\Support\Facades\Route;
use CheshireCatSdk\Facades\CheshireCatFacade as CheshireCat;

Route::get('/meow_connection', function () {
    try {
        // Try to get the status of the Cheshire Cat API
        $statusResponse = CheshireCat::getStatus();

        // Check if the status response is successful
        if ($statusResponse->getStatusCode() === 200) {
            echo "Cheshire Cat API connection successful!";
            echo "Status Response: " . $statusResponse->getBody()->getContents();
        } else {
            echo "Cheshire Cat API connection failed!";
            echo "Status Response: " . $statusResponse->getBody()->getContents();
        }
    } catch (\Exception $e) {
        echo "Cheshire Cat API connection failed!";
        echo "Error: " . $e->getMessage();
    }
});
```

---

Contributing
------------

[](#contributing)

Feel free to fork this repository and submit pull requests.

---

License
-------

[](#license)

This package is open-source software licensed under the [GNU GENERAL PUBLIC LICENSE](LICENSE).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance51

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Recently: every ~17 days

Total

23

Last Release

343d ago

PHP version history (2 changes)v0.1.0PHP &gt;=8.0

v0.2.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/39621ace936cfa65dda9266b7e489e26d0f29e075b94183b19ba0979e91b5786?d=identicon)[webgrafia](/maintainers/webgrafia)

---

Top Contributors

[![webgrafia](https://avatars.githubusercontent.com/u/9932389?v=4)](https://github.com/webgrafia "webgrafia (37 commits)")

---

Tags

aicheshire-catlaravel-package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webgrafia-cheshire-cat-sdk-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/webgrafia-cheshire-cat-sdk-laravel/health.svg)](https://phpackages.com/packages/webgrafia-cheshire-cat-sdk-laravel)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
