chore: update Sourcegraph AMP to Amp CLI (#382)
## Description Update Sourcegraph AMP to Amp CLI as this seems the preferred name. <!-- Briefly describe what this PR does and why --> ## Type of Change - [ ] New module - [ ] Bug fix - [ ] Feature/enhancement - [x] Documentation - [ ] Other ## Module Information <!-- Delete this section if not applicable --> **Path:** `registry/coder-labs/modules/sourcegraph-amp` **New version:** `v1.0.2` **Breaking change:** [ ] Yes [x] No ## Testing & Validation - [x] Tests pass (`bun test`) - [x] Code formatted (`bun run fmt`) - [x] Changes tested locally ## Related Issues <!-- Link related issues or write "None" if not applicable -->
This commit is contained in:
parent
94d938156d
commit
68f881e220
@ -1,19 +1,19 @@
|
|||||||
---
|
---
|
||||||
display_name: Sourcegraph AMP
|
display_name: Amp CLI
|
||||||
icon: ../../../../.icons/sourcegraph-amp.svg
|
icon: ../../../../.icons/sourcegraph-amp.svg
|
||||||
description: Sourcegraph's AI coding agent with deep codebase understanding and intelligent code search capabilities
|
description: Sourcegraph's AI coding agent with deep codebase understanding and intelligent code search capabilities
|
||||||
verified: false
|
verified: false
|
||||||
tags: [agent, sourcegraph, amp, ai, tasks]
|
tags: [agent, sourcegraph, amp, ai, tasks]
|
||||||
---
|
---
|
||||||
|
|
||||||
# Sourcegraph AMP CLI
|
# Sourcegraph Amp CLI
|
||||||
|
|
||||||
Run [Sourcegraph AMP CLI](https://sourcegraph.com/amp) in your workspace to access Sourcegraph's AI-powered code search and analysis tools, with AgentAPI integration for seamless Coder Tasks support.
|
Run [Amp CLI](https://ampcode.com/) in your workspace to access Sourcegraph's AI-powered code search and analysis tools, with AgentAPI integration for seamless Coder Tasks support.
|
||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "sourcegraph-amp" {
|
module "amp-cli" {
|
||||||
source = "registry.coder.com/coder-labs/sourcegraph-amp/coder"
|
source = "registry.coder.com/coder-labs/sourcegraph-amp/coder"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
sourcegraph_amp_api_key = var.sourcegraph_amp_api_key
|
sourcegraph_amp_api_key = var.sourcegraph_amp_api_key
|
||||||
install_sourcegraph_amp = true
|
install_sourcegraph_amp = true
|
||||||
@ -31,19 +31,19 @@ module "sourcegraph-amp" {
|
|||||||
```tf
|
```tf
|
||||||
data "coder_parameter" "ai_prompt" {
|
data "coder_parameter" "ai_prompt" {
|
||||||
name = "AI Prompt"
|
name = "AI Prompt"
|
||||||
description = "Write an initial prompt for AMP to work on."
|
description = "Write an initial prompt for Amp to work on."
|
||||||
type = "string"
|
type = "string"
|
||||||
default = ""
|
default = ""
|
||||||
mutable = true
|
mutable = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set system prompt for Sourcegraph Amp via environment variables
|
# Set system prompt for Amp CLI via environment variables
|
||||||
resource "coder_agent" "main" {
|
resource "coder_agent" "main" {
|
||||||
# ...
|
# ...
|
||||||
env = {
|
env = {
|
||||||
SOURCEGRAPH_AMP_SYSTEM_PROMPT = <<-EOT
|
SOURCEGRAPH_AMP_SYSTEM_PROMPT = <<-EOT
|
||||||
You are an AMP assistant that helps developers debug and write code efficiently.
|
You are an Amp assistant that helps developers debug and write code efficiently.
|
||||||
|
|
||||||
Always log task status to Coder.
|
Always log task status to Coder.
|
||||||
EOT
|
EOT
|
||||||
@ -53,14 +53,14 @@ resource "coder_agent" "main" {
|
|||||||
|
|
||||||
variable "sourcegraph_amp_api_key" {
|
variable "sourcegraph_amp_api_key" {
|
||||||
type = string
|
type = string
|
||||||
description = "Sourcegraph AMP API key"
|
description = "Sourcegraph Amp API key. Get one at https://ampcode.com/settings"
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
module "sourcegraph-amp" {
|
module "amp-cli" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder-labs/sourcegraph-amp/coder"
|
source = "registry.coder.com/coder-labs/sourcegraph-amp/coder"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
sourcegraph_amp_api_key = var.sourcegraph_amp_api_key # recommended for authenticated usage
|
sourcegraph_amp_api_key = var.sourcegraph_amp_api_key # recommended for authenticated usage
|
||||||
install_sourcegraph_amp = true
|
install_sourcegraph_amp = true
|
||||||
@ -69,8 +69,8 @@ module "sourcegraph-amp" {
|
|||||||
|
|
||||||
## How it Works
|
## How it Works
|
||||||
|
|
||||||
- **Install**: Installs Sourcegraph AMP CLI using npm (installs Node.js via NVM if required)
|
- **Install**: Installs Sourcegraph Amp CLI using npm (installs Node.js via NVM if required)
|
||||||
- **Start**: Launches AMP CLI in the specified directory, wrapped with AgentAPI to enable tasks and AI interactions
|
- **Start**: Launches Amp CLI in the specified directory, wrapped with AgentAPI to enable tasks and AI interactions
|
||||||
- **Environment Variables**: Sets `SOURCEGRAPH_AMP_API_KEY` and `SOURCEGRAPH_AMP_START_DIRECTORY` for the CLI execution
|
- **Environment Variables**: Sets `SOURCEGRAPH_AMP_API_KEY` and `SOURCEGRAPH_AMP_START_DIRECTORY` for the CLI execution
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
@ -80,11 +80,11 @@ module "sourcegraph-amp" {
|
|||||||
- If AgentAPI fails to start, verify that your container has network access and executable permissions for the scripts
|
- If AgentAPI fails to start, verify that your container has network access and executable permissions for the scripts
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> For using **Coder Tasks** with Sourcegraph AMP, make sure to pass the `AI Prompt` parameter and set `sourcegraph_amp_api_key`.
|
> For using **Coder Tasks** with Amp CLI, make sure to pass the `AI Prompt` parameter and set `sourcegraph_amp_api_key`.
|
||||||
> This ensures task reporting and status updates work seamlessly.
|
> This ensures task reporting and status updates work seamlessly.
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- [Sourcegraph AMP Documentation](https://ampcode.com/manual)
|
- [Amp CLI Documentation](https://ampcode.com/manual)
|
||||||
- [AgentAPI Documentation](https://github.com/coder/agentapi)
|
- [AgentAPI Documentation](https://github.com/coder/agentapi)
|
||||||
- [Coder AI Agents Guide](https://coder.com/docs/tutorials/ai-agents)
|
- [Coder AI Agents Guide](https://coder.com/docs/tutorials/ai-agents)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user