dbt-labs / dbt-completion.bash

Adds autocompletion to the dbt CLI
https://www.getdbt.com/
Apache License 2.0
114 stars 29 forks source link

Bash Completion in Docker Container #26

Open nstein-gpjoule opened 1 day ago

nstein-gpjoule commented 1 day ago

I'm trying to setup a VSCode dev container with dbt and dbt-bash-completion But I can't get it working.

You can reproduce it by running: docker run -it --rm python:3.13-slim bash

And inside the docker container:

apt update
apt install curl
pip install dbt-core
curl https://raw.githubusercontent.com/fishtown-analytics/dbt-completion.bash/master/dbt-completion.bash > ~/.dbt-completion.bash
source ~/.dbt-completion.bash

When double tabbing it will just do nothing.

I made sure that bash-completion works by installing:

apt install bash-completion -y
$ dd 
--help     --version  bs=        cbs=       conv=      count=     ibs=       if=        iflag=     obs=       of=        oflag=     seek=      skip=      status=

Or am I missing something obvious?

b-per commented 1 day ago

The bash completion has much less features than the zsh one. It doesn't provide parameters completion for example.

For bash, we are only adding model names, so you would need to be at the root of your folder and have the manifest.json already generated.

Then, you can do dbt run --select <TAB> and you should see the list of models to run.