-
Notifications
You must be signed in to change notification settings - Fork 251
cli: dlt ai IDE setup
command added
#2503
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
base: devel
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for dlt-hub-docs canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command is good and well structured. but at the end @adrianbr needs to give it a test run.
there's one thing I'd change: please re-use the code that clones verified sources and take files from there. we have a place for it
https://github.com/dlt-hub/verified-sources/tree/master/init
right now it is not used (we moved init template to core code) so you can wipe it out and place the files there.
AFAIK @adrianbr also plans to put a few docs files that may be common to all editors. we'll know soon
@rudolfix If I understand, you suggest placing Questions:
|
@zilto my goal here is to let @adrianbr and @AstrakhantsevaAA to quickly iterate the rules without re-releasing our library. we did that with Answers:
version
the idea was that verified sources is way smaller to clone locally and making PRs is easier. is it really like this? for init scripts it definitely was (there was just simple linting that checked if dlt command will run for all possible init variants) backward compat: we planned to use version tags to pull always the right version of verified sources. but ultimately such strict biding was never necessary. sill users can pass their own location and branch to init command so they can run their own repos with their private code
I meant code that clones the verified source repo into know location. it is in tldr;> see first sentence of my comment. |
dlt/cli/ai_command.py
Outdated
""" | ||
specs = IDE_RULES_SPECS[ide] | ||
|
||
src_storage = FileStorage(str(Path(dlt.__file__).parent.joinpath(RULES_TEMPLATE_RELATIVE_PATH))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd go for something way dumber. you have
- /ai folder
- it has subfolders with names of the editors
- those subfolders contains files to copy into
run_dir
the command looks if it has a subfolder with editor name and copies all the files
this way you can add and remove editors, add more files etc. without changes in the code. WDYT?
OFC you should not overwrite existing files.
dlt/cli/ai_command.py
Outdated
|
||
|
||
def mcp_command() -> None: | ||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be cool. questions:
- should we integrate it into cli that actually runs mcp? for example
dlt mcp info
would show it? - should support both stdio and sse (with port) to make stuff easier?
a very top thing would be to somehow be aware of which editor is set up and display info for it without asking for a type
dlt/cli/plugins.py
Outdated
# ai_mcp_cmd = ai_subparsers.add_parser("mcp", help="Launch the dlt MCP server") | ||
|
||
def execute(self, args: argparse.Namespace) -> None: | ||
ai_setup_command_wrapper(args.ide) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check if project is initialized already? ie. if .dlt
folder exists (you check if run_context.settings exist)
See this PR dlt-hub/verified-sources#608 for related files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! is there a branch with the content in verified sources already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really good. we still miss documentation.
- actually command line reference autogenerates from
argparse
so we may put more info there - maybe we could tell people how to add or fix the rules using verified sources?
This new CLI command allows to generate "rules files" for the user's project according to IDE-specific specs. This follows similar logic as
dlt init
command for core sources.Design choices
dlt ai IDE setup
was used, but it could bedlt ai setup IDE
TODO