aws / aws/amazon-q-developer-cli
Feature Request: Add support for loading agents from absolute paths
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
Currently, Q CLI agents can only be loaded from two locations:
1. The global directory: `~/.aws/amazonq/cli-agents`
2. A local workspace directory: `.amazonq/cli-agents` (relative to where the Q CLI session is started)
To use agents from the local workspace directory, the Q CLI session must be started from the directory containing `.amazonq/cli-agents`. This limitation makes it cumbersome to work with agent configs stored in other locations.
**Current Limitation:**
Agent configs must exist in one of the two standard locations and cannot be referenced from arbitrary filesystem paths. To use an agent config from elsewhere, it must
first be copied to one of these locations, and for local workspace agents, the session must be started from the correct directory.
**Proposed Feature:**
Allow users to specify absolute paths when loading agents:
```
# Start chat with agent from absolute path
q chat --agent /path/to/my-project/agents/custom-agent.json
# Switch to agent using absolute path during session
/agent swap --path /path/to/another-agent.json
```
**Use Cases:**
1. **Development & Testing:** Iterate on agent configs directly in development directories without copying files back and forth
2. **Project-Specific Agents:** Store agent configs in project repositories alongside the code they're designed to work with, without requiring the session to start from a
specific directory
3. **Version Control:** Keep agent configs in Git repos for team collaboration and versioning
4. **Shared Configurations:** Use agent configs from shared network locations or team directories
5. **CI/CD Integration:** Reference agent configs from build/deployment directories
6. **Multi-Directory Workflows:** Access agents from different project directories without restarting sessions
**Benefits:**
• Eliminates manual file copying during agent development
• Enables version-controlled agent configurations as part of projects
• Improves workflow for teams sharing agent configs
• Provides flexibility for different organizational structures
• Removes the constraint of starting sessions from specific directories to access local agents
**Expected Behavior:**
The system would detect absolute paths (starting with / or ~) and load the agent config directly from that location, while maintaining existing behavior for agent names
and relative paths within the standard cli-agents directories.
Contributor guide
Assessment
This issue has not been assessed yet.