Logo Sealos Database

Sealos Database

Tổ chức
labring
sealos-database

Provision, connect, and operate Sealos Cloud databases through sealos-cli for local development, Devbox development, and app setup. Use when the user needs a cloud database for a project, asks to create or connect PostgreSQL/MySQL/MongoDB/Redis or another Sealos database, wants DATABASE_URL or similar env vars wired into a dev environment, needs database connection details, backups, logs, public access, or wants to replace local Docker Compose databases with a managed Sealos database.

Tổng quan

Nhà phát hànhlabring
Kho mãsealos-skills
Tên kỹ năngsealos-database
Sao
80
Bản fork
19
Tệp đi kèm
5
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được labring công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Sealos Database trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/labring/sealos-skills/tree/main/skills/sealos-database
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/labring/sealos-skills.git /tmp/sealos-skills
mkdir -p .claude/skills
cp -r /tmp/sealos-skills/skills/sealos-database .claude/skills/sealos-database
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Sealos Database trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Sealos Database ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Sealos Database với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Sealos Database

Identity and Discovery

  • Owner: sealos-database (/sealos-database and database create, connect, backup, logs, or access requests).
  • Class: cloud-local-mutation through sealos-cli, with an optional redacted handoff to deployment.
  • Canaries: DB-REUSE-ENV, DB-CONFIRM-PUBLIC, and DB-REDACT-CONNECT.

Scope and Boundaries

Accept a project path and database intent. Analyze first, list existing databases, create or reuse the selected type, and wire only the existing application env key. Preserve prior env values and local Compose rollback; private access is the default. Database deletion, public access, backup deletion, restore collisions, and disabling active access remain gated operations.

Risk and Confirmation

Never print passwords, full connection strings, kubeconfig, auth files, or copied env values. Ask before public access or destructive operations and state the private alternative. Parse JSON CLI output and keep the selected workspace, namespace, database, and env mutation scoped to the request.

Lifecycle Workflow

For each request, resolve the project, analyze its database need, confirm CLI/auth/region/workspace, list before create/reuse, fetch connection details, wire the existing env key, and verify connectivity or migrations. Emit request-scoped success, stopped, or error; the existing analyzer-first workflow remains the domain extension below. Workspace ambiguity, an unavailable credential response, or a tracked env target stops the request before mutation.

Request Contract

yaml
input:
  project: local path or repository source
  intent: database type, purpose, and create-or-reuse preference
  access: private by default; public only after confirmation
preconditions:
  - analyzer evidence names the database signal and env key
  - sealos-cli/auth/region/workspace are resolved
  - the selected env file is ignored and the key is known

The ordered action is analyze -> resolve account/workspace -> list -> create or reuse -> wait -> fetch -> wire -> verify. The selected workspace, namespace, database identity, and env mutation remain request-scoped.

Progressive Disclosure

Load the analyzer, CLI, env-wiring, and connectivity procedures one level deep when their phase is reached. Keep credential-handling and public/destructive confirmation visible here even when detailed commands live in owned scripts or references.

Output, Stop, and Error States

  • success: database identity/status, region/workspace, env file and key names, redacted connectivity or migration evidence, confirmation state, and any follow-up access state.
  • stopped: ambiguous workspace, unavailable credential readiness, tracked env target, public/destructive confirmation boundary, or missing precondition with the safe next action; no gated mutation is claimed.
  • error: analyzer, CLI, connection, or env-write step, sanitized diagnostic category, affected artifact, and recovery action with passwords, URLs, auth values, and complete connection strings redacted.

Handoffs

An optional deployment handoff uses the complete tuple below. The receiver re-checks deployment scope and runtime evidence.

yaml
target: sealos-deploy
inputArtifact: redacted database identity, private-access status, approved env-key contract, and connectivity/migration evidence
allowedAction: consume approved Secret/env references within the selected deployment scope
failureReturn: sanitized analyzer, CLI, env, or connectivity diagnostic with the failed phase
responseOwner: sealos-database

Direct database requests use target: none and keep the same evidence fields.

Verification

Use analyze-project-database.mjs, sealos-cli JSON output, app migration/connectivity evidence, and baseline cases database-positive-reuse-redacted-connectivity and database-violating-unconfirmed-public-or-destructive. Verify env preservation and redaction before accepting success.

Use this skill to give a project a real Sealos Cloud database during development. The default outcome is: identify the app's database need, create or reuse a Sealos database with sealos-cli, fetch connection details, wire only the needed local env vars, and verify the app can connect.

Safety Rules

  1. Never print database passwords or full connection strings in the final answer.
  2. Do not overwrite an existing env value without confirming or preserving the old value.
  3. Do not commit .env, .env.local, connection strings, passwords, kubeconfig, or Sealos auth files.
  4. Ask before enabling public database access. Prefer private connections when the app runs inside Sealos/Devbox.
  5. Ask before destructive operations: database delete, backup-delete, restoring over a name that may collide, or disabling access that an active app depends on.
  6. Use JSON output from sealos-cli by default and parse it instead of scraping table output.

Workflow

1. Resolve the target project

Confirm the working directory with pwd or git rev-parse --show-toplevel.

Run the analyzer when a project directory is available:

bash
node <SKILL_DIR>/scripts/analyze-project-database.mjs <project-dir>

Use the analyzer result as a starting point, then inspect the real files it cites before editing anything. It intentionally avoids printing secret values.

2. Check sealos-cli

Prefer an existing sealos-cli binary:

bash
sealos-cli --version
sealos-cli database --help
sealos-cli whoami

If it is not installed, use npx -y sealos-cli@latest ... for one-off commands. Ask before installing it globally.

If auth is missing or expired, run:

bash
sealos-cli login <region>
sealos-cli workspace list
sealos-cli workspace current

Use the workspace the user expects. If multiple workspaces exist and the target is ambiguous, ask before provisioning.

3. Choose create or reuse

List existing databases first:

bash
sealos-cli database list -o json

Reuse an existing database when the name, type, and purpose match. Create a new one when the project has no suitable database or the user asks for a fresh dev database.

Use conservative development defaults unless the project clearly needs more:

bash
sealos-cli database create postgresql --name <app-dev-db> --cpu 1 --memory 1 --storage 3 --replicas 1 -o json

Before creating, check supported versions if version choice matters:

bash
sealos-cli database versions --type postgresql -o json

Supported CLI database types include postgresql, mongodb, mysql, apecloud-mysql, redis, kafka, qdrant, nebula, weaviate, milvus, pulsar, and clickhouse. Use the type detected from the project; default to postgresql only when the project has no database-specific signals.

4. Wait for readiness and fetch connection data

Poll details until the database is running or connection data is present:

bash
sealos-cli database get <name> -o json
sealos-cli database connection <name> -o json

Read references/sealos-cli-database.md for the current command contract and response handling.

5. Wire the development environment

Map the connection into the env var the project already uses:

Project signalPreferred env key
Prisma, Drizzle, TypeORM, generic PostgresDATABASE_URL
MySQL app with existing MySQL-specific configDATABASE_URL or existing MYSQL_URL
MongoDB appMONGODB_URI
Redis cache/queueREDIS_URL

Use the existing local env convention:

  1. Prefer .env.local for Next.js and frontend-adjacent projects.
  2. Prefer .env only when the repo already uses it for local development and it is gitignored.
  3. Treat .env.example as documentation only; never write real secrets there.
  4. Preserve comments and unrelated keys.

If a connection string is not directly returned in the desired form, compose it from host, port, username, and password fields from sealos-cli database connection.

6. Verify application connectivity

Run the project's normal verification path, not just the CLI command:

  1. Run migrations or introspection if the project has a clear command (prisma migrate, drizzle-kit migrate, db:migrate, db:push).
  2. Start the app or run the smallest test that opens a DB connection.
  3. If the app runs outside Sealos and cannot reach the private endpoint, ask before enabling public access:
bash
sealos-cli database enable-public <name> -o json
sealos-cli database connection <name> -o json

Disable public access after testing if it is no longer needed:

bash
sealos-cli database disable-public <name> -o json

7. Report the result

Summarize:

  1. Database name, type, region/workspace, and status.
  2. Env file and key updated, without revealing the secret value.
  3. Verification command and outcome.
  4. Any public access state and follow-up action.

Common Tasks

Connect an existing project to a Sealos database

  1. Run the analyzer.
  2. Inspect the env/config files it cites.
  3. List existing Sealos databases.
  4. Create or reuse the matching database.
  5. Fetch connection details.
  6. Write the expected env key.
  7. Run the app's DB verification.

Replace a local Compose database for development

  1. Identify the app service env vars that point at postgres, mysql, mongo, or redis compose services.
  2. Provision the equivalent Sealos database.
  3. Update only the app's local env file, not the compose file, unless the user asks to remove the local service.
  4. Keep local Compose rollback simple: the original compose service remains available.

Add a database to a Devbox workflow

  1. Use private database connection details when the Devbox runs in the same Sealos workspace.
  2. Write env vars into the Devbox/app environment expected by the repo.
  3. Restart or reload the Devbox process only after env vars are in place.

References

  • scripts/analyze-project-database.mjs - read-only project database intent analyzer.
  • references/sealos-cli-database.md - sealos-cli database command contract.
  • references/env-integration.md - safe env-file editing and connection-string mapping.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Sealos Database làm được gì?

Provision, connect, and operate Sealos Cloud databases through sealos-cli for local development, Devbox development, and app setup. Use when the user needs a cloud database for a project, asks to create or connect PostgreSQL/MySQL/MongoDB/Redis or another Sealos database, wants DATABASE_URL or similar env vars wired into a dev environment, needs database connection details, backups, logs, public access, or wants to replace local Docker Compose databases with a managed Sealos database.

Vì sao nên dùng Sealos Database trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Sealos Database là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Sealos Database trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/labring/sealos-skills/tree/main/skills/sealos-database. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Sealos Database?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Sealos Database với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Sealos Database với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Sealos Database có miễn phí không?

Kỹ năng này được labring phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇