Skip to content

Conversation

@mekza
Copy link
Contributor

@mekza mekza commented Oct 25, 2025

New version of #2859 after fixing the tests:

This PR transforms how users organize and reference their Q CLI agents by introducing hierarchical directory support. Previously, all agents lived in a flat directory structure, forcing users to rely solely on unique names to avoid collisions. Now, agents can be organized in subdirectories and referenced using intuitive path notation.

cli-agents/
  team/
    backend-expert.json
    frontend-specialist.json
  personal/
    code-reviewer.json
  shared/
    documentation-helper.json

It enables users to reference agents as q chat --agent team/backend-expert in addition to q chat --agent backend-expert. Users can now organize agents hierarchically in the Q CLI directory structure, avoiding naming collisions and improving discoverability through logical grouping (e.g., team-specific, project-specific, or role-specific agent directories).

@adamalrefai
Copy link

Does this PR also add support for loading an agent with a path to the config file? So for example q chat --agent /path/to/agent.json

@mekza
Copy link
Contributor Author

mekza commented Oct 29, 2025

@adamalrefai not full path only path relative to $HOME/.aws/amazonq/cli-agents

@adamalrefai
Copy link

@mekza Alright, got it :) This is really good and really needed, but was hoping that this will also add support for global path picking.. I think that should be brought up, the /agent swap should also support that in my opinion, like /agent swap --path /path/to/agent.json

People can now do `q chat --agent team/myagent` in addition to the current `q chat --agent myagent`. This will enable people to better organize their agents in Q CLI directory
@mekza mekza force-pushed the mekza/support_for_path_based_agents branch from 22c20ae to 308ebb6 Compare October 31, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants