PHPackages                             opencangjie/skills - 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. opencangjie/skills

ActiveLibrary

opencangjie/skills
==================

PHP SDK for AgentSkills Runtime - Install, manage, and execute AI agent skills with built-in runtime support

13PHP

Since Mar 10Pushed 2mo agoCompare

[ Source](https://github.com/UCTooCom/agentskills-runtime-php-sdk)[ Packagist](https://packagist.org/packages/opencangjie/skills)[ RSS](/packages/opencangjie-skills/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AgentSkills PHP SDK
===================

[](#agentskills-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/2937a50d67c1cf27f21fc397db7a160868e8f46ef8f5a14d3eacd78288a1818a/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e63616e676a69652f736b696c6c732f762f737461626c65)](https://packagist.org/packages/opencangjie/skills)[![Total Downloads](https://camo.githubusercontent.com/3c053742de7ee374d9719d41d56989e4f5a62f1cd4e1f9c67e7e596cb494c762/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e63616e676a69652f736b696c6c732f646f776e6c6f616473)](https://packagist.org/packages/opencangjie/skills)[![License](https://camo.githubusercontent.com/e88fb887942c0cfe54808a9d336f8f0164dad40c9cda41c3f7436b3c92f9f798/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e63616e676a69652f736b696c6c732f6c6963656e7365)](https://packagist.org/packages/opencangjie/skills)[![PHP Version Require](https://camo.githubusercontent.com/28c5c2435c8ef4bec1c4793b3b0163082cba168d7495fa3538a8be27328d66b5/68747470733a2f2f706f7365722e707567782e6f72672f6f70656e63616e676a69652f736b696c6c732f726571756972652f706870)](https://packagist.org/packages/opencangjie/skills)

PHP SDK for AgentSkills Runtime - Install, manage, and execute AI agent skills with built-in runtime support.

Features
--------

[](#features)

- 🚀 **Easy Installation**: One-command runtime installation
- 🛠️ **CLI &amp; Programmatic API**: Use via command line or PHP code
- 🔍 **Skill Discovery**: Search and install skills from multiple sources
- ⚡ **Built-in Runtime**: Automatic runtime download and management
- 🔧 **Multi-Platform**: Support for Windows, macOS, and Linux
- 📦 **PSR Compliant**: Follows PHP-FIG standards

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

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require opencangjie/skills
```

### Global Installation (for CLI usage)

[](#global-installation-for-cli-usage)

```
composer global require opencangjie/skills
```

Make sure your global Composer bin directory is in your PATH:

- **Windows**: `%USERPROFILE%\AppData\Roaming\Composer\vendor\bin`
- **macOS/Linux**: `~/.composer/vendor/bin` or `~/.config/composer/vendor/bin`

### Install from Source

[](#install-from-source)

```
git clone https://github.com/UCTooCom/agentskills-runtime.git
cd agentskills-runtime/sdk/php
composer install
```

Quick Start
-----------

[](#quick-start)

### 1. Install Runtime

[](#1-install-runtime)

```
# Using global installation
skills install-runtime

# Using local installation
./vendor/bin/skills install-runtime
```

### 2. Configure AI Model

[](#2-configure-ai-model)

Edit the `.env` file in the runtime directory:

- **Windows**: `%USERPROFILE%\.agentskills-runtime\win-x64\release\.env`
- **macOS/Linux**: `~/.agentskills-runtime/-/release/.env`

Add your AI model API key:

```
# Example: DeepSeek
MODEL_PROVIDER=deepseek
MODEL_NAME=deepseek-chat
DEEPSEEK_API_KEY=your_api_key_here
```

### 3. Start Runtime

[](#3-start-runtime)

```
skills start
```

### 4. Install and Run Skills

[](#4-install-and-run-skills)

```
# Search for skills
skills find "python"

# Install a skill
skills add https://github.com/user/skill-repo

# Execute a skill
skills run
```

CLI Usage
---------

[](#cli-usage)

The SDK provides a command-line interface for managing skills and runtime.

### Runtime Commands

[](#runtime-commands)

```
# Install runtime
skills install-runtime [--runtime-version 0.0.16]

# Start runtime
skills start [--port 8080] [--host 127.0.0.1] [--foreground]

# Stop runtime
skills stop

# Check status
skills status
```

### Skill Commands

[](#skill-commands)

```
# Search for skills
skills find  [--source github] [--limit 10]

# Install skills
skills add  [--branch main] [--tag v1.0.0]

# List installed skills
skills list [--page 1] [--limit 20]

# Get skill info
skills info

# Execute skills
skills run  [--tool ] [--params '{"key": "value"}']

# Remove skills
skills remove

# Initialize new skill project
skills init  [--directory ./skills]

# Check for updates
skills check
```

Programmatic Usage
------------------

[](#programmatic-usage)

### Create Client

[](#create-client)

```
use AgentSkills\SkillsClient;
use AgentSkills\ClientConfig;

// Create client with default settings
$client = new SkillsClient();

// Create client with custom configuration
$config = new ClientConfig(
    baseUrl: 'http://127.0.0.1:8080',
    authToken: 'your-token',
    timeout: 30000,
);
$client = new SkillsClient($config);
```

### Runtime Management

[](#runtime-management)

```
use AgentSkills\RuntimeManager;
use AgentSkills\RuntimeOptions;

$runtime = new RuntimeManager();

// Check if runtime is installed
if (!$runtime->isInstalled()) {
    $runtime->downloadRuntime();
}

// Start runtime
$options = new RuntimeOptions(
    port: 8080,
    detached: true,
);
$runtime->start($options);

// Check status
$status = $runtime->status();
if ($status->running) {
    echo "Runtime version: " . $status->version . "\n";
}

// Stop runtime
$runtime->stop();
```

### List Skills

[](#list-skills)

```
$result = $client->listSkills([
    'limit' => 10,
    'page' => 0,
]);

foreach ($result->skills as $skill) {
    echo $skill->name . " v" . $skill->version . "\n";
}
```

### Search Skills

[](#search-skills)

```
$result = $client->searchSkills([
    'query' => 'python',
    'source' => 'github',
    'limit' => 10,
]);

foreach ($result->results as $skill) {
    echo $skill->full_name . "\n";
    echo $skill->description . "\n";
}
```

### Install Skills

[](#install-skills)

```
use AgentSkills\SkillInstallOptions;

$options = new SkillInstallOptions(
    source: 'https://github.com/user/skill-repo',
    branch: 'main',
);

$result = $client->installSkill($options);

if ($result->isMultiSkillRepo()) {
    // Handle multi-skill repository
    foreach ($result->available_skills as $skill) {
        echo $skill->name . "\n";
    }
} else {
    echo "Installed: " . $result->name . "\n";
}
```

### Execute Skills

[](#execute-skills)

```
// Execute skill
$result = $client->executeSkill('skill-id', [
    'param1' => 'value1',
]);

if ($result->success) {
    echo $result->output . "\n";
} else {
    echo "Error: " . $result->errorMessage . "\n";
}

// Execute specific tool
$result = $client->executeSkillTool('skill-id', 'tool-name', [
    'param1' => 'value1',
]);
```

### Get Skill Information

[](#get-skill-information)

```
$skill = $client->getSkill('skill-id');

echo $skill->name . "\n";
echo $skill->description . "\n";
echo $skill->version . "\n";

foreach ($skill->tools as $tool) {
    echo "Tool: " . $tool->name . "\n";
    echo "  " . $tool->description . "\n";
}
```

### Remove Skills

[](#remove-skills)

```
$result = $client->uninstallSkill('skill-id');

if ($result['success']) {
    echo "Skill removed successfully\n";
}
```

### Skill Configuration

[](#skill-configuration)

```
// Get skill config
$config = $client->getSkillConfig('skill-id');

// Set skill config
$client->setSkillConfig('skill-id', [
    'option1' => 'value1',
]);
```

### Define Skills

[](#define-skills)

```
use AgentSkills\defineSkill;
use AgentSkills\ToolDefinition;
use AgentSkills\ToolParameter;
use AgentSkills\ToolParameterType;

$skill = defineSkill([
    'metadata' => [
        'name' => 'my-skill',
        'version' => '1.0.0',
        'description' => 'My custom skill',
        'author' => 'Your Name',
    ],
    'tools' => [
        new ToolDefinition(
            name: 'my-tool',
            description: 'A tool that does something',
            parameters: [
                new ToolParameter(
                    name: 'input',
                    paramType: ToolParameterType::String,
                    description: 'Input parameter',
                    required: true,
                ),
            ],
        ),
    ],
]);
```

### Configuration

[](#configuration)

The SDK reads configuration from environment variables prefixed with `SKILL_`:

```
use AgentSkills\getConfig;

$config = getConfig();
// Returns array with keys like 'API_URL', 'AUTH_TOKEN', etc.
```

### Error Handling

[](#error-handling)

```
use AgentSkills\handleApiError;
use AgentSkills\ApiError;

try {
    $client->installSkill($options);
} catch (\Exception $e) {
    $error = handleApiError($e);
    echo "Error {$error->errno}: {$error->errmsg}\n";
}
```

AI Model Configuration
----------------------

[](#ai-model-configuration)

Before starting the runtime, you need to configure the AI model API key. The runtime requires an AI model to process skill execution and natural language understanding.

Edit the `.env` file in the runtime directory:

- **Windows**: `%USERPROFILE%\.agentskills-runtime\win-x64\release\.env`
- **macOS/Linux**: `~/.agentskills-runtime/-/release/.env`

Add your AI model configuration (choose one provider):

```
# Option 1: StepFun (阶跃星辰)
MODEL_PROVIDER=stepfun
MODEL_NAME=step-1-8k
STEPFUN_API_KEY=your_stepfun_api_key_here
STEPFUN_BASE_URL=https://api.stepfun.com/v1

# Option 2: DeepSeek
MODEL_PROVIDER=deepseek
MODEL_NAME=deepseek-chat
DEEPSEEK_API_KEY=your_deepseek_api_key_here

# Option 3: 华为云 MaaS
MODEL_PROVIDER=maas
MAAS_API_KEY=your_maas_api_key_here
MAAS_BASE_URL=https://api.modelarts-maas.com/v2
MAAS_MODEL_NAME=qwen3-coder-480b-a35b-instruct

# Option 4: Sophnet
MODEL_PROVIDER=sophnet
SOPHNET_API_KEY=your_sophnet_api_key_here
SOPHNET_BASE_URL=https://www.sophnet.com/api/open-apis/v1
```

> **Note**: Without proper AI model configuration, the runtime will fail to start with an error like "Get env variable XXX\_API\_KEY error."

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Composer 2.0 or higher
- Extensions: json, phar, zip

Development
-----------

[](#development)

### Run Tests

[](#run-tests)

```
composer test
```

### Code Analysis

[](#code-analysis)

```
composer analyze
```

### Code Style

[](#code-style)

```
composer cs-check
composer cs-fix
```

### Run All Checks

[](#run-all-checks)

```
composer check
```

Documentation
-------------

[](#documentation)

- [中文文档](README_cn.md)
- [API Documentation](https://github.com/UCTooCom/agentskills-runtime/wiki)
- [Packagist](https://packagist.org/packages/opencangjie/skills)

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

[](#contributing)

Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for details.

License
-------

[](#license)

MIT License - see [LICENSE](LICENSE) file for details.

Support
-------

[](#support)

- **GitHub**:
- **AtomGit**:
- **Issues**:
- **Packagist**:

Related Projects
----------------

[](#related-projects)

- [JavaScript SDK](../javascript/)
- [Python SDK](../python/)
- [Java SDK](../java/)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance58

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a8935647660790121987ec32c64b0c43f8ca1988a7a0a7d29f613681a165ca5?d=identicon)[uctoo](/maintainers/uctoo)

---

Top Contributors

[![UCTooCom](https://avatars.githubusercontent.com/u/261841032?v=4)](https://github.com/UCTooCom "UCTooCom (6 commits)")

### Embed Badge

![Health badge](/badges/opencangjie-skills/health.svg)

```
[![Health](https://phpackages.com/badges/opencangjie-skills/health.svg)](https://phpackages.com/packages/opencangjie-skills)
```

PHPackages © 2026

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