question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

argcomplete does not work with aws-vault

See original GitHub issue

I’ve got custom Python script and added argcomplete to it using instructions from https://kislyuk.github.io/argcomplete/. One note - I need to call it using aws-vault cause my script works with Amazon and I need credentials setup before script logic work.

If I call my lptl.py directly autocomplete works:

$ python3 lptl.py --
--ansible-repo-path    --help                 --skip-app-start       --test-slaves-count
--app-version          --servers-list         --test-environment     --test-slaves-ips
--config               --show-test-plan-only  --test-scenario-name   
--debug                --skip-app-deploy      --test-scenario-path

But when I call it with wrapper, it is not, pressing TAB after following command line results to nothing:

$ aws-vault exec shared-test-full -- python3 lptl.py --

Could anybody help solving this issue?

BTW, I use macOS.

P.S.: Also I’ve got virtualenv, don’t know if it affects, but I installed argcomplete both to local and global environments.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Gim6626commented, May 22, 2020

Solved by incapsulating aws-vault call into Python script and passing environment from it to internal aws subprocess calls. Now autocompletion works fine.

0reactions
kislyukcommented, May 22, 2020

argcomplete does not generally work with arbitrary command line wrappers. To understand why, check the section of the documentation describing the protocol (https://kislyuk.github.io/argcomplete/#argcomplete-autocomplete-parser). When you run your command through a wrapper, the wrapper must be aware of the argcomplete protocol (in particular, it must forward fd 8 to the wrapped subprocess). I don’t think it’s possible to make argcomplete work with this utility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command completion - AWS Command Line Interface
For the AWS completer to work successfully, the aws_completer needs to be in your shell's path. The which command can check if the...
Read more >
psread · PyPI
Quick, simple AWS Parameter Store CLI for listing/reading params with tab completion.
Read more >
Auto-complete does not work for user with argcomplete
The auto-completion feature does not seem to work for me. I created a small test script that reproduces the problem on my setup...
Read more >
python3-argcomplete-1.9.3-6.el8.noarch.rpm
Argcomplete provides easy, extensible command line tab completion of arguments for your Python script. It makes two assumptions: * You are using bash...
Read more >
Getting Started — Cloud Custodian documentation
If you have other errors, or for tcsh support, see the argcomplete docs. If you are invoking custodian via the python executable tab...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found