Compile a dbt model and copy the clean SQL to your clipboard
Project description
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
- Runs
dbt compile --select <model>(output shown by default, use--quietto hide) - Finds
<model>.sqlintarget/compiled/recursively - Reads the file and copies the contents to your clipboard
- Prints a confirmation:
Copied 42 lines to clipboard (target/compiled/.../model.sql) - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbtcopy-0.1.0.tar.gz.
File metadata
- Download URL: dbtcopy-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f78015e772b0f942f0e25bf6ba3b16313976c3e028f450af62edebfbb2c0018e
|
|
| MD5 |
224c70c90c8b30a6671b7f44d7b552dc
|
|
| BLAKE2b-256 |
f7a9834404848dcf52c76f63fd041ce30da68c12a76f83f115eb7aa56862f007
|
Provenance
The following attestation bundles were made for dbtcopy-0.1.0.tar.gz:
Publisher:
publish.yml on Tomiwa-dev/dbtcopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbtcopy-0.1.0.tar.gz -
Subject digest:
f78015e772b0f942f0e25bf6ba3b16313976c3e028f450af62edebfbb2c0018e - Sigstore transparency entry: 1183061007
- Sigstore integration time:
-
Permalink:
Tomiwa-dev/dbtcopy@9771fcc548d0a6984bcbe5202f23681198eb24a2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Tomiwa-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9771fcc548d0a6984bcbe5202f23681198eb24a2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dbtcopy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dbtcopy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6c676de8eb8772e7e2ec1a9836376fdd3ea1ecaaf6229298b1f9331a5d6685a
|
|
| MD5 |
b065cf05acc77f7c8dd3c4faf4438f6e
|
|
| BLAKE2b-256 |
d6793dfad4e30972c924db8c2d5a4a8ecf271fb4c6f8fc63b782012d1bb1e77e
|
Provenance
The following attestation bundles were made for dbtcopy-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Tomiwa-dev/dbtcopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbtcopy-0.1.0-py3-none-any.whl -
Subject digest:
f6c676de8eb8772e7e2ec1a9836376fdd3ea1ecaaf6229298b1f9331a5d6685a - Sigstore transparency entry: 1183061037
- Sigstore integration time:
-
Permalink:
Tomiwa-dev/dbtcopy@9771fcc548d0a6984bcbe5202f23681198eb24a2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Tomiwa-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9771fcc548d0a6984bcbe5202f23681198eb24a2 -
Trigger Event:
release
-
Statement type: