Skip to content

Commit df2f432

Browse files
35C4n0rmatifaliDevelopmentCatsCopilot
authored
feat: add auggie cli (#350)
## Description Adds the Auggie CLI module <!-- Briefly describe what this PR does and why --> ## Type of Change - [x] New module - [ ] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information <!-- Delete this section if not applicable --> **Path:** `registry/coder-labs/modules/auggie` **New version:** `v0.1.0` ## 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 --> --------- Co-authored-by: Atif Ali <[email protected]> Co-authored-by: DevelopmentCats <[email protected]> Co-authored-by: DevCats <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 8677e7d commit df2f432

File tree

8 files changed

+1172
-0
lines changed

8 files changed

+1172
-0
lines changed

.icons/auggie.svg

Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
---
2+
display_name: Auggie CLI
3+
icon: ../../../../.icons/auggie.svg
4+
description: Run Auggie CLI in your workspace for AI-powered coding assistance with AgentAPI integration
5+
verified: true
6+
tags: [agent, auggie, ai, tasks, augment]
7+
---
8+
9+
# Auggie CLI
10+
11+
Run Auggie CLI in your workspace to access Augment's AI coding assistant with advanced context understanding and codebase integration. This module integrates with [AgentAPI](https://github.com/coder/agentapi).
12+
13+
```tf
14+
module "auggie" {
15+
source = "registry.coder.com/coder-labs/auggie/coder"
16+
version = "0.1.0"
17+
agent_id = coder_agent.example.id
18+
folder = "/home/coder/project"
19+
}
20+
```
21+
22+
## Prerequisites
23+
24+
- **Node.js and npm must be sourced/available before the auggie module installs** - ensure they are installed in your workspace image or via earlier provisioning steps
25+
- You must add the [Coder Login](https://registry.coder.com/modules/coder/coder-login) module to your template
26+
- **Augment session token for authentication (required for tasks). [Instructions](https://docs.augmentcode.com/cli/setup-auggie/authentication) to get the session token**
27+
28+
## Examples
29+
30+
### Usage with Tasks and Configuration
31+
32+
```tf
33+
data "coder_parameter" "ai_prompt" {
34+
type = "string"
35+
name = "AI Prompt"
36+
default = ""
37+
description = "Initial task prompt for Auggie CLI"
38+
mutable = true
39+
}
40+
41+
module "coder-login" {
42+
count = data.coder_workspace.me.start_count
43+
source = "registry.coder.com/coder/coder-login/coder"
44+
version = "1.0.31"
45+
agent_id = coder_agent.example.id
46+
}
47+
48+
module "auggie" {
49+
source = "registry.coder.com/coder-labs/auggie/coder"
50+
version = "0.1.0"
51+
agent_id = coder_agent.example.id
52+
folder = "/home/coder/project"
53+
54+
# Authentication
55+
augment_session_token = <<-EOF
56+
{"accessToken":"xxxx-yyyy-zzzz-jjjj","tenantURL":"https://d1.api.augmentcode.com/","scopes":["read","write"]}
57+
EOF # Required for tasks
58+
59+
# Version
60+
auggie_version = "0.3.0"
61+
62+
# Task configuration
63+
ai_prompt = data.coder_parameter.ai_prompt.value
64+
continue_previous_conversation = true
65+
interaction_mode = "quiet"
66+
auggie_model = "gpt5"
67+
report_tasks = true
68+
69+
# MCP configuration for additional integrations
70+
mcp = <<-EOF
71+
{
72+
"mcpServers": {
73+
"filesystem": {
74+
"command": "npx",
75+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/coder/project"]
76+
}
77+
}
78+
}
79+
EOF
80+
81+
# Workspace guidelines
82+
rules = <<-EOT
83+
# Project Guidelines
84+
85+
## Code Style
86+
- Use TypeScript for all new JavaScript files
87+
- Follow consistent naming conventions
88+
- Add comprehensive comments for complex logic
89+
90+
## Testing
91+
- Write unit tests for all new functions
92+
- Ensure test coverage above 80%
93+
94+
## Documentation
95+
- Update README.md for any new features
96+
- Document API changes in CHANGELOG.md
97+
EOT
98+
}
99+
```
100+
101+
### Using Multiple MCP Configuration Files
102+
103+
```tf
104+
module "auggie" {
105+
source = "registry.coder.com/coder-labs/auggie/coder"
106+
version = "0.1.0"
107+
agent_id = coder_agent.example.id
108+
folder = "/home/coder/project"
109+
110+
# Multiple MCP configuration files
111+
mcp_files = [
112+
"/path/to/filesystem-mcp.json",
113+
"/path/to/database-mcp.json",
114+
"/path/to/api-mcp.json"
115+
]
116+
117+
mcp = <<-EOF
118+
{
119+
"mcpServers": {
120+
"Test MCP": {
121+
"command": "uv",
122+
"args": [
123+
"--directory",
124+
"/home/coder/test-mcp",
125+
"run",
126+
"server.py"
127+
],
128+
"timeout": 600
129+
}
130+
}
131+
}
132+
EOF
133+
}
134+
```
135+
136+
### Troubleshooting
137+
138+
If you have any issues, please take a look at the log files below.
139+
140+
```bash
141+
# Installation logs
142+
cat ~/.auggie-module/install.log
143+
144+
# Startup logs
145+
cat ~/.auggie-module/agentapi-start.log
146+
147+
# Pre/post install script logs
148+
cat ~/.auggie-module/pre_install.log
149+
cat ~/.auggie-module/post_install.log
150+
```
151+
152+
> [!NOTE]
153+
> To use tasks with Auggie CLI, create a `coder_parameter` named `"AI Prompt"` and pass its value to the auggie module's `ai_prompt` variable. The `folder` variable is required for the module to function correctly.
154+
155+
## References
156+
157+
- [Auggie CLI Reference](https://docs.augmentcode.com/cli/reference)
158+
- [Auggie CLI MCP Integration](https://docs.augmentcode.com/cli/integrations#mcp-integrations)
159+
- [Augment Code Documentation](https://docs.augmentcode.com/)
160+
- [AgentAPI Documentation](https://github.com/coder/agentapi)
161+
- [Coder AI Agents Guide](https://coder.com/docs/tutorials/ai-agents)
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
run "test_auggie_basic" {
2+
command = plan
3+
4+
variables {
5+
agent_id = "test-agent-123"
6+
folder = "/home/coder/projects"
7+
}
8+
9+
assert {
10+
condition = coder_env.auggie_session_auth.name == "AUGMENT_SESSION_AUTH"
11+
error_message = "Auggie session auth environment variable should be set correctly"
12+
}
13+
14+
assert {
15+
condition = var.folder == "/home/coder/projects"
16+
error_message = "Folder variable should be set correctly"
17+
}
18+
19+
assert {
20+
condition = var.agent_id == "test-agent-123"
21+
error_message = "Agent ID variable should be set correctly"
22+
}
23+
24+
assert {
25+
condition = var.install_auggie == true
26+
error_message = "Install auggie should default to true"
27+
}
28+
29+
assert {
30+
condition = var.install_agentapi == true
31+
error_message = "Install agentapi should default to true"
32+
}
33+
}
34+
35+
run "test_auggie_with_session_token" {
36+
command = plan
37+
38+
variables {
39+
agent_id = "test-agent-456"
40+
folder = "/home/coder/workspace"
41+
augment_session_token = "test-session-token-123"
42+
}
43+
44+
assert {
45+
condition = coder_env.auggie_session_auth.value == "test-session-token-123"
46+
error_message = "Auggie session token value should match the input"
47+
}
48+
}
49+
50+
run "test_auggie_with_custom_options" {
51+
command = plan
52+
53+
variables {
54+
agent_id = "test-agent-789"
55+
folder = "/home/coder/custom"
56+
order = 5
57+
group = "development"
58+
icon = "/icon/custom.svg"
59+
auggie_model = "gpt-4"
60+
ai_prompt = "Help me write better code"
61+
interaction_mode = "compact"
62+
continue_previous_conversation = true
63+
install_auggie = false
64+
install_agentapi = false
65+
auggie_version = "1.0.0"
66+
agentapi_version = "v0.6.0"
67+
}
68+
69+
assert {
70+
condition = var.order == 5
71+
error_message = "Order variable should be set to 5"
72+
}
73+
74+
assert {
75+
condition = var.group == "development"
76+
error_message = "Group variable should be set to 'development'"
77+
}
78+
79+
assert {
80+
condition = var.icon == "/icon/custom.svg"
81+
error_message = "Icon variable should be set to custom icon"
82+
}
83+
84+
assert {
85+
condition = var.auggie_model == "gpt-4"
86+
error_message = "Auggie model variable should be set to 'gpt-4'"
87+
}
88+
89+
assert {
90+
condition = var.ai_prompt == "Help me write better code"
91+
error_message = "AI prompt variable should be set correctly"
92+
}
93+
94+
assert {
95+
condition = var.interaction_mode == "compact"
96+
error_message = "Interaction mode should be set to 'compact'"
97+
}
98+
99+
assert {
100+
condition = var.continue_previous_conversation == true
101+
error_message = "Continue previous conversation should be set to true"
102+
}
103+
104+
assert {
105+
condition = var.auggie_version == "1.0.0"
106+
error_message = "Auggie version should be set to '1.0.0'"
107+
}
108+
109+
assert {
110+
condition = var.agentapi_version == "v0.6.0"
111+
error_message = "AgentAPI version should be set to 'v0.6.0'"
112+
}
113+
}
114+
115+
run "test_auggie_with_mcp_and_rules" {
116+
command = plan
117+
118+
variables {
119+
agent_id = "test-agent-mcp"
120+
folder = "/home/coder/mcp-test"
121+
mcp = jsonencode({
122+
mcpServers = {
123+
test = {
124+
command = "test-server"
125+
args = ["--config", "test.json"]
126+
}
127+
}
128+
})
129+
mcp_files = [
130+
"/path/to/mcp1.json",
131+
"/path/to/mcp2.json"
132+
]
133+
rules = "# General coding rules\n- Write clean code\n- Add comments"
134+
}
135+
136+
assert {
137+
condition = var.mcp != ""
138+
error_message = "MCP configuration should be provided"
139+
}
140+
141+
assert {
142+
condition = length(var.mcp_files) == 2
143+
error_message = "Should have 2 MCP files"
144+
}
145+
146+
assert {
147+
condition = var.rules != ""
148+
error_message = "Rules should be provided"
149+
}
150+
}
151+
152+
run "test_auggie_with_scripts" {
153+
command = plan
154+
155+
variables {
156+
agent_id = "test-agent-scripts"
157+
folder = "/home/coder/scripts"
158+
pre_install_script = "echo 'Pre-install script'"
159+
post_install_script = "echo 'Post-install script'"
160+
}
161+
162+
assert {
163+
condition = var.pre_install_script == "echo 'Pre-install script'"
164+
error_message = "Pre-install script should be set correctly"
165+
}
166+
167+
assert {
168+
condition = var.post_install_script == "echo 'Post-install script'"
169+
error_message = "Post-install script should be set correctly"
170+
}
171+
}
172+
173+
run "test_auggie_interaction_mode_validation" {
174+
command = plan
175+
176+
variables {
177+
agent_id = "test-agent-validation"
178+
folder = "/home/coder/test"
179+
interaction_mode = "print"
180+
}
181+
182+
assert {
183+
condition = contains(["interactive", "print", "quiet", "compact"], var.interaction_mode)
184+
error_message = "Interaction mode should be one of the valid options"
185+
}
186+
}

0 commit comments

Comments
 (0)