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

Experimental autocompletion setup scripts #378

Merged
merged 10 commits into from
Sep 13, 2022
Merged

Conversation

brentyi
Copy link
Collaborator

@brentyi brentyi commented Sep 9, 2022

Prototype for some thoughts @tancik

The tldr is that running:

python scripts/completions/configure.py install

Will (1) generate a completion script for every dcargs CLI in the nerfactory/scripts directory, and then (2) add a one-line update to the user's .bashrc and/or .zshrc (after asking for permission).

The next shell they open should have completion enabled; I think this should just magically work, but haven't tested very thoroughly.

Misc notes:

  • If the source code is changed (eg a field in the config object is renamed), the completion install script needs to be re-run to synchronize changes. Not sure if there are any great ways around this.
  • The nerfactory CLI is pretty expansive and exposed some bugs in an upstream autocomplete library. I submitted PRs (1, 2) that'll need to be merged before everything works. (or if they don't respond I can figure it out in dcargs)

@brentyi brentyi force-pushed the feat/completion_scripts branch from 3559b73 to 45c1107 Compare September 9, 2022 15:50
@tancik
Copy link
Contributor

tancik commented Sep 9, 2022

Oh sweet! This seems like the easiest way to install autocomplete, I like it!
One request: can you add blurb in the readme/docs about how to install (and that it needs to be rerun)

Also down the line we can consider adding a FYI blurb at the beginning of training with the command if the install is not detected. Figuring out how to make this robust may need a bit of thinking.

The nerfactory CLI is pretty expansive and exposed some bugs in an upstream autocomplete library.

Lol

@brentyi brentyi force-pushed the feat/completion_scripts branch from 45c1107 to 476b2db Compare September 9, 2022 18:45
return True


def _exclamation() -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

@brentyi brentyi force-pushed the feat/completion_scripts branch from a56d8ed to f272ec2 Compare September 13, 2022 18:54
@brentyi brentyi changed the title [WIP] Autocompletion setup scripts Experimental autocompletion setup scripts Sep 13, 2022
@brentyi brentyi merged commit 86a805c into master Sep 13, 2022
@brentyi brentyi deleted the feat/completion_scripts branch September 13, 2022 19:44
chris838 pushed a commit to chris838/nerfstudio that referenced this pull request Apr 22, 2023
* Working completion scripts

* generate.py => install.py

* Uninstall for completions, docs/README updates

* Tune emojis, improve concurrency for completion install

* wip

* Cleanup

* Permissions, shebang checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants