Skip to content

Kiro Headless Can't Resolve Resources Using Environment Variables #8102

Description

@MattiaDellOca

Before opening, please confirm:

Operating System

macOS 15.5

Kiro Version

2.2.0

Bug Description

When running Kiro in headless mode (kiro-cli chat --no-interactive), skills are not used within the execution.

EDIT: this only happens when skill references use environment variables. In the following example, the first skill will be loaded, while the second will not:

{
  "name": "my-agent",
  "resources": [
    "skill://~/.kiro/skills/working-skill/SKILL.md",
    "skill://$USER_HOME/.kiro/skills/broken-skill/SKILL.md"
  ]
}

Note that both skills work in regular mode (kiro-cli chat), so environment variables are not resolved only for headless mode!

Steps to Reproduce

  1. Define an agent that makes use of skills and environment variables
  2. Run the agent in headless mode and make a question about skills:
kiro-cli chat --agent <my_agent> --no-interactive "Do you have access to any agent skill?"

Expected Behavior

I would expect the agent to have access to referenced skills.
Note this already happen when running in regular mode. I confirmed this by running:

kiro-cli chat --agent <my_agent> "Do you have access to any agent skill?"

When using this configuration, the agent can correctly use the available skills.

Conversation ID

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions