mirror of
https://github.com/penpot/penpot.git
synced 2026-09-24 12:56:15 +00:00
Remove the legacy @opencode-ai/plugin import and V1 server export so the local plugin loads under OpenCode V2 without project dependencies. Add a focused smoke test for the V2 export and tool registration, and update the related script memories. AI-assisted-by: space-bunny-free
1.1 KiB
1.1 KiB
Psql
scripts/psql is a wrapper around psql that connects to the Penpot PostgreSQL
database using environment variables (PENPOT_DB_HOST, PENPOT_DB_USER,
PENPOT_DB_PASSWORD, PENPOT_DB_NAME) with sensible defaults for local
development.
When to use
- Running ad-hoc SQL queries against the Penpot database.
- Inspecting schema, migrations, or data during development or debugging.
How to use (CLI)
# Default connection (penpot db, localhost)
scripts/psql -c "SELECT version();"
# Test database
scripts/psql --test -c "SELECT * FROM migrations;"
# Custom host/user/database
scripts/psql --host myhost --user myuser --db mydb
scripts/psql must be invoked from the repo root so the path resolves.
Native Tool Available (OpenCode V2)
A native OpenCode V2 tool penpot-psql is available. It is defined in
.opencode/plugins/penpot.js and registered through setup(). The LLM can
call it directly with:
sql: SQL command string to executetest: Boolean flag to use thepenpot_testdatabase
Example usage by the LLM:
penpot-psql(sql="SELECT version();")
penpot-psql(sql="SELECT * FROM migrations;", test=true)