-
Notifications
You must be signed in to change notification settings - Fork 284
feat: create standalone CLI for cocoindex #485
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
Conversation
|
Really awesome! Thanks for making this happen! |
badmonster0
left a comment
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.
Another thing I just notice - which will be needed by migrating existing examples - is about loading of the .env files.
Previously they're loaded by examples' main module (under the if __name__ == "__main__": condition), but they're no longer executed when we invoke this standalone CLI.
So I think this standalone CLI may need to be able to load .env file, and we may also add a --env_file flag to allow override (example: flask CLI is doing the similar).
Let me know if you have any other thoughts. Thanks!
|
Nice catch! |
badmonster0
left a comment
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.
Thanks a lot for making it happen! This is a big thing!
|
Thanks for all the help along the way! I've created another PR accounting for the docs' changes to the standalone CLI. |
|
hi @lemorage thank you so much for all your contribution with cocoindex, we love all your contributions and made a section for you on the latest release note https://cocoindex.io/blogs/cocoindex-changelog-2025-05-31/#lemorage |
This is a breaking change, and may resolve #417.
We create a standalone CLI for cocoindex. For compatibility reasons, we mark
main_fnas deprecated. So, users can still use@cocoindex.main_fn()in their programs, but when runningpython main.py cocoindex <command>, the deprecation warning will be shown instead.Now, in the new CLI, we will use
cocoindex <command> [options] --app main.pyto run the CLI program directly.A lot of examples and docs will then be outdated and need to be updated accordingly. I will start on those if all the changes in this PR are confirmed.