Skip to content

Thoughts on stdin for interactive prompts? #3

@ericclemmons

Description

@ericclemmons

This is a really cool project!

I was looking at it to see if it could help make @aws-amplify/cli testable.

The problem I see with the Amplify CLI is that it's interactive with prompts.

Before I found shellac, I was working on a tool that did the following:

  1. Read a markdown file (e.g. README.md) and extracted the shell code fences.
  2. Create a /tmp directory and execute these shell scripts sequentially.
  3. Finally, a test assertion validates if the resulting output matched expectations.

The problem I ran into was trying to document the commands in a scriptable way:

$ amplify init
Enter a name for the project: nextamplified

# All AWS services you provision for your app are grouped into an "environment"
# A common naming convention is dev, staging, and production
Enter a name for the environment: dev

Then, following this block would be a comment:

<!-- shell:input
nextamplified[ENTER]
dev[ENTER]
-->

Did you have any thoughts on how shellac could support testing interactive CLIs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions