Skip to content

kiro-cli: kiro-cli agent validate exits 0 on every error (missing file, invalid JSON) #12111

Open

Description

@peepeepopapapeepeepo

Before opening, please confirm:

Operating System

Amazon Linux 2023 (x86_64) and macOS

Kiro Version

kiro-cli 2.34.0

Bug Description

kiro-cli agent validate --path <file> prints an error but always exits 0, so it cannot be used as a check in scripts or CI. On success it prints nothing, so there is no positive confirmation either.

Steps to Reproduce

kiro-cli agent validate --path ./nope.json; echo "exit=$?"
# Error: Encountered io error: No such file or directory (os error 2)
# exit=0

printf '{bad' > bad.json
kiro-cli agent validate --path ./bad.json; echo "exit=$?"
# Error: Json supplied at ./bad.json is invalid: key must be a string at line 1 column 2
# exit=0

printf '%s' '{"name":"ok","description":"x","prompt":"hi","tools":["read"]}' > ok.json
kiro-cli agent validate --path ./ok.json; echo "exit=$?"
# (no output)
# exit=0

Expected Behavior

  • A non-zero exit code when the file is missing, unreadable, not JSON, or fails schema validation.
  • A one-line success message (for example ok.json: valid) when it passes.

Conversation ID

No response

Additional Context

Same result on both platforms, 2026-10-24 and 2026-10-25.

Activity

  1. github-actions commented on Oct 25, 2026

    @github-actions

    Thanks for filing this and for the thorough repro steps — that makes it really easy to understand the problem! You're right that kiro-cli agent validate should be returning a non-zero exit code on errors so it's actually useful in scripts and CI pipelines. A maintainer will take a look at this soon — great catch, and we appreciate you helping make the CLI more reliable! 🙌

  2. AnilMaktala commented on Oct 26, 2026

    @AnilMaktala
    Contributor

    Thanks for raising this.

    kiro-cli agent validate prints an error message when given an invalid or missing agent file but always exits with code 0. This makes it unusable as a check in scripts or CI pipelines, since callers cannot distinguish a validation failure from success. On a valid file it also prints nothing, so there is no positive confirmation.

    Marking this as a bug to investigate further.

  3. added theissue type on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions