con un clic
prepare-deployment
// Prepare production credentials and destinations for dltHub Platform. Use when setting up prod profile secrets, splitting dev/prod credentials, or configuring a production destination like Motherduck.
// Prepare production credentials and destinations for dltHub Platform. Use when setting up prod profile secrets, splitting dev/prod credentials, or configuring a production destination like Motherduck.
ALWAYS read and follow this skill before acting. Data quality conventions
ALWAYS read and follow this skill before acting. Data quality workflow
Deploy dlt pipelines to dltHub Platform. Use when the user says "deploy to dltHub", "launch on dltHub", "run on dltHub", "schedule pipeline", or wants to deploy a pipeline or notebook to dltHub.
ALWAYS read and follow this skill before acting. Profiles
ALWAYS read and follow this skill before acting. Deploy to dltHub Platform
ALWAYS read and follow this skill before acting. Filesystem pipeline workflow
| name | prepare-deployment |
| description | Prepare production credentials and destinations for dltHub Platform. Use when setting up prod profile secrets, splitting dev/prod credentials, or configuring a production destination like Motherduck. |
Set up profile-scoped credentials and production destinations so the runtime can run pipelines with the right config.
Reference: https://dlthub.com/docs/hub/core-concepts/profiles-dlthub.md
.dlt/ config structureRun ls .dlt/*.toml to see which files exist:
.dlt/
├── config.toml # Workspace config (all profiles)
├── secrets.toml # Workspace secrets (all profiles, gitignored)
├── .workspace # Enable profiles and runtime CLI
Per-profile files may exist. You will create some of them below:
├── dev.config.toml # Dev-only config
├── dev.secrets.toml # Dev-only secrets (gitignored)
├── prod.config.toml # Production config
├── prod.secrets.toml # Production secrets (gitignored)
├── access.config.toml # Interactive notebook config
└── access.secrets.toml # Interactive notebook secrets (gitignored)
Use secrets_list, secrets_view_redacted, and secrets_update_fragment MCP tools (or dlthub ai secrets CLI as fallback) — see (setup-secrets) skill for details.
secrets_list to see all secret files. Then secrets_view_redacted (no path) for the unified merged view, or with path to inspect individual files.dev profile file via secrets_update_fragment with path=".dlt/dev.secrets.toml".prod profile secrets via secrets_update_fragment with path=".dlt/prod.secrets.toml" — user should fill in production values for their sources and destinations.secrets_view_redacted (unified view) and per-file with path.Offer to set up a production destination. If user is using duckdb, explain why ingested data will not survive to be visible by notebooks (runtime erases ephemeral storage!).
duckdb — offer to set up Motherduck as the production destination.dlt supports most major warehouses, data lakes and pure filesystems.Our goal here is to keep existing dev destination in dev profile, and configure production destination in prod profile. User will be able to continue development as usual while deploying - with the same code!
Learn the concept of named destinations first:
Recommend to user switching to a named destination:
destination to $name for pipelines being deployed (all scripts — including notebooks)STOP before making changes. Show your plan and get approval from the user.
Skip this step if prod credentials were already configured and verified before this session. Run it when setting up prod credentials for the first time or after changing them.
Read check_destination.py and run it to verify credentials work:
uv run python .claude/skills/prepare-deployment/check_destination.py <profile> <destination> [dataset_name]
Use secrets_view_redacted to see the final unified view across all workspace secret files. Confirm:
__deployment__.py)Reference: deployment-module.md Full Documentation https://raw.githubusercontent.com/dlt-hub/runtime-starter-pack/refs/heads/main/REFERENCE.md
dlthub run <file> directly instead (see Chapter 1 in the starter pack)Find every dlt.pipeline(...).run(...) call site that should run on Runtime. Each one becomes a decorated function. Look for:
if __name__ == "__main__" blocks that create and run a pipeline@run.pipelineWrap each pipeline run in a decorated function. Use from dlt.hub import run:
from dlt.hub import run
@run.pipeline("my_pipeline")
def ingest_data():
pipeline = dlt.pipeline(
pipeline_name="my_pipeline",
destination="warehouse",
dataset_name="my_data",
)
pipeline.run(my_source())
DO NOT add triggers or schedules at this point -- just the bare minimum to register the job. Scheduling is added in the deployment step.
__deployment__.pyfrom my_pipeline import ingest_data)import my_notebook)__all__ listing every name to deploy"""My workspace -- ingest and explore data"""
from my_pipeline import ingest_data
import my_notebook
__all__ = ["ingest_data", "my_notebook"]
dlthub deploy --dry-run -- shows what would be created/updated/archiveddlthub deploy --show-manifest -- dumps full manifest as YAMLEvery deployed job gets a job_ref in jobs.<module>.<function> form:
from my_pipeline import ingest_data -> jobs.my_pipeline.ingest_dataimport my_notebook -> jobs.my_notebookJob names: bare names work when unambiguous. dlthub run ingest_data resolves automatically.
STOP before making changes. Show your plan and get approval from the user.
Tell the user the workspace is ready for deployment — use (deploy-workspace) next.