← 返回 Skills 市场
camelsprout

DuckDB CLI skills

作者 CamelSprout · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
4323
总下载
3
收藏
22
当前安装
1
版本数
在 OpenClaw 中安装
/install duckdb-cli-ai-skills
功能描述
DuckDB CLI specialist for SQL analysis, data processing and file conversion. Use for SQL queries, CSV/Parquet/JSON analysis, database queries, or data conversion. Triggers on "duckdb", "sql", "query", "data analysis", "parquet", "convert data".
使用说明 (SKILL.md)

DuckDB CLI Specialist

Helps with data analysis, SQL queries and file conversion via DuckDB CLI.

Quick Start

Read data files directly with SQL

# CSV
duckdb -c "SELECT * FROM 'data.csv' LIMIT 10"

# Parquet
duckdb -c "SELECT * FROM 'data.parquet'"

# Multiple files with glob
duckdb -c "SELECT * FROM read_parquet('logs/*.parquet')"

# JSON
duckdb -c "SELECT * FROM read_json_auto('data.json')"

Open persistent databases

# Create/open database
duckdb my_database.duckdb

# Read-only mode
duckdb -readonly existing.duckdb

Command Line Arguments

Output formats (as flags)

Flag Format
-csv Comma-separated
-json JSON array
-table ASCII table
-markdown Markdown table
-html HTML table
-line One value per line

Execution arguments

Argument Description
-c COMMAND Run SQL and exit
-f FILENAME Run script from file
-init FILE Use alternative to ~/.duckdbrc
-readonly Open in read-only mode
-echo Show commands before execution
-bail Stop on first error
-header / -noheader Show/hide column headers
-nullvalue TEXT Text for NULL values
-separator SEP Column separator

Data Conversion

CSV to Parquet

duckdb -c "COPY (SELECT * FROM 'input.csv') TO 'output.parquet' (FORMAT PARQUET)"

Parquet to CSV

duckdb -c "COPY (SELECT * FROM 'input.parquet') TO 'output.csv' (HEADER, DELIMITER ',')"

JSON to Parquet

duckdb -c "COPY (SELECT * FROM read_json_auto('input.json')) TO 'output.parquet' (FORMAT PARQUET)"

Convert with filtering

duckdb -c "COPY (SELECT * FROM 'data.csv' WHERE amount > 1000) TO 'filtered.parquet' (FORMAT PARQUET)"

Dot Commands

Schema inspection

Command Description
.tables [pattern] Show tables (with LIKE pattern)
.schema [table] Show CREATE statements
.databases Show attached databases

Output control

Command Description
.mode FORMAT Change output format
.output file Send output to file
.once file Next output to file
.headers on/off Show/hide column headers
.separator COL ROW Set separators

Queries

Command Description
.timer on/off Show execution time
.echo on/off Show commands before execution
.bail on/off Stop on error
.read file.sql Run SQL from file

Editing

Command Description
.edit or \e Open query in external editor
.help [pattern] Show help

Output Formats (18 available)

Data export

  • csv - Comma-separated for spreadsheets
  • tabs - Tab-separated
  • json - JSON array
  • jsonlines - Newline-delimited JSON (streaming)

Readable formats

  • duckbox (default) - Pretty ASCII with unicode box-drawing
  • table - Simple ASCII table
  • markdown - For documentation
  • html - HTML table
  • latex - For academic papers

Specialized

  • insert TABLE - SQL INSERT statements
  • column - Columns with adjustable width
  • line - One value per line
  • list - Pipe-separated
  • trash - Discard output

Keyboard Shortcuts (macOS/Linux)

Navigation

Shortcut Action
Home / End Start/end of line
Ctrl+Left/Right Jump word
Ctrl+A / Ctrl+E Start/end of buffer

History

Shortcut Action
Ctrl+P / Ctrl+N Previous/next command
Ctrl+R Search history
Alt+\x3C / Alt+> First/last in history

Editing

Shortcut Action
Ctrl+W Delete word backward
Alt+D Delete word forward
Alt+U / Alt+L Uppercase/lowercase word
Ctrl+K Delete to end of line

Autocomplete

Shortcut Action
Tab Autocomplete / next suggestion
Shift+Tab Previous suggestion
Esc+Esc Undo autocomplete

Autocomplete

Context-aware autocomplete activated with Tab:

  • Keywords - SQL commands
  • Table names - Database objects
  • Column names - Fields and functions
  • File names - Path completion

Database Operations

Create table from file

CREATE TABLE sales AS SELECT * FROM 'sales_2024.csv';

Insert data

INSERT INTO sales SELECT * FROM 'sales_2025.csv';

Export table

COPY sales TO 'backup.parquet' (FORMAT PARQUET);

Analysis Examples

Quick statistics

SELECT
    COUNT(*) as count,
    AVG(amount) as average,
    SUM(amount) as total
FROM 'transactions.csv';

Grouping

SELECT
    category,
    COUNT(*) as count,
    SUM(amount) as total
FROM 'data.csv'
GROUP BY category
ORDER BY total DESC;

Join on files

SELECT a.*, b.name
FROM 'orders.csv' a
JOIN 'customers.parquet' b ON a.customer_id = b.id;

Describe data

DESCRIBE SELECT * FROM 'data.csv';

Pipe and stdin

# Read from stdin
cat data.csv | duckdb -c "SELECT * FROM read_csv('/dev/stdin')"

# Pipe to another command
duckdb -csv -c "SELECT * FROM 'data.parquet'" | head -20

# Write to stdout
duckdb -c "COPY (SELECT * FROM 'data.csv') TO '/dev/stdout' (FORMAT CSV)"

Configuration

Save common settings in ~/.duckdbrc:

.timer on
.mode duckbox
.maxrows 50
.highlight on

Syntax highlighting colors

.keyword green
.constant yellow
.comment brightblack
.error red

External Editor

Open complex queries in your editor:

.edit

Editor is chosen from: DUCKDB_EDITOREDITORVISUALvi

Safe Mode

Secure mode that restricts file access. When enabled:

  • No external file access
  • Disables .read, .output, .import, .sh etc.
  • Cannot be disabled in the same session

Tips

  • Use LIMIT on large files for quick preview
  • Parquet is faster than CSV for repeated queries
  • read_csv_auto and read_json_auto guess column types
  • Arguments are processed in order (like SQLite CLI)
  • WSL2 may show incorrect memory_limit values on some Ubuntu versions
安全使用建议
This skill appears safe for its purpose as a DuckDB CLI reference. Before installing or using it, remember that DuckDB commands can read local datasets and write output files, so review any SQL, input paths, globs, and output paths before execution. Prefer read-only mode for existing databases and verify guidance against official DuckDB documentation if the unknown source is a concern.
功能分析
Type: OpenClaw Skill Name: duckdb-cli-ai-skills Version: 1.0.0 The skill bundle provides comprehensive documentation and examples for using the `duckdb` CLI tool. While `duckdb` inherently involves file system interactions (reading/writing data files, executing SQL from files) and can invoke external editors, the `SKILL.md` content does not contain any instructions for the AI agent to perform malicious actions such as data exfiltration, unauthorized execution, or prompt injection. The installation instructions in `README.md` are also benign, involving only local file copying, and all external links point to official DuckDB documentation.
能力评估
Purpose & Capability
The skill coherently matches its stated purpose: helping with DuckDB SQL analysis, file reads, and file conversions. Those capabilities can touch local data files, so users should review paths and queries before running them.
Instruction Scope
The instructions are presented as examples and reference material, not as hidden automatic actions. Some examples use globs and write output files, which are appropriate for DuckDB but should remain user-directed.
Install Mechanism
There is no install script or code package; README installation is a manual copy into the Claude skills directory. Metadata lists the source as unknown and no homepage, so provenance is limited even though the artifact itself is simple.
Credentials
No credentials, environment variables, network services, privileged paths, or background services are requested. The undeclared DuckDB binary requirement is a usability/metadata gap rather than suspicious behavior.
Persistence & Privilege
The artifacts do not show autonomous persistence or background execution. The only persistence described is normal user-directed skill installation and optional DuckDB configuration/database files.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install duckdb-cli-ai-skills
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /duckdb-cli-ai-skills 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of DuckDB CLI specialist skill for data analysis and conversion. - Provides concise CLI usage, SQL examples, and command arguments for DuckDB. - Supports SQL queries, CSV/Parquet/JSON analysis, file conversion, and database management from the command line. - Includes quick-start guides, data conversion commands, output format options, and dot command references. - Documents keyboard shortcuts, autocomplete features, analysis patterns, and safe mode usage. - Features configuration and editor integration tips for streamlined workflows.
元数据
Slug duckdb-cli-ai-skills
版本 1.0.0
许可证
累计安装 22
当前安装数 22
历史版本数 1
常见问题

DuckDB CLI skills 是什么?

DuckDB CLI specialist for SQL analysis, data processing and file conversion. Use for SQL queries, CSV/Parquet/JSON analysis, database queries, or data conversion. Triggers on "duckdb", "sql", "query", "data analysis", "parquet", "convert data". 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 4323 次。

如何安装 DuckDB CLI skills?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install duckdb-cli-ai-skills」即可一键安装,无需额外配置。

DuckDB CLI skills 是免费的吗?

是的,DuckDB CLI skills 完全免费(开源免费),可自由下载、安装和使用。

DuckDB CLI skills 支持哪些平台?

DuckDB CLI skills 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 DuckDB CLI skills?

由 CamelSprout(@camelsprout)开发并维护,当前版本 v1.0.0。

💬 留言讨论