Skip to content

CLI does not respect XDG_CONFIG_HOME when creating agents #2035

@akoken

Description

@akoken

Describe the bug

When attempting to create a new User agent using the Copilot CLI, the tool does not respect the XDG_CONFIG_HOME environment variable.

Furthermore, there seems to be a hardcoded path error. While the interactive prompt correctly displays the intended path based on standard conventions (~/.config/copilot/agents/), the CLI actually creates the file in an incorrectly formatted path: ~/config/.copilot/agents/ (dropping the dot from .config and adding a dot to copilot).

Actual Behavior

The CLI reports (and actually creates the file at):
/Users/<username>/config/.copilot/agents/test-agent.agent.md

Notice the missing . before config and the erroneous . added before copilot.

Screenshots / Evidence

Image

Environment

  • OS: macOS
  • Copilot CLI Version: [1.0.5]
  • Shell: [zsh]

Affected version

1.0.5

Steps to reproduce the behavior

  1. Ensure the XDG_CONFIG_HOME environment variable is set (e.g., export XDG_CONFIG_HOME="$HOME/.config").
  2. Initiate the Copilot CLI command to create a new agent.
  3. When prompted "Where should the agent be created?", select option 2: User (~/.config/copilot/agents/).
  4. Observe the terminal output confirming the creation path.

Expected behavior

Based on the XDG_CONFIG_HOME variable and the CLI's own prompt, the agent should be created at:
/Users/<username>/.config/copilot/agents/test-agent.agent.md

Additional context

  • $ echo $XDG_CONFIG_HOME -> /Users/akoken/.config
  • Prompt shows: 2. User (~/.config/copilot/agents/)
  • Success message shows: Created agent at /Users/akoken/config/.copilot/agents/...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions