Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2873] [Feature] dbt init should create project in current dir (.) instead of creating a new dir #8216

Open
3 tasks done
dataders opened this issue Jul 26, 2023 · 5 comments · May be fixed by #9268
Open
3 tasks done
Labels
enhancement New feature or request file_system How dbt-core interoperates with file systems to read/write data paper_cut A small change that impacts lots of users in their day-to-day

Comments

@dataders
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

TL;DR: I want dbt init to behave like git init and by default work within the current directory rather than make a new directory.

from the git init (docs page):

If the $GIT_DIR environment variable is set then it specifies a path to use instead of ./.git for the base of the repository.

Describe alternatives you've considered

  • a command-line flag to override this directory-creation step?
  • guidance that users should follow explicitly these steps in order:
    • dbt init
    • cd my_new_dbt_proj_dir
    • git init

Who will this benefit?

those who need to quickly make standalone project examples and sync them to GitHub

Are you interested in contributing this feature?

yes

Anything else?

I noticed that the dbt init docs are missing information that's provided in the CLI via dbt init -h

@dataders dataders added enhancement New feature or request triage labels Jul 26, 2023
@github-actions github-actions bot changed the title [Feature] dbt init should create project in current dir (.) instead of creating a new dir [CT-2873] [Feature] dbt init should create project in current dir (.) instead of creating a new dir Jul 26, 2023
@dbeatty10
Copy link
Contributor

Agreed -- I always expected dbt init to use the current working directory as you described with git init.

But since this is such long-standing behavior, I think we'd need to use one of the alternatives you mentioned instead:

  • a command-line flag to override this directory-creation step?
  • guidance that users should follow explicitly these steps in order:
    • dbt init
    • cd my_new_dbt_proj_dir
    • git init

Maybe a global config option named INIT_DIR (so that it can get included in the global profiles.yml) along with DBT_INIT_DIR environment variable and --init-dir CLI flag?

I noticed that the dbt init docs are missing information that's provided in the CLI via dbt init -h

Would you mind opening an issue (or a PR) in docs.getdbt.com?

@github-actions
Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Oct 26, 2023
Copy link
Contributor

github-actions bot commented Nov 2, 2023

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2023
Copy link
Contributor

github-actions bot commented Nov 2, 2023

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@dbeatty10 dbeatty10 removed the stale Issues that have gone stale label Nov 2, 2023
@dbeatty10 dbeatty10 reopened this Nov 2, 2023
@jtcohen6
Copy link
Contributor

jtcohen6 commented Dec 3, 2023

@dataders @dbeatty10 I agree; I think we should modify this behavior. This issue has come up several times over the years:

Unfortunately, it doesn't really make sense to set as a flag / global config (which are moving to dbt_project.yml: #9183), because by definition the dbt_project.yml file doesn't exist yet!

So I think we just need to change it for good, and document that achieving the previous behavior will require running:

$ mkdir <projectname>
$ cd <projectname>
$ dbt init

@jtcohen6 jtcohen6 added paper_cut A small change that impacts lots of users in their day-to-day file_system How dbt-core interoperates with file systems to read/write data and removed triage labels Dec 3, 2023
@lllong33 lllong33 linked a pull request Dec 11, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request file_system How dbt-core interoperates with file systems to read/write data paper_cut A small change that impacts lots of users in their day-to-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants