Skip to main content

dbtcopy

Compile a dbt model and copy the clean SQL to your clipboard — no log noise, no thread counts, no adapter info.

dbt compile dumps a wall of logs to stdout, making it painful to grab just the SQL. dbtcopy runs the compile for you, reads the clean output from target/compiled/, and copies it straight to your clipboard.

Install

pip install dbtcopy

Requires Python 3.9+ and dbt already installed in your environment.

Usage

# Basic — compile and copy to clipboard
dbtcopy my_model

# With dbt target
dbtcopy my_model --target=prod

# With full-refresh
dbtcopy my_model --target=prod --full-refresh

# With dbt vars
dbtcopy my_model --target=prod --vars '{"start_date": "2024-01-01"}'

# Print to stdout instead of clipboard
dbtcopy my_model --print

# Copy AND print
dbtcopy my_model --print-and-copy

# Hide dbt compile output
dbtcopy my_model --quiet

# Skip compile, just grab existing compiled SQL
dbtcopy my_model --no-compile

# Specify dbt project/profiles directory
dbtcopy my_model --project-dir /path/to/project --profiles-dir /path/to/profiles

All arguments after the model name are passed directly to dbt compile.

How it works

  1. Runs dbt compile --select <model> (output shown by default, use --quiet to hide)
  2. Finds <model>.sql in target/compiled/ recursively
  3. Reads the file and copies the contents to your clipboard
  4. Prints a confirmation: Copied 42 lines to clipboard (target/compiled/.../model.sql)
  5. On compile failure, shows the actual dbt error message

Platform support

Clipboard works on:

  • macOS — pbcopy
  • Linux (X11) — xclip
  • Linux (Wayland) — wl-copy
  • WSL / Windows — clip.exe

If no clipboard tool is found, the SQL is printed to stdout as a fallback.

License

MIT

Metadata

Release files for dbtcopy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbtcopy 0.1.0
File Size Uploaded
dbtcopy-0.1.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbtcopy 0.1.0
File Interpreter ABI Platform
dbtcopy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / dbtcopy-0.1.0.tar.gz

Download URL dbtcopy-0.1.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f78015e772b0f942f0e25bf6ba3b16313976c3e028f450af62edebfbb2c0018e
BLAKE2b-256 checksum
How to use checksums
f7a9834404848dcf52c76f63fd041ce30da68c12a76f83f115eb7aa56862f007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release files / dbtcopy-0.1.0-py3-none-any.whl

Download URL dbtcopy-0.1.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6c676de8eb8772e7e2ec1a9836376fdd3ea1ecaaf6229298b1f9331a5d6685a
BLAKE2b-256 checksum
How to use checksums
d6793dfad4e30972c924db8c2d5a4a8ecf271fb4c6f8fc63b782012d1bb1e77e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page