### Start OpenClaw Gateway Source: https://cordys.cn/docs/skills?q= Restart the OpenClaw gateway after installing plugins to ensure they are loaded and functional. This command starts the gateway service. ```bash openclaw gateway start ``` -------------------------------- ### Integration Example: MaxKB Source: https://cordys.cn/docs/mcp_server Step-by-step guide for integrating Cordys CRM MCP Server with MaxKB. ```APIDOC ## Integration Example: MaxKB ### Description This section outlines the steps to integrate the Cordys CRM MCP Server with MaxKB, enabling intelligent orchestration and data interaction. ### Steps 1. **Create or Enter Application**: Start by creating or entering an advanced orchestration type of application in MaxKB. 2. **Add User Inputs**: In the 'Basic Information' section, add two user inputs: `ak` and `sk`. Add two session variables for Cordys CRM's Access Key and Secret Key. 3. **Add Cordys CRM MCP Tool**: Integrate the Cordys CRM MCP tool within MaxKB. 4. **Design Prompt and Tool Logic**: Based on your specific business scenarios, design the prompt and the tool invocation logic. 5. **Add MCP Call Node**: Configure the MCP Server details. ### MCP Server Config Service Configuration ```json { "cordys-crm-mcp-server": { "url": "http://:8082/sse", "transport": "sse", "headers": { "X-Access-Key": "{{global.ak}}", "X-Secret-Key": "{{global.sk}}" } } } ``` **Note**: If using Streamable-HTTP protocol, change `transport` to `streamable_http`. ``` -------------------------------- ### Run Development Server for Web Frontend Source: https://cordys.cn/docs/source_run Starts the Vite development server for the WEB端 (web) project. This command is used for local development and testing of the web interface. Ensure Node.js and dependencies are installed. ```bash cd package/web npm run dev ``` -------------------------------- ### Install Frontend Dependencies Source: https://cordys.cn/docs/source_run Installs all project dependencies using pnpm within the /packages directory. This command is crucial for frontend development and should be run before other frontend build or run commands. ```bash pnpm i -w ``` -------------------------------- ### Run Development Server for Mobile Frontend Source: https://cordys.cn/docs/source_run Starts the Vite development server for the mobile frontend project. This command is used for local development and testing of the mobile interface. Ensure Node.js and dependencies are installed. ```bash cd package/mobile npm run dev ``` -------------------------------- ### Database and Redis Configuration Example Source: https://cordys.cn/docs/source_run Example configuration for database connection (URL, username, password) and Redis caching (host, port, password). Customize IP addresses and database names according to your environment. Ensure Redis session repository type is set to 'indexed' and session timeout is configured. ```properties # ============================== # 数据库连接配置 # ============================== # 数据库连接 URL,请根据实际环境修改 IP 与数据库名称 spring.datasource.url=jdbc:mysql://你的 MySQL IP:3306/cordys-crm?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false # 数据库用户名 spring.datasource.username=root # 数据库密码 spring.datasource.password=CordysCRM@mysql # ============================== # Redis 缓存配置 # ============================== # Redis 服务器地址 spring.data.redis.host=你的 Redis IP # Redis 端口 spring.data.redis.port=6379 # Redis 密码 spring.data.redis.password=CordysCRM@redis # Redis Session 存储方式(indexed 推荐) spring.session.redis.repository-type=indexed # Session 过期时间(单位:秒,示例为 12 小时) spring.session.timeout=43200s ``` -------------------------------- ### Integration Example: TRAE Development Tool Source: https://cordys.cn/docs/mcp_server Guide for configuring and testing Cordys CRM MCP Server integration with the TRAE development tool. ```APIDOC ## Integration Example: TRAE Development Tool ### Description This guide details the configuration of the MCP Server and verification of its usability through the TRAE development tool's agent dialogue. ### Step 1: Configure MCP Server ```json { "cordys-crm-mcp-server": { "url": "http://:8082/sse", "headers": { "X-Access-Key": "ak", "X-Secret-Key": "sk" } } } ``` ### Step 2: Verify Tool Availability via Agent Dialogue Test the MCP Server's functionality by engaging in a dialogue with the agent within the TRAE tool. ``` -------------------------------- ### Install Cordys CRM with Docker Source: https://cordys.cn/docs/installation/online_installtion Run this command to start a new Cordys CRM container. It maps ports and mounts a volume for persistent data. Ensure Docker is installed and meets the version requirements. ```bash docker run -d \ --name cordys-crm \ --restart unless-stopped \ -p 8081:8081 \ -p 8082:8082 \ -v ~/cordys:/opt/cordys \ 1panel/cordys-crm ``` -------------------------------- ### Build Backend Modules Source: https://cordys.cn/docs/source_run Cleans, installs, and builds the backend modules (framework, crm, app) and installs them into the local Maven repository. Ensure JDK 21 and Maven 3.8.6+ are installed. Skips tests and Jenkins-specific Ant tasks. ```bash ./mvnw clean install -DskipTests -DskipAntRunForJenkins --file backend/pom.xml ``` -------------------------------- ### Cordys CRM Database Configuration Example Source: https://cordys.cn/docs/source_run?q= Example configuration for database connection in `cordys-crm.properties`. Ensure to replace placeholder IPs and database names with your actual environment details. ```properties # ============================== # 数据库连接配置 # ============================== # 数据库连接 URL,请根据实际环境修改 IP 与数据库名称 spring.datasource.url=jdbc:mysql://你的 MySQL IP:3306/cordys-crm?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false # 数据库用户名 spring.datasource.username=root # 数据库密码 spring.datasource.password=CordysCRM@mysql ``` -------------------------------- ### Install Cordys CRM Skills using Installation Script Source: https://cordys.cn/docs/skills?q= Alternatively, use this command to install Cordys CRM Skills directly using an installation script. Suitable for users with a Bash environment. ```bash # Directly use the installation script (suitable for users with a Bash environment) curl -fsSL https://raw.githubusercontent.com/1Panel-dev/CordysCRM-skills/main/install.sh | bash ``` -------------------------------- ### Unified Project Build Source: https://cordys.cn/docs/source_run Builds and installs all frontend packages using pnpm. This command ensures that all frontend dependencies and packages are correctly set up before running other frontend commands. ```bash npm run build ``` -------------------------------- ### Example SQL for Opportunity Data Retrieval Source: https://cordys.cn/docs/user_manual/dataease?q= This example SQL query retrieves detailed opportunity information from Cordys CRM, joining multiple tables to include related data such as owner, department, customer, stage, and product types. It also utilizes DataEase parameters for data scope filtering, similar to the key SQL example. ```sql select c.id, c.name as '商机名称', su.name as '负责人', sd.name as '部门', c.amount as '金额', osc.name as '商机阶段', cc.name as '客户名称', IF(sou.enable, '否', '是') as '是否离职', FROM_UNIXTIME(c.create_time / 1000) as '创建时间', FROM_UNIXTIME(c.update_time / 1000) as '更新时间', FROM_UNIXTIME(c.expected_end_time / 1000) as '结束时间', FROM_UNIXTIME(c.actual_end_time / 1000) as '实际结束时间', FROM_UNIXTIME(c.follow_time / 1000) as '跟进时间', ( select REPLACE(REPLACE(REPLACE(JSON_ARRAYAGG(p.name), '"', ''), '[', ''), ']', '') from product p where c.products like concat('%', p.id, '%') ) as '产品类型', ( select f.field_value from opportunity_field f where f.resource_id = c.id and f.field_id = ( select id from sys_module_field smf where smf.internal_key = 'opportunityCode' ) LIMIT 1 ) AS '业务商机编号', ( select option.label from opportunity_field f left join ( SELECT temp.*, smfb.id as field_id from sys_module_field_blob smfb, JSON_TABLE( smfb.prop, '$.options[*]' COLUMNS ( label VARCHAR(255) PATH '$.label', value VARCHAR(50) PATH '$.value' ) ) AS temp ) option on f.field_id = option.field_id and option.value = f.field_value where f.resource_id = c.id and f.field_id = ( select id from sys_module_field smf where smf.internal_key = 'opportunitySource' ) LIMIT 1 ) AS '商机来源' from opportunity c LEFT JOIN sys_organization_user sou on c.owner = sou.user_id LEFT JOIN sys_department sd on sd.id = sou.department_id LEFT JOIN sys_user su on su.id = c.owner LEFT JOIN customer cc on c.customer_id = cc.id LEFT JOIN opportunity_stage_config osc on osc.id = c.stage where c.organization_id = '100001' and ( -- 根据数据权限和部门ID过滤数据 ($DE_PARAM{'$f2cde[OPPORTUNITY_DATA_SCOPE_TYPE]' = 'ALL'} or $DE_PARAM{'$f2cde[账户]' = 'admin'}) or ($DE_PARAM{ '$f2cde[OPPORTUNITY_DATA_SCOPE_TYPE]' = 'DEPT_CUSTOM'} and $DE_PARAM{ sou.department_id in ($f2cde[OPPORTUNITY_DATA_SCOPE_DEPT_ID])}) or ($DE_PARAM{'$f2cde[OPPORTUNITY_DATA_SCOPE_TYPE]'} = 'SELF' and $DE_PARAM{sou.user_id = '$f2cde[账户]'}) or 1=2 ) ``` -------------------------------- ### Example SQL for Comprehensive Opportunity Data Retrieval Source: https://cordys.cn/docs/user_manual/dataease This example SQL query retrieves detailed opportunity information, including related user, department, stage, and customer data. It also dynamically fetches product types and custom field values, applying data scope filtering. Ensure data synchronization between Cordys CRM and DataEase is complete. ```sql -- 示例SQL select c.id, c.name as '商机名称', su.name as '负责人', sd.name as '部门', c.amount as '金额', osc.name as '商机阶段', cc.name as '客户名称', IF(sou.enable, '否', '是') as '是否离职', FROM_UNIXTIME(c.create_time / 1000) as '创建时间', FROM_UNIXTIME(c.update_time / 1000) as '更新时间', FROM_UNIXTIME(c.expected_end_time / 1000) as '结束时间', FROM_UNIXTIME(c.actual_end_time / 1000) as '实际结束时间', FROM_UNIXTIME(c.follow_time / 1000) as '跟进时间', ( select REPLACE(REPLACE(REPLACE(JSON_ARRAYAGG(p.name), '"', ''), '[', ''), ']', '') from product p where c.products like concat('%', p.id, '%') ) as '产品类型', ( select f.field_value from opportunity_field f where f.resource_id = c.id and f.field_id = ( select id from sys_module_field smf where smf.internal_key = 'opportunityCode' ) LIMIT 1 ) AS '业务商机编号', ( select option.label from opportunity_field f left join ( SELECT temp.*, smfb.id as field_id from sys_module_field_blob smfb, JSON_TABLE( smfb.prop, '$.options[*]' COLUMNS ( label VARCHAR(255) PATH '$.label', value VARCHAR(50) PATH '$.value' ) ) AS temp ) option on f.field_id = option.field_id and option.value = f.field_value where f.resource_id = c.id and f.field_id = ( select id from sys_module_field smf where smf.internal_key = 'opportunitySource' ) LIMIT 1 ) AS '商机来源' from opportunity c LEFT JOIN sys_organization_user sou on c.owner = sou.user_id LEFT JOIN sys_department sd on sd.id = sou.department_id LEFT JOIN sys_user su on su.id = c.owner LEFT JOIN customer cc on c.customer_id = cc.id LEFT JOIN opportunity_stage_config osc on osc.id = c.stage where c.organization_id = '100001' and ( -- 根据数据权限和部门ID过滤数据 ($DE_PARAM{'$f2cde[OPPORTUNITY_DATA_SCOPE_TYPE]' = 'ALL'} or $DE_PARAM{'$f2cde[账户]' = 'admin'}) or ($DE_PARAM{ '$f2cde[OPPORTUNITY_DATA_SCOPE_TYPE]' = 'DEPT_CUSTOM'} and $DE_PARAM{ sou.department_id in ($f2cde[OPPORTUNITY_DATA_SCOPE_DEPT_ID])}) or ($DE_PARAM{'$f2cde[OPPORTUNITY_DATA_SCOPE_TYPE]'} = 'SELF' and $DE_PARAM{sou.user_id = '$f2cde[账户]'}) or 1=2 ) ``` -------------------------------- ### Install WeCom Plugin for OpenClaw Source: https://cordys.cn/docs/skills?q= Install the WeCom plugin for OpenClaw to enable integration with WeChat Work. This plugin allows for interactive messaging. ```bash openclaw plugins install @wecom/wecom-openclaw-plugin ``` -------------------------------- ### Install Parent POM Locally Source: https://cordys.cn/docs/source_run Installs the parent POM to the local Maven repository, enabling other sub-projects to access the latest property configurations. Use this command before building other modules. ```bash ./mvnw install -N ``` -------------------------------- ### Install Cordys CRM Skills using Clawdhub Source: https://cordys.cn/docs/skills?q= Use this command to install Cordys CRM Skills via Clawdhub, which automatically handles dependencies and updates. Recommended for ease of use. ```bash # Through Clawdhub installation (recommended, automatically handles dependencies and updates) clawdhub install cordys-crm ``` -------------------------------- ### Cordys CRM MCP Tool Input Schema Example (add_lead) Source: https://cordys.cn/docs/mcp_server?q= This JSON object defines the input schema for the `add_lead` tool within the Cordys CRM MCP Server. It specifies the data types, required fields, and possible enum values for creating a new lead. Clients must adhere to this schema when passing parameters to the tool. ```json { "type" : "object", "properties" : { "公司" : { "type" : "string" }, "负责人" : { "type" : "string" }, "区域" : { "type" : "string", "enum" : [ "东区", "北区", "南区"] }, "所属产品" : { "type" : "array", "items" : { "type" : "string" } }, "线索来源" : { "type" : "string", "enum" : [ "官网下载", "400电话" ] }, "联系人姓名" : { "type" : "string" }, "联系人手机" : { "type" : "string", "description" : "手机号" } }, "required" : [ "公司", "负责人", "区域", "所属产品", "线索来源"] } ``` -------------------------------- ### Configure Cordys CRM Skills Environment Variables Source: https://cordys.cn/docs/skills?q= After installation, create a .env file in the specified directory to configure access keys, secret keys, and your Cordys CRM domain. Ensure you obtain these credentials from your Cordys CRM account. ```dotenv CORDYS_ACCESS_KEY=你的AccessKey CORDYS_SECRET_KEY=你的SecretKey CORDYS_CRM_DOMAIN=https://你的域名 ``` -------------------------------- ### 配置安装参数 Source: https://cordys.cn/docs/installation/offline_installtion 通过修改 install.conf 文件自定义安装路径、端口、数据库及 Redis 连接信息。 ```bash # 基础配置 ## 安装路径, Cordys CRM 配置及数据文件默认将安装在 ${CORDYS_BASE}/cordys 目录下 CORDYS_BASE=/opt ## Cordys CRM 使用的 docker 网络网段信息 CORDYS_DOCKER_SUBNET=172.30.10.0/24 ## 镜像前缀 CORDYS_IMAGE_PREFIX='registry.fit2cloud.com/cordys' ## 镜像相关 CORDYS_IMAGE_NAME=cordys-crm-ce CORDYS_IMAGE_TAG=v1.0.0 ## CORDYS 主程序的 HTTP 服务监听端口 CORDYS_SERVER_PORT=8081 # 数据库配置 ## 是否使用外部数据库 CORDYS_EXTERNAL_MYSQL=false ## 数据库地址 CORDYS_MYSQL_HOST=$(hostname -I|cut -d" " -f 1) ## 数据库端口 CORDYS_MYSQL_PORT=3306 ## 数据库库名 CORDYS_MYSQL_DB=cordys-crm ## 数据库用户名 CORDYS_MYSQL_USER=root ## 数据库密码 CORDYS_MYSQL_PASSWORD=CordysCRM@mysql # Redis 配置 ## 是否使用外部Redis CORDYS_EXTERNAL_REDIS=false ## Redis 端口 CORDYS_REDIS_PORT=6379 ## Redis 密码 CORDYS_REDIS_PASSWORD=CordysCRM@redis ## Redis地址 CORDYS_REDIS_HOST=$(hostname -I|cut -d" " -f 1) #MCP Server CORDYS_MCP_EXTERNAL_SERVER=false CORDYS_MCP_SERVER_PORT=8082 ``` -------------------------------- ### 查看 csctl 命令行工具帮助 Source: https://cordys.cn/docs/installation/cli?q= 通过执行 csctl help 命令查看工具的用法说明和可用命令列表。 ```bash Usage: ./csctl [COMMAND] [ARGS...] ./csctl --help Commands: status 查看 Cordys CRM 服务运行状态 start 启动 Cordys CRM 服务 stop 停止 Cordys CRM 服务 restart 重启 Cordys CRM 服务 reload 重载 Cordys CRM 服务 version 查看 Cordys CRM 版本 uninstall 卸载 Cordys CRM 服务 ``` -------------------------------- ### Build Web Frontend Project Source: https://cordys.cn/docs/source_run Builds the production-ready assets for the WEB端 (web) project using Vite. This command should be executed after development is complete to prepare for deployment. ```bash cd package/web npm run build ``` -------------------------------- ### 离线升级系统 Source: https://cordys.cn/docs/installation/offline_installtion 通过运行新版本的安装脚本进行升级,并使用 csctl 查看服务状态。 ```bash # 进入项目目录 cd cordys-crm-release-v1.x.y-offline # 运行安装脚本 /bin/bash install.sh # 查看 Cordys CRM 状态 csctl status ``` -------------------------------- ### Cordys CRM Redis Cache Configuration Example Source: https://cordys.cn/docs/source_run?q= Example configuration for Redis cache connection in `cordys-crm.properties`. Includes host, port, password, repository type, and session timeout settings. ```properties # ============================== # Redis 缓存配置 # ============================== # Redis 服务器地址 spring.data.redis.host=你的 Redis IP # Redis 端口 spring.data.redis.port=6379 # Redis 密码 spring.data.redis.password=CordysCRM@redis # Redis Session 存储方式(indexed 推荐) spring.session.redis.repository-type=indexed # Session 过期时间(单位:秒,示例为 12 小时) spring.session.timeout=43200s ``` -------------------------------- ### Build Mobile Frontend Project Source: https://cordys.cn/docs/source_run Builds the production-ready assets for the mobile frontend project using Vite. This command should be executed after development is complete to prepare for deployment. ```bash cd package/mobile npm run build ``` -------------------------------- ### Docker Image Pull Error Message Source: https://cordys.cn/docs/installation/faq Example of the error message encountered when the Docker daemon fails to connect to the registry. ```text Unable to find image '1panel/cordys-crm:latest' locally docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'. ``` -------------------------------- ### Run Cordys CRM Docker Container Source: https://cordys.cn/docs/installation/faq?q= Use this command to run the Cordys CRM Docker container. Ensure Docker is installed and configured. ```bash docker run -d \ --name cordys-crm \ --restart unless-stopped \ -p 8081:8081 \ -p 8082:8082 \ -v ~/cordys:/opt/cordys \ 1panel/cordys-crm ``` -------------------------------- ### 解压安装包 Source: https://cordys.cn/docs/installation/offline_installtion 使用 tar 命令解压下载的离线安装包。 ```bash tar -zxvf cordys-crm-v1.0.0-x86_64-offline-installer.tar.gz ``` -------------------------------- ### Nginx 配置反向代理以验证域名归属 Source: https://cordys.cn/docs/user_manual/wecom?q= 当使用 Nginx 反向代理时,此配置可用于直接返回企业微信验证文件的内容,以完成域名归属认证。请确保将 `WW_verify_xxxxx.txt` 和 `Cv9TeWwxxxjAMOak` 替换为实际值。 ```nginx location = /WW_verify_xxxxx.txt { # 企业微信下载的文件名称 add_header Content-Type 'text/html; charset=utf-8'; return 200 'Cv9TeWwxxxjAMOak'; # 该内容为企业微信验证文件中的实际文本 } ``` -------------------------------- ### Pull Cordys CRM Docker Image Source: https://cordys.cn/docs/installation/win?q= Use this command in PowerShell or cmd to download the latest Cordys CRM Docker image. Ensure Docker is installed and running. ```bash docker pull 1panel/cordys-crm:latest ``` -------------------------------- ### Cordys CRM Default Login Credentials Source: https://cordys.cn/docs/installation/online_installtion Default username and password for accessing the Cordys CRM web interface after installation. It is recommended to change these credentials upon first login for security. ```text 用户名:admin 默认密码:CordysCRM ``` -------------------------------- ### 创建外部数据库 Source: https://cordys.cn/docs/installation/offline_installtion 若使用外部 MySQL 数据库,需预先执行 SQL 创建对应的数据库。 ```sql CREATE DATABASE `cordys-crm` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; ``` -------------------------------- ### Run Cordys CRM Docker Container Source: https://cordys.cn/docs/installation/win?q= Execute this command to start a Cordys CRM container in detached mode. It maps ports 8081 and 8082 and mounts a local volume for data persistence. The container will automatically restart unless stopped. ```bash docker run -d --name cordys-crm --restart unless-stopped -p 8081:8081 -p 8082:8082 -v ~/cordys:/opt/cordys 1panel/cordys-crm ``` -------------------------------- ### TRAE Integration: Cordys CRM MCP Server Configuration Source: https://cordys.cn/docs/mcp_server?q= This is the initial configuration for the Cordys CRM MCP Server when integrating with the TRAE development tool. It specifies the server URL and requires the `X-Access-Key` and `X-Secret-Key` headers. This setup is for the initial connection; further validation is done via the Agent. ```json { "cordys-crm-mcp-server": { "url": "http://:8082/sse", "headers": { "X-Access-Key": "ak", "X-Secret-Key": "sk" } } } ```