Skip to content
This repository was archived by the owner on May 30, 2022. It is now read-only.
This repository was archived by the owner on May 30, 2022. It is now read-only.

Dynamic values for command arguments & auto suggestions #14

@docent-net

Description

@docent-net

I've been looking for a way to dynamically fetch values into command argument values in interactive mode (could also work for non - interactive via shell completion).

For instance having:

@command(name_or_function="aws")
class AWS:
    @command
    @argument("profile", positional=True)
    @argument("host", positional=True)
    def ssh(self, profile: str, host: str):

I'd like user working in interactive mode have auto - suggestion while entering host value. This auto suggestion could be an async call to some defined method which basically fetches required data.

In practice I'm looking for a way to fetch AWS instance names and autocomplete user input so he/she may choose where he wants to ssh.

I know how it's done in aws-shell via python-prompt-toolkit auto suggestion feature. However before I try to mimic that behavior I wanted to ask you if you already have some thoughts about it.

Thanks,
Maciek

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions