Allow for using Circle CI tooling without a TTY



When trying to automate some of the provided tasks by the Circle CI CLI ( using another build tool, they will fail with the following message:

the input device is not a TTY

It would be awesome if the CLI would allow itself to be executed without a TTY so it can be used in other automated tooling.


You can’t pipe the local CLI tool since it’s a Docker image.


I am fairly confident you can pipe Docker STDOUT and STDERR the same way as other CLI tools. I didn’t realize the local CLI was just a shell script around some Docker execution.

Looking at it though, the -t should just be removed from the docker run -it --rm command to work in non TTY.


Thanks for pointing that out, this worked!

I agree, pretty obviously, you can pipe stdout and stderr :slight_smile:

Would love to see this officially supported without having to manually tweak the circleci script.

This is e.g. necessary to integrate this with pre-commit, which looks something like this:

-   id: validate-circleci-config
    name: Validating CircleCI config.yml
    language: system
    entry: circleci config validate -c .circleci/config.yml
    files: ^\.circleci/config\.yml$

but with the -t flag results in:

Validating CircleCI config.yml.................................Failed
hookid: validate-circleci-config

the input device is not a TTY


Same issue here.

We’re validating changes in .circleci/config.yml using a pre-commit hook:


# Redirect output to stderr.
exec 1>&2

ROOT_DIR=`git rev-parse --show-toplevel`

# validate CircleCI config.yml if it contains uncommitted changes
if [ `git diff --name-only | grep $CIRCLECI_CONFIG_FILE` ] ; then
        echo -n "Validating CircleCI config file at ${CIRCLECI_CONFIG_FILE}"
        circleci config validate ${ROOT_DIR}/${CIRCLECI_CONFIG_FILE} || exit 1

which results in “the input device is not a TTY”

Our workaround is to add exec < /dev/tty to the script.



[Reprise] Allow for using Circle CI tooling without a TTY