Skip to content

Commit 8faa831

Browse files
committed
feat: add auggie cli
1 parent 29e5307 commit 8faa831

File tree

7 files changed

+1129
-0
lines changed

7 files changed

+1129
-0
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
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) for Coder Tasks compatibility.
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+
- You must add the [Coder Login](https://registry.coder.com/modules/coder/coder-login) module to your template
25+
- **Augment session token for authentication (required for tasks)**
26+
27+
## Usage Examples
28+
29+
### Simple Usage
30+
31+
```tf
32+
module "auggie" {
33+
count = data.coder_workspace.me.start_count
34+
source = "registry.coder.com/coder-labs/auggie/coder"
35+
version = "0.1.0"
36+
agent_id = coder_agent.example.id
37+
folder = "/home/coder/project"
38+
39+
# Optional: Specify Auggie version
40+
install_auggie = true
41+
auggie_version = "latest"
42+
}
43+
```
44+
45+
### Advanced Usage with Tasks and Configuration
46+
47+
```tf
48+
data "coder_parameter" "ai_prompt" {
49+
type = "string"
50+
name = "AI Prompt"
51+
default = ""
52+
description = "Initial task prompt for Auggie CLI"
53+
mutable = true
54+
}
55+
56+
module "coder-login" {
57+
count = data.coder_workspace.me.start_count
58+
source = "registry.coder.com/coder/coder-login/coder"
59+
version = "1.0.31"
60+
agent_id = coder_agent.example.id
61+
}
62+
63+
module "auggie" {
64+
source = "registry.coder.com/coder-labs/auggie/coder"
65+
version = "0.1.0"
66+
agent_id = coder_agent.example.id
67+
folder = "/home/coder/project"
68+
69+
# Authentication
70+
augment_session_token = <<-EOF
71+
{"accessToken":"xxxx-yyyy-zzzz-jjjj","tenantURL":"https://d1.api.augmentcode.com/","scopes":["read","write"]}
72+
EOF # Required for tasks
73+
74+
# Task configuration
75+
ai_prompt = data.coder_parameter.ai_prompt.value
76+
continue_previous_conversation = true
77+
interaction_mode = "quiet"
78+
auggie_model = "gpt-5"
79+
80+
# MCP configuration for additional integrations
81+
mcp = <<-EOF
82+
{
83+
"mcpServers": {
84+
"filesystem": {
85+
"command": "npx",
86+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/coder/project"]
87+
},
88+
"git": {
89+
"command": "npx",
90+
"args": ["-y", "@modelcontextprotocol/server-git", "--repository", "/home/coder/project"]
91+
}
92+
}
93+
}
94+
EOF
95+
96+
# Workspace guidelines
97+
rules = <<-EOT
98+
# Project Guidelines
99+
100+
## Code Style
101+
- Use TypeScript for all new JavaScript files
102+
- Follow consistent naming conventions
103+
- Add comprehensive comments for complex logic
104+
105+
## Testing
106+
- Write unit tests for all new functions
107+
- Ensure test coverage above 80%
108+
109+
## Documentation
110+
- Update README.md for any new features
111+
- Document API changes in CHANGELOG.md
112+
EOT
113+
}
114+
```
115+
116+
### Using Multiple MCP Configuration Files
117+
118+
```tf
119+
module "auggie" {
120+
source = "registry.coder.com/coder-labs/auggie/coder"
121+
version = "0.1.0"
122+
agent_id = coder_agent.example.id
123+
folder = "/home/coder/project"
124+
125+
# Multiple MCP configuration files
126+
mcp_files = [
127+
"/path/to/filesystem-mcp.json",
128+
"/path/to/database-mcp.json",
129+
"/path/to/api-mcp.json"
130+
]
131+
132+
mcp = <<-EOF
133+
{
134+
"mcpServers": {
135+
"Test MCP": {
136+
"command": "uv",
137+
"args": [
138+
"--directory",
139+
"/home/coder/test-mcp",
140+
"run",
141+
"server.py"
142+
],
143+
"timeout": 600
144+
}
145+
}
146+
}
147+
EOF
148+
149+
# Custom install scripts
150+
pre_install_script = <<-EOT
151+
#!/usr/bin/env bash
152+
set -euo pipefail
153+
# Install additional dependencies
154+
npm install -g typescript
155+
pip install -r requirements.txt
156+
EOT
157+
158+
post_install_script = <<-EOT
159+
#!/usr/bin/env bash
160+
set -euo pipefail
161+
# Setup project-specific configuration
162+
echo "Auggie setup complete for $(pwd)"
163+
EOT
164+
}
165+
```
166+
167+
### Log Files
168+
169+
```bash
170+
# Installation logs
171+
cat ~/.auggie-module/install.log
172+
173+
# Startup logs
174+
cat ~/.auggie-module/agentapi-start.log
175+
176+
# Pre/post install script logs
177+
cat ~/.auggie-module/pre_install.log
178+
cat ~/.auggie-module/post_install.log
179+
```
180+
181+
> [!NOTE]
182+
> 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.
183+
184+
## References
185+
186+
- [Augment Code Documentation](https://docs.augmentcode.com/)
187+
- [Auggie CLI Reference](https://docs.augmentcode.com/cli/reference)
188+
- [MCP Integration Guide](https://docs.augmentcode.com/cli/integrations#mcp-integrations)
189+
- [AgentAPI Documentation](https://github.com/coder/agentapi)
190+
- [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)