@cloudshipai/station-skill 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Station Skill for OpenCode
2
+
3
+ OpenCode plugin that provides skills for [Station](https://github.com/cloudshipai/station) - self-hosted AI agent orchestration platform.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bunx @cloudshipai/station-skill install
9
+ ```
10
+
11
+ This adds the plugin to your `~/.config/opencode/opencode.json`. Restart OpenCode to load the skills.
12
+
13
+ ## Uninstall
14
+
15
+ ```bash
16
+ bunx @cloudshipai/station-skill uninstall
17
+ ```
18
+
19
+ ## Skills Included
20
+
21
+ | Skill | Description |
22
+ |-------|-------------|
23
+ | `station` | Core CLI commands - agents, workflows, MCP tools, deployment, benchmarking |
24
+ | `station-config` | Configuration management via CLI and browser UI |
25
+
26
+ ## Usage
27
+
28
+ After installation, ask OpenCode to use the skills:
29
+
30
+ ```
31
+ Load the station skill and create an agent
32
+ ```
33
+
34
+ ```
35
+ /skill station
36
+ How do I deploy my agents to Fly.io?
37
+ ```
38
+
39
+ ## Prerequisites
40
+
41
+ - [Station CLI](https://github.com/cloudshipai/station) installed (`stn --version`)
42
+ - Station initialized (`stn init`)
43
+
44
+ ## Related
45
+
46
+ - [Station CLI Documentation](https://docs.cloudshipai.com/station/overview)
47
+ - [Claude Code Plugin](https://github.com/cloudshipai/station/tree/main/claude-code-plugin) - For Claude Code users
48
+
49
+ ## License
50
+
51
+ MIT
package/dist/cli.js ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+
4
+ // src/cli.ts
5
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
6
+ import { join } from "path";
7
+ import { homedir } from "os";
8
+ var PACKAGE_NAME = "@cloudshipai/station-skill";
9
+ var CONFIG_DIR = join(homedir(), ".config", "opencode");
10
+ var CONFIG_FILE = join(CONFIG_DIR, "opencode.json");
11
+ function loadConfig() {
12
+ if (!existsSync(CONFIG_FILE)) {
13
+ return {};
14
+ }
15
+ try {
16
+ return JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
17
+ } catch {
18
+ return {};
19
+ }
20
+ }
21
+ function saveConfig(config) {
22
+ mkdirSync(CONFIG_DIR, { recursive: true });
23
+ writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
24
+ }
25
+ function install() {
26
+ const config = loadConfig();
27
+ const plugins = config.plugin || [];
28
+ if (plugins.includes(PACKAGE_NAME)) {
29
+ console.log(`${PACKAGE_NAME} is already installed`);
30
+ return;
31
+ }
32
+ config.plugin = [...plugins, PACKAGE_NAME];
33
+ saveConfig(config);
34
+ console.log(`Installed ${PACKAGE_NAME}`);
35
+ console.log(`Restart OpenCode to load the station skills`);
36
+ }
37
+ function uninstall() {
38
+ const config = loadConfig();
39
+ const plugins = config.plugin || [];
40
+ config.plugin = plugins.filter((p) => p !== PACKAGE_NAME && !p.includes("station-skill"));
41
+ saveConfig(config);
42
+ console.log(`Uninstalled ${PACKAGE_NAME}`);
43
+ }
44
+ var command = process.argv[2];
45
+ switch (command) {
46
+ case "install":
47
+ install();
48
+ break;
49
+ case "uninstall":
50
+ uninstall();
51
+ break;
52
+ default:
53
+ console.log(`Usage: bunx ${PACKAGE_NAME} <install|uninstall>`);
54
+ process.exit(1);
55
+ }
package/dist/index.js ADDED
@@ -0,0 +1,41 @@
1
+ // @bun
2
+ // src/index.ts
3
+ import { readFileSync } from "fs";
4
+ import { join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
6
+ var __filename2 = fileURLToPath(import.meta.url);
7
+ var __dirname2 = dirname(__filename2);
8
+ var skillsDir = join(__dirname2, "..", "skills");
9
+ var stationSkill;
10
+ var stationConfigSkill;
11
+ try {
12
+ stationSkill = readFileSync(join(skillsDir, "station.md"), "utf-8");
13
+ stationConfigSkill = readFileSync(join(skillsDir, "station-config.md"), "utf-8");
14
+ } catch (err) {
15
+ console.error("[station-skill] Failed to load skill files:", err);
16
+ stationSkill = `# Station
17
+
18
+ Skill file not found.`;
19
+ stationConfigSkill = `# Station Config
20
+
21
+ Skill file not found.`;
22
+ }
23
+ var plugin = async (_input) => {
24
+ console.log("[station-skill] Loaded");
25
+ return {
26
+ skill: {
27
+ station: {
28
+ content: stationSkill,
29
+ description: "Station CLI for AI agent orchestration - agents, workflows, MCP tools, deployment"
30
+ },
31
+ "station-config": {
32
+ content: stationConfigSkill,
33
+ description: "Station configuration management via CLI and browser UI"
34
+ }
35
+ }
36
+ };
37
+ };
38
+ var src_default = plugin;
39
+ export {
40
+ src_default as default
41
+ };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@cloudshipai/station-skill",
3
+ "version": "0.1.0",
4
+ "description": "OpenCode plugin with Station CLI skills for AI agent orchestration",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "bin": {
15
+ "station-skill": "./dist/cli.js"
16
+ },
17
+ "scripts": {
18
+ "build": "bun build src/index.ts --outdir dist --target bun && bun build src/cli.ts --outdir dist --target bun",
19
+ "dev": "bun --watch src/index.ts",
20
+ "prepublishOnly": "bun run build"
21
+ },
22
+ "dependencies": {},
23
+ "devDependencies": {
24
+ "@types/bun": "^1.1.14",
25
+ "typescript": "^5.7.2"
26
+ },
27
+ "peerDependencies": {
28
+ "bun": ">=1.1.0"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "skills",
33
+ "README.md"
34
+ ],
35
+ "keywords": [
36
+ "opencode",
37
+ "plugin",
38
+ "station",
39
+ "cloudship",
40
+ "ai-agents",
41
+ "orchestration",
42
+ "skill"
43
+ ],
44
+ "license": "MIT",
45
+ "author": "CloudShip AI <hello@cloudship.ai>",
46
+ "homepage": "https://github.com/cloudshipai/station/tree/main/station-skill#readme",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/cloudshipai/station.git",
50
+ "directory": "station-skill"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public",
54
+ "registry": "https://registry.npmjs.org/"
55
+ }
56
+ }
@@ -0,0 +1,177 @@
1
+ # Station Configuration
2
+
3
+ Configure Station settings including AI provider, coding backend, CloudShip integration, and more.
4
+
5
+ ## Browser-Based Configuration (Recommended)
6
+
7
+ The easiest way to configure Station is via the browser UI:
8
+
9
+ ```bash
10
+ # Opens browser-based config editor
11
+ # Automatically starts server if not running
12
+ stn config --browser
13
+ ```
14
+
15
+ This opens a visual editor with:
16
+ - All configuration sections organized
17
+ - Conditional fields (e.g., backend-specific settings only show for selected backend)
18
+ - Secret fields with show/hide toggle
19
+ - Validation and defaults
20
+
21
+ ## CLI Configuration Commands
22
+
23
+ ### View Configuration
24
+
25
+ ```bash
26
+ # Show all config (secrets redacted)
27
+ stn config show
28
+
29
+ # Show specific section
30
+ stn config show ai
31
+ stn config show coding
32
+ stn config show cloudship
33
+
34
+ # Show config file path
35
+ stn config path
36
+
37
+ # Show all available config keys
38
+ stn config schema
39
+ ```
40
+
41
+ ### Set Configuration Values
42
+
43
+ ```bash
44
+ # Set a value
45
+ stn config set <key> <value>
46
+
47
+ # Examples
48
+ stn config set ai_provider anthropic
49
+ stn config set ai_model claude-sonnet-4-20250514
50
+ stn config set coding.backend opencode
51
+ stn config set cloudship.enabled true
52
+
53
+ # Set nested values
54
+ stn config set coding.nats.url nats://localhost:4222
55
+ stn config set cloudship.api_key cst_xxx
56
+
57
+ # Reset to default
58
+ stn config reset <key>
59
+ ```
60
+
61
+ ### Edit Config File Directly
62
+
63
+ ```bash
64
+ # Open in $EDITOR
65
+ stn config edit
66
+ ```
67
+
68
+ ## Configuration Sections
69
+
70
+ ### AI Provider (`ai_*`)
71
+
72
+ | Key | Description | Default |
73
+ |-----|-------------|---------|
74
+ | `ai_provider` | Provider: openai, anthropic, ollama, gemini | openai |
75
+ | `ai_model` | Model name | gpt-4o |
76
+ | `ai_api_key` | API key (secret) | - |
77
+ | `ai_base_url` | Custom base URL for OpenAI-compatible | - |
78
+
79
+ ### Coding Backend (`coding.*`)
80
+
81
+ | Key | Description | Default |
82
+ |-----|-------------|---------|
83
+ | `coding.backend` | Backend: opencode, opencode-nats, opencode-cli, claudecode | opencode-cli |
84
+ | `coding.workspace_base_path` | Base path for workspaces | /tmp/station-coding |
85
+ | `coding.max_attempts` | Max retry attempts | 3 |
86
+ | `coding.task_timeout_min` | Task timeout in minutes | 30 |
87
+
88
+ **Backend-specific settings:**
89
+
90
+ For `opencode`:
91
+ - `coding.opencode.url` - OpenCode HTTP server URL
92
+
93
+ For `opencode-nats`:
94
+ - `coding.nats.url` - NATS server URL
95
+ - `coding.nats.subjects.task` - Task subject
96
+ - `coding.nats.subjects.result` - Result subject
97
+ - `coding.nats.subjects.stream` - Stream subject
98
+
99
+ For `opencode-cli`:
100
+ - `coding.cli.binary_path` - Path to opencode binary
101
+ - `coding.cli.timeout_sec` - CLI timeout
102
+
103
+ For `claudecode`:
104
+ - `coding.claudecode.binary_path` - Path to claude binary
105
+ - `coding.claudecode.timeout_sec` - Timeout
106
+ - `coding.claudecode.model` - Model: sonnet, opus, haiku
107
+ - `coding.claudecode.max_turns` - Max conversation turns
108
+ - `coding.claudecode.allowed_tools` - Tool whitelist
109
+ - `coding.claudecode.disallowed_tools` - Tool blacklist
110
+
111
+ ### CloudShip Integration (`cloudship.*`)
112
+
113
+ | Key | Description | Default |
114
+ |-----|-------------|---------|
115
+ | `cloudship.enabled` | Enable CloudShip | false |
116
+ | `cloudship.api_key` | Personal API key (cst_...) | - |
117
+ | `cloudship.registration_key` | Station registration key | - |
118
+ | `cloudship.endpoint` | Lighthouse gRPC endpoint | lighthouse.cloudshipai.com:443 |
119
+ | `cloudship.use_tls` | Use TLS | true |
120
+ | `cloudship.name` | Station name (unique) | - |
121
+ | `cloudship.tags` | Tags for filtering | - |
122
+
123
+ ### Server Settings (`api_port`, `mcp_port`, etc.)
124
+
125
+ | Key | Description | Default |
126
+ |-----|-------------|---------|
127
+ | `api_port` | API server port | 8585 |
128
+ | `mcp_port` | MCP server port | 8586 |
129
+ | `debug` | Debug mode | false |
130
+ | `workspace` | Custom workspace path | - |
131
+
132
+ ### Other Sections
133
+
134
+ - **Telemetry** (`telemetry.*`) - Tracing/observability settings
135
+ - **Sandbox** (`sandbox.*`) - Code execution sandbox settings
136
+ - **Webhook** (`webhook.*`) - Webhook endpoint settings
137
+ - **Notifications** (`notifications.*`, `notify.*`) - Alert/notification settings
138
+
139
+ ## Common Workflows
140
+
141
+ ### Initial Setup
142
+
143
+ ```bash
144
+ # Configure AI provider
145
+ stn config set ai_provider anthropic
146
+ stn config set ai_model claude-sonnet-4-20250514
147
+
148
+ # Or use browser for full setup
149
+ stn config --browser
150
+ ```
151
+
152
+ ### Connect to CloudShip
153
+
154
+ ```bash
155
+ stn config set cloudship.enabled true
156
+ stn config set cloudship.api_key cst_your_api_key
157
+ stn config set cloudship.registration_key your_reg_key
158
+ stn config set cloudship.name my-station
159
+ ```
160
+
161
+ ### Change Coding Backend
162
+
163
+ ```bash
164
+ # Switch to OpenCode with NATS
165
+ stn config set coding.backend opencode-nats
166
+ stn config set coding.nats.url nats://localhost:4222
167
+
168
+ # Or use Claude Code
169
+ stn config set coding.backend claudecode
170
+ stn config set coding.claudecode.model opus
171
+ ```
172
+
173
+ ## Config File Location
174
+
175
+ Default: `~/.config/station/config.yaml`
176
+
177
+ Override with `--config` flag or `STN_CONFIG` environment variable.
@@ -0,0 +1,467 @@
1
+ # Station CLI
2
+
3
+ Station is a self-hosted AI agent orchestration platform. You interact with it via the `stn` CLI or MCP tools (41+ available via `stn stdio`).
4
+
5
+ ## When to Use CLI vs MCP Tools
6
+
7
+ | Task | Use CLI | Use MCP Tool |
8
+ |------|---------|--------------|
9
+ | Create/edit agent files | `stn agent create`, edit `.prompt` files | - |
10
+ | Run an agent | `stn agent run <name> "<task>"` | `call_agent` |
11
+ | List agents/environments | `stn agent list`, `stn env list` | `list_agents`, `list_environments` |
12
+ | Add MCP servers | `stn mcp add <name>` | `add_mcp_server_to_environment` |
13
+ | Sync configurations | `stn sync <env>` | - |
14
+ | Install bundles | `stn bundle install <url>` | - |
15
+ | Inspect runs | `stn runs list` | `inspect_run`, `list_runs` |
16
+ | Deploy | `stn deploy <env>` | - |
17
+ | Start services | `stn serve`, `stn jaeger up` | - |
18
+
19
+ **Rule of thumb**: CLI for setup, file operations, deployment. MCP tools for programmatic execution and queries within conversations.
20
+
21
+ ## Quick Reference
22
+
23
+ ### Initialization
24
+
25
+ ```bash
26
+ # Initialize Station with AI provider
27
+ stn init --provider openai --ship # OpenAI with Ship filesystem tools
28
+ stn init --provider anthropic --ship # Anthropic (requires OAuth: stn auth anthropic login)
29
+ stn init --provider gemini --ship # Google Gemini
30
+
31
+ # Start Jaeger for observability
32
+ stn jaeger up # View traces at http://localhost:16686
33
+ ```
34
+
35
+ ### Agent Management
36
+
37
+ ```bash
38
+ # CREATE agent via CLI (recommended)
39
+ stn agent create <name> --prompt "<prompt>" --description "<desc>" [options]
40
+
41
+ # Required flags:
42
+ # --prompt, -p System prompt (required)
43
+ # --description, -d Description (required)
44
+ # Optional flags:
45
+ # --environment, -e Environment (default: "default")
46
+ # --max-steps Max execution steps (default: 5)
47
+ # --tools Comma-separated tool names
48
+ # --input-schema JSON schema for input variables
49
+ # --output-schema JSON schema for structured output
50
+ # --output-schema-preset Predefined schema (e.g., 'finops')
51
+ # CloudShip integration:
52
+ # --app CloudShip app classification
53
+ # --app-type CloudShip app_type classification
54
+ # --memory-topic CloudShip memory topic key
55
+ # --memory-max-tokens Max tokens for memory context
56
+ # Advanced:
57
+ # --sandbox Sandbox config JSON
58
+ # --coding Coding config JSON
59
+ # --notify Enable notifications
60
+
61
+ # Examples:
62
+ stn agent create my-agent \
63
+ --prompt "You are a helpful assistant" \
64
+ --description "General purpose assistant"
65
+
66
+ stn agent create sre-helper \
67
+ --prompt "You are an SRE assistant" \
68
+ --description "SRE support with memory" \
69
+ --memory-topic "sre-incidents" \
70
+ --memory-max-tokens 4000
71
+
72
+ # LIST agents
73
+ stn agent list # All agents in default environment
74
+ stn agent list --env production # Agents in specific environment
75
+
76
+ # SHOW agent details
77
+ stn agent show <agent-name>
78
+ stn agent show my-agent --env production
79
+
80
+ # RUN an agent
81
+ stn agent run <name> "<task>" # Execute with task
82
+ stn agent run my-agent "task" --tail # Follow output in real-time
83
+ stn agent run my-agent "task" --env prod
84
+
85
+ # UPDATE agent via CLI (all flags optional)
86
+ stn agent update <name> [options]
87
+ # Uses same flags as create (all optional - only provided values updated)
88
+
89
+ # Examples:
90
+ stn agent update my-agent --prompt "New prompt" --max-steps 15
91
+ stn agent update my-agent --memory-topic "project-context"
92
+ stn agent update my-agent --notify
93
+
94
+ # Alternative: Edit .prompt file directly, then sync
95
+ nano ~/.config/station/environments/default/my-agent.prompt
96
+ stn sync default
97
+
98
+ # DELETE agent
99
+ stn agent delete <name>
100
+ stn agent delete my-agent --confirm # Skip confirmation
101
+ ```
102
+
103
+ ### Environment Management
104
+
105
+ ```bash
106
+ # Sync file configurations to database
107
+ stn sync default # Sync default environment
108
+ stn sync default --browser # Secure input for secrets (recommended for AI)
109
+ stn sync default --dry-run # Preview changes
110
+ ```
111
+
112
+ ### MCP Server Configuration
113
+
114
+ ```bash
115
+ # Add MCP server
116
+ stn mcp add <name> --command <cmd> --args "<args>"
117
+
118
+ # Examples
119
+ stn mcp add filesystem --command npx --args "-y,@modelcontextprotocol/server-filesystem,/path"
120
+ stn mcp add github --command npx --args "-y,@modelcontextprotocol/server-github" --env "GITHUB_TOKEN={{.TOKEN}}"
121
+
122
+ # Add OpenAPI spec as MCP server
123
+ stn mcp add-openapi petstore --url https://petstore3.swagger.io/api/v3/openapi.json
124
+
125
+ # List and manage
126
+ stn mcp list # List configurations
127
+ stn mcp tools # List available tools
128
+ stn mcp status # Show sync status
129
+ ```
130
+
131
+ ### Bundle Management
132
+
133
+ ```bash
134
+ # Install bundle from URL or CloudShip
135
+ stn bundle install <url-or-id> <environment>
136
+
137
+ # Create bundle from environment
138
+ stn bundle create <environment>
139
+
140
+ # Share bundle to CloudShip
141
+ stn bundle share <environment>
142
+ ```
143
+
144
+ ### Workflow Management
145
+
146
+ ```bash
147
+ # CREATE: Write YAML file (no CLI create command)
148
+ mkdir -p ~/.config/station/environments/default/workflows
149
+ cat > ~/.config/station/environments/default/workflows/my-workflow.yaml << 'EOF'
150
+ name: my-workflow
151
+ description: Example workflow
152
+ initial_state: start
153
+ states:
154
+ start:
155
+ type: agent
156
+ agent: my-agent
157
+ transitions:
158
+ - next_state: complete
159
+ complete:
160
+ type: terminal
161
+ EOF
162
+ stn sync default # Required after creating/editing
163
+
164
+ # LIST workflows
165
+ stn workflow list
166
+ stn workflow list --env production
167
+
168
+ # SHOW workflow details
169
+ stn workflow show <workflow-id>
170
+ stn workflow show <workflow-id> --verbose
171
+
172
+ # VALIDATE workflow
173
+ stn workflow validate my-workflow
174
+
175
+ # RUN workflow
176
+ stn workflow run <name>
177
+ stn workflow run <name> --input '{"key": "value"}'
178
+
179
+ # LIST workflow runs
180
+ stn workflow runs
181
+ stn workflow runs --status running
182
+
183
+ # INSPECT a run
184
+ stn workflow inspect <run-id>
185
+
186
+ # MANAGE approvals (human-in-the-loop)
187
+ stn workflow approvals list
188
+ stn workflow approvals approve <approval-id>
189
+ stn workflow approvals reject <approval-id> --reason "Not authorized"
190
+
191
+ # EXPORT workflow to file
192
+ stn workflow export <workflow-id> --output workflow.yaml
193
+
194
+ # UPDATE: Edit YAML file directly, then sync
195
+ nano ~/.config/station/environments/default/workflows/my-workflow.yaml
196
+ stn sync default
197
+
198
+ # DELETE workflow
199
+ stn workflow delete <workflow-id>
200
+ stn workflow delete --all --force # Delete all workflows
201
+ ```
202
+
203
+ ### Server & Deployment
204
+
205
+ ```bash
206
+ # Start Station server (web UI at :8585)
207
+ stn serve
208
+
209
+ # Docker container mode
210
+ stn up # Interactive setup
211
+ stn up default --yes # Use defaults
212
+ stn status # Check container status
213
+ stn logs -f # Follow logs
214
+ stn down # Stop container
215
+
216
+ # Deploy to cloud
217
+ stn deploy <environment> --target fly # Deploy to Fly.io
218
+ stn deploy production --target fly --region syd
219
+ ```
220
+
221
+ ### Runs & Inspection
222
+
223
+ ```bash
224
+ # List recent runs
225
+ stn runs list
226
+ stn runs list --limit 20
227
+
228
+ # Inspect run details
229
+ stn runs inspect <run-id>
230
+ stn runs inspect <run-id> --verbose # Full details with tool calls
231
+ ```
232
+
233
+ ### Benchmarking & Reports
234
+
235
+ ```bash
236
+ # BENCHMARK: Evaluate agent runs with LLM-as-judge
237
+ stn benchmark evaluate <run-id>
238
+ stn benchmark evaluate <run-id> --verbose # Detailed metrics
239
+ stn benchmark list # List all evaluations
240
+ stn benchmark list <run-id> # Details for specific run
241
+ stn benchmark tasks # List available benchmark tasks
242
+
243
+ # REPORTS: Environment-wide evaluation
244
+ stn report create --name "review" --environment default
245
+ stn report create -n "audit" -e prod -d "Security audit"
246
+ stn report list
247
+ stn report list --environment production
248
+ stn report generate <report-id>
249
+ stn report show <report-id>
250
+ ```
251
+
252
+ ## File Structure
253
+
254
+ Station stores configurations at `~/.config/station/`:
255
+
256
+ ```
257
+ ~/.config/station/
258
+ ├── config.yaml # Main configuration
259
+ ├── station.db # SQLite database
260
+ └── environments/
261
+ └── default/
262
+ ├── *.prompt # Agent definitions
263
+ ├── *.json # MCP server configurations
264
+ └── variables.yml # Template variable values
265
+ ```
266
+
267
+ ## Agent File Format (dotprompt)
268
+
269
+ Agents are `.prompt` files with YAML frontmatter:
270
+
271
+ ```yaml
272
+ ---
273
+ metadata:
274
+ name: "my-agent"
275
+ description: "What this agent does"
276
+ model: gpt-4o-mini
277
+ max_steps: 8
278
+ tools:
279
+ - "__tool_name" # MCP tools prefixed with __
280
+ agents:
281
+ - "child-agent-name" # Child agents (become __agent_* tools)
282
+ ---
283
+ {{role "system"}}
284
+ You are a helpful agent that [purpose].
285
+
286
+ {{role "user"}}
287
+ {{userInput}}
288
+ ```
289
+
290
+ ## Common Workflows
291
+
292
+ ### 1. Create New Agent
293
+
294
+ ```bash
295
+ # Option 1: CLI (recommended)
296
+ stn agent create my-agent \
297
+ --prompt "You are a helpful agent." \
298
+ --description "Description here"
299
+
300
+ # Option 2: File + sync
301
+ cat > ~/.config/station/environments/default/my-agent.prompt << 'EOF'
302
+ ---
303
+ metadata:
304
+ name: "my-agent"
305
+ description: "Description here"
306
+ model: gpt-4o-mini
307
+ max_steps: 5
308
+ tools: []
309
+ ---
310
+ {{role "system"}}
311
+ You are a helpful agent.
312
+
313
+ {{role "user"}}
314
+ {{userInput}}
315
+ EOF
316
+
317
+ # Sync to database (only needed for Option 2)
318
+ stn sync default
319
+
320
+ # Run it
321
+ stn agent run my-agent "Hello, what can you do?"
322
+ ```
323
+
324
+ ### 2. Add External Tools
325
+
326
+ ```bash
327
+ # Add GitHub MCP server with template variable
328
+ stn mcp add github \
329
+ --command npx \
330
+ --args "-y,@modelcontextprotocol/server-github" \
331
+ --env "GITHUB_TOKEN={{.GITHUB_TOKEN}}"
332
+
333
+ # Sync (will prompt for GITHUB_TOKEN)
334
+ stn sync default --browser
335
+
336
+ # Now agents can use __github_* tools
337
+ ```
338
+
339
+ ### 3. Deploy to Production
340
+
341
+ ```bash
342
+ # Prepare environment
343
+ stn sync production --browser
344
+
345
+ # Test locally
346
+ stn agent run my-agent "test task" --env production
347
+
348
+ # Deploy to Fly.io
349
+ stn deploy production --target fly --region ord
350
+ ```
351
+
352
+ ### 4. GitHub Actions CI/CD
353
+
354
+ Run agents in GitHub Actions workflows using [cloudshipai/station-action](https://github.com/cloudshipai/station-action):
355
+
356
+ ```yaml
357
+ # .github/workflows/ai-review.yml
358
+ name: AI Code Review
359
+
360
+ on:
361
+ pull_request:
362
+ types: [opened, synchronize]
363
+
364
+ jobs:
365
+ review:
366
+ runs-on: ubuntu-latest
367
+ permissions:
368
+ contents: read
369
+ pull-requests: write
370
+
371
+ steps:
372
+ - uses: actions/checkout@v4
373
+
374
+ - uses: cloudshipai/station-action@v1
375
+ with:
376
+ agent: 'Code Reviewer'
377
+ task: |
378
+ Review the changes in this PR. Focus on:
379
+ - Security vulnerabilities
380
+ - Performance issues
381
+ - Code quality
382
+ comment-pr: 'true'
383
+ env:
384
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
385
+ ```
386
+
387
+ **Action Inputs:**
388
+
389
+ | Input | Description | Default |
390
+ |-------|-------------|---------|
391
+ | `agent` | Agent name to run (required) | - |
392
+ | `task` | Task description (required) | - |
393
+ | `provider` | AI provider (openai, anthropic, gemini, ollama) | `openai` |
394
+ | `model` | Model override | Provider default |
395
+ | `environment` | Local environment name | `default` |
396
+ | `bundle-url` | Bundle URL to download | - |
397
+ | `timeout` | Execution timeout (seconds) | `300` |
398
+ | `max-steps` | Maximum agent steps | `50` |
399
+ | `comment-pr` | Post result as PR comment | `false` |
400
+
401
+ **Provider Examples:**
402
+
403
+ ```yaml
404
+ # Anthropic
405
+ - uses: cloudshipai/station-action@v1
406
+ with:
407
+ agent: 'My Agent'
408
+ task: 'Analyze the codebase'
409
+ provider: 'anthropic'
410
+ model: 'claude-3-5-sonnet-20241022'
411
+ env:
412
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
413
+
414
+ # Google Gemini
415
+ - uses: cloudshipai/station-action@v1
416
+ with:
417
+ agent: 'My Agent'
418
+ task: 'Analyze the codebase'
419
+ provider: 'gemini'
420
+ model: 'gemini-2.0-flash-exp'
421
+ env:
422
+ GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
423
+ ```
424
+
425
+ **Build & Release Actions:**
426
+
427
+ ```yaml
428
+ # Build bundle from environment
429
+ - uses: cloudshipai/station/.github/actions/build-bundle@main
430
+ with:
431
+ environment: 'production'
432
+ version: '1.0.0'
433
+
434
+ # Build and push Docker image
435
+ - uses: cloudshipai/station/.github/actions/build-image@main
436
+ with:
437
+ source-type: 'environment'
438
+ environment: 'production'
439
+ image-name: 'my-org/station-production'
440
+ push: 'true'
441
+ registry-username: ${{ github.actor }}
442
+ registry-password: ${{ secrets.GITHUB_TOKEN }}
443
+
444
+ # Setup Station CLI only
445
+ - uses: cloudshipai/station/.github/actions/setup-station@main
446
+ with:
447
+ version: 'latest'
448
+ env:
449
+ OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
450
+ ```
451
+
452
+ Full docs: https://docs.cloudshipai.com/station/github-actions
453
+
454
+ ## Troubleshooting
455
+
456
+ ### Agent not finding tools
457
+ ```bash
458
+ stn sync <environment> # Resync configurations
459
+ stn mcp tools # Verify tools are loaded
460
+ ```
461
+
462
+ ### View execution traces
463
+ ```bash
464
+ stn jaeger up # Start Jaeger
465
+ # Open http://localhost:16686
466
+ # Search for service: station
467
+ ```