-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
feat: add autocomplete feature in cli #1724
base: master
Are you sure you want to change the base?
Conversation
|
/u |
/u |
@AayushSaini101 I don't think this is ths way autocomplete should be done can we run it as part of installation process? |
Sure. Let me check during the installation process |
Awesome feature in my opinion, I am always forgetting commands 😆 |
@@ -163,6 +165,7 @@ | |||
"pretest": "npm run build", | |||
"pretest:coverage": "npm run build", | |||
"posttest": "rimraf ./test.asyncapi-cli", | |||
"postinstall": "node ./scripts/enableAutoComplete.js", |
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.
Does this script runs after packaging as well?
Also what about docker image. Does this still work there?
Same question for chocolatey.
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const shellConfigs = { |
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.
What about their derivatives?
scripts/enableAutoComplete.js
Outdated
}, | ||
fish: { | ||
rcFile: path.join(os.homedir(), '.config', 'fish', 'completions', 'asyncapi.fish'), | ||
detectFile: path.join(os.homedir(), '.config', 'fish', 'config.fish'), |
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.
Detection using $SHELL or some other way would be better. Not everyone has their config like this.
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.
/u |
Based on the discussion on this thread we will only support autocomplete only zshrc and bash only, i will update the pr thanks |
@AayushSaini101 You can take a look at this comment, this solution should work for all shell I believe. |
@Shurtu-gal yes this can work, but to automate all the thing is very complex and with some small changes in the cli commands we need to do changes very much, in this approach, we need to use external binary that is carapace-spec, when i try to download first time, my mac doesn't allow to open directly i cannot able to access it, then i need to change the settings from privacy section of the mac manually then need to configure in the path. If you check this image, we are passing hardcore commands, flags and arguments to the carapace-spec |
|
Proof of working:

Resolves: #1685