dbt-completion.bash icon indicating copy to clipboard operation
dbt-completion.bash copied to clipboard

Bash Completion in Docker Container

Open ghost opened this issue 1 year ago • 1 comments

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?

ghost avatar Oct 16 '24 08:10 ghost

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.

b-per avatar Oct 16 '24 10:10 b-per