@agent-compose/cli 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/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@agent-compose/cli",
3
+ "version": "0.1.0",
4
+ "description": "Command-line interface for agent-compose — register, invoke, and monitor workflows from your terminal.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Layr-Labs/agent-compose.git",
9
+ "directory": "cli"
10
+ },
11
+ "homepage": "https://github.com/Layr-Labs/agent-compose/tree/master/cli#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/Layr-Labs/agent-compose/issues"
14
+ },
15
+ "keywords": [
16
+ "agent-compose",
17
+ "cli",
18
+ "agent",
19
+ "workflow",
20
+ "ai",
21
+ "llm",
22
+ "sandbox"
23
+ ],
24
+ "type": "module",
25
+ "bin": {
26
+ "agentc": "./dist/index.js"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "skills",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "scripts": {
38
+ "typecheck": "tsc --noEmit",
39
+ "test": "bun test src/__tests__",
40
+ "build": "bun run clean && bun run build:js && bun run build:chmod",
41
+ "build:js": "bun build src/index.ts --outdir dist --target node --format esm --packages external --banner='#!/usr/bin/env node'",
42
+ "build:chmod": "chmod +x dist/index.js",
43
+ "clean": "rm -rf dist",
44
+ "prepublishOnly": "bun run build"
45
+ },
46
+ "dependencies": {
47
+ "@agent-compose/sdk": "^0.1.0",
48
+ "commander": "^12.0.0",
49
+ "picocolors": "^1.1.1"
50
+ },
51
+ "devDependencies": {
52
+ "bun-types": "latest",
53
+ "typescript": "^5.8.0"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ }
58
+ }
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: ac:demo
3
+ description: First-run walkthrough — verify auth, scaffold a sample workflow, register it, invoke, and watch the agent run live.
4
+ effort: high
5
+ allowed-tools: Bash(agentc *) Bash(git *) Bash(open *) Read Write Edit
6
+ ---
7
+
8
+ # Demo — agent-compose
9
+
10
+ A guided first-run walkthrough. Verify auth, generate a tiny sample
11
+ workflow, register it, dispatch it, and watch a single agent loop run
12
+ end-to-end. Should take ~5 minutes against the hosted server (a bit
13
+ longer locally — the runner sandbox boots fresh).
14
+
15
+ ## Context
16
+
17
+ ```
18
+ !`agentc auth status`
19
+ ```
20
+
21
+ If the line above shows no API key, run `/ac:setup` first (sign in to
22
+ the dashboard, mint an `ac_…` key, `agentc auth login <key>`). That
23
+ skill walks the full bootstrap.
24
+
25
+ ## Steps
26
+
27
+ ### 1. Briefly explain the model
28
+
29
+ Make sure the user understands the three primitives before you start
30
+ typing. Keep it brief — they can read [`docs/how-it-works.md`](../../docs/how-it-works.md)
31
+ for the full version.
32
+
33
+ > **Workflow** — `async (ctx, sandbox) => T`. The function you author.
34
+ > Owns the run end-to-end: orchestrates phases, kicks off agent loops,
35
+ > writes metadata, returns a structured result.
36
+
37
+ > **Agent loop** — `runAgent({ runtime, prompt, ... })`. Embedded inside
38
+ > the workflow body. Drives one iteration cycle of an LLM agent against
39
+ > the runner sandbox until the model emits `exit_signal: true` (or
40
+ > hits the iteration budget).
41
+
42
+ > **Runtime** — `claudeRuntime` (built-in) wraps the Claude CLI.
43
+ > `openAIDesktopRuntime` wraps OpenAI computer-use. You can write your
44
+ > own with `defineRuntime`.
45
+
46
+ ### 2. Scaffold a sample workflow
47
+
48
+ Create a temporary `hello-agent.ts` next to where the user wants to
49
+ work. Keep it minimal — one phase, no fancy plumbing:
50
+
51
+ ```ts
52
+ // hello-agent.ts
53
+ import { defineWorkflow, runAgent, claudeRuntime } from "@agent-compose/sdk";
54
+
55
+ const PROMPT = `
56
+ You're verifying agent-compose is wired up correctly.
57
+
58
+ Run \`echo "hello from sandbox $(hostname)"\` once, then emit a
59
+ <status> block with summary describing what you observed and
60
+ exit_signal: true.
61
+ `;
62
+
63
+ export default defineWorkflow({
64
+ async run(ctx, sandbox) {
65
+ const result = await runAgent({
66
+ sandbox,
67
+ runtime: claudeRuntime,
68
+ prompt: PROMPT,
69
+ tools: ["Bash"],
70
+ budget: { turnsPerIteration: 6, maxIterations: 1 },
71
+ });
72
+ await ctx.setMetadata({ summary: result.status?.summary });
73
+ return { ok: !!result.status?.completed, summary: result.status?.summary };
74
+ },
75
+ });
76
+ ```
77
+
78
+ Walk the user through the file — point at `ctx`, `sandbox`,
79
+ `runAgent`, the prompt, the tool allowlist, the budget. Confirm before
80
+ writing.
81
+
82
+ ### 3. Register
83
+
84
+ ```bash
85
+ agentc register hello-agent.ts
86
+ ```
87
+
88
+ > "The CLI bundles the workflow source + the runtime source via
89
+ > `bundleWorkflow`, then POSTs to `/api/v1/templates`. Once registered,
90
+ > anyone with an `invoke`-scoped API key can call it."
91
+
92
+ ### 4. Invoke and watch live
93
+
94
+ ```bash
95
+ agentc invoke hello-agent --follow
96
+ ```
97
+
98
+ > "The server creates a runner sandbox, drops the bundle in, and starts
99
+ > Node. Inside the sandbox, our workflow runs `runAgent` once — Claude
100
+ > spawns, runs the bash command, emits its `<status>`, and exits.
101
+ > Server marks the run complete; the CLI prints the final outcome and
102
+ > elapsed time."
103
+
104
+ Watch the SSE-streamed events together — point out:
105
+ - `step_started` / `step_completed` (timeline phases).
106
+ - `agent_event` lines (model output streaming live).
107
+ - `run_complete` with elapsed time.
108
+
109
+ ### 5. Browse the run in the dashboard
110
+
111
+ Once the run finishes, open the run detail page:
112
+
113
+ ```bash
114
+ # pull the dashboard URL from auth status; substitute the run id
115
+ open "$(agentc auth status | awk '/^Dashboard:/ {print $2}')/workflows/<run-id>"
116
+ ```
117
+
118
+ The dashboard shows the same lifecycle events plus the captured
119
+ artifacts (logs, metadata) the workflow emitted.
120
+
121
+ ### 6. What to build next
122
+
123
+ > "That was the simplest possible workflow. To go further:"
124
+ >
125
+ > - `/ac:generate-workflow` — describe a multi-phase workflow in plain
126
+ > English; Claude scaffolds the full file with `runAgent` blocks per phase.
127
+ > - `/ac:generate-agent` — scaffold one phase's prompt + `runAgent` snippet
128
+ > to slot into an existing workflow.
129
+ > - `/ac:generate-runtime` — write a custom runtime for a model the SDK
130
+ > doesn't ship.
131
+ > - Read [`docs/how-it-works.md`](../../docs/how-it-works.md) for the
132
+ > multi-agent example (plan + parallel implementers).
133
+
134
+ Clean up: `rm hello-agent.ts` (or keep it as a reference).
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: ac:generate-agent
3
+ description: Scaffold a `runAgent` block + prompt for one agent loop inside a workflow.
4
+ allowed-tools: Read Write Edit Bash(bunx *) Bash(bun *)
5
+ effort: high
6
+ ---
7
+
8
+ # Generate Agent
9
+
10
+ Interactively scaffold a single agent loop — a `runAgent({ ... })` call
11
+ plus its `prompt.md` — to drop into an existing workflow.
12
+
13
+ > **Mental model.** There is no standalone "agent" resource. Agents live
14
+ > *inside* workflows via `runAgent`. Each `runAgent` call drives one
15
+ > iteration loop with a runtime, prompt, tool allowlist, and budget.
16
+ > Multiple `runAgent` calls compose by sequencing (`await`) or by
17
+ > fanning out (`Promise.all`).
18
+
19
+ ## Steps
20
+
21
+ 1. Ask the user:
22
+ - What's the agent's role in the workflow? (one phase: plan, implement, review, summarize, …)
23
+ - Where does this fit — inside an existing workflow file, or scaffold a new one?
24
+ - Runtime? (default: `claudeRuntime`. Use `openAIDesktopRuntime` for desktop / computer-use.)
25
+ - Tools? (e.g. `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`, `WebFetch`)
26
+ - Budget? Suggest `{ turnsPerIteration: 30-60, maxIterations: 4-8 }` based on complexity.
27
+ - Typed response? If yes, sketch a zod schema — `runAgent({ responseSchema })`
28
+ makes the loop demand a `<response>` block that validates against it.
29
+ - Prompt directory? (default: alongside the workflow file)
30
+
31
+ 2. If the user has an existing workflow with a `runAgent` block, read it
32
+ to match their conventions — prompt template structure, `promptVars`,
33
+ tool sets, error handling. Otherwise follow the patterns in
34
+ `sdk/src/runtimes/claude.ts` and the SDK's [README](../../sdk/README.md).
35
+
36
+ 3. Generate two files:
37
+
38
+ **`<dir>/<phase>.md`** — the prompt. Write a real, detailed prompt:
39
+ - Role definition + context the model will receive.
40
+ - Available tools + when to use each.
41
+ - Step-by-step instructions for the phase.
42
+ - The `<status>` protocol is auto-appended; don't include it manually.
43
+ - Use `{{VAR}}` placeholders for runtime substitution (`WORKING_DIR`,
44
+ `DIFF_BASE`, plus any `promptVars` the workflow passes in).
45
+
46
+ **Snippet to paste into the workflow body:**
47
+
48
+ ```ts
49
+ import PROMPT from "./<phase>.md" with { type: "text" };
50
+ // …in the workflow's run():
51
+ const result = await runAgent({
52
+ sandbox,
53
+ runtime: claudeRuntime,
54
+ prompt: PROMPT,
55
+ promptVars: { /* … */ },
56
+ tools: [/* … */],
57
+ budget: { turnsPerIteration: 40, maxIterations: 6 },
58
+ // responseSchema: MySchema, // when typed handoff is needed
59
+ });
60
+ if (!result.status?.completed) return { ok: false, blockers: result.status?.blockers };
61
+ ```
62
+
63
+ 4. Show the prompt + snippet and confirm before writing.
64
+
65
+ 5. Write the prompt file. Show the user the snippet to integrate (don't
66
+ silently splice into their workflow file — that risks corrupting their
67
+ pipeline).
68
+
69
+ 6. Suggest the user run `bun run typecheck` (or their project's
70
+ equivalent) and re-register via `agentc register <workflow.ts>`.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: ac:generate-runtime
3
+ description: Scaffold a new agent-compose runtime from a plain-English description.
4
+ allowed-tools: Read Write Edit Bash(bunx *) Bash(bun *)
5
+ effort: high
6
+ ---
7
+
8
+ # Generate Runtime
9
+
10
+ Scaffold a new runtime that drives a model in a sandbox.
11
+
12
+ ## Context
13
+
14
+ Existing runtimes:
15
+ ```
16
+ !`ls sdk/src/runtimes/ 2>/dev/null`
17
+ ```
18
+
19
+ ## Steps
20
+
21
+ 1. Ask the user:
22
+ - What model or API does this runtime drive?
23
+ - Runtime name? (camelCase, e.g. `gptRuntime`)
24
+ - Does it need desktop/GUI access? (determines SandboxProvider type)
25
+ - Where to create it? (default: `sdk/src/runtimes/`)
26
+
27
+ 2. Read `sdk/src/runtimes/claude.ts` to understand the full pattern — `ModelExecutionContract`, sandbox interaction, stdout parsing.
28
+
29
+ 3. Read `sdk/src/types/runtime.ts` for the `AgentRuntime` interface.
30
+
31
+ 4. Generate the runtime file implementing `ModelExecutionContract.sendMessage()`. It must:
32
+ - Accept a `SandboxProvider` and `RuntimeOptions`
33
+ - Run the model (subprocess, API call, or GUI control)
34
+ - Parse output into `AgentMessage` events
35
+ - Export a default singleton and a factory function
36
+
37
+ 5. Show the generated file and ask the user to confirm before writing.
38
+
39
+ 6. Write the file, then run `bunx tsc --noEmit` from the repo root to validate.
40
+
41
+ 7. Tell the user to export the runtime from `sdk/src/index.ts`.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: ac:generate-workflow
3
+ description: Scaffold a new agent-compose workflow from a plain-English description.
4
+ allowed-tools: Read Write Edit Bash(bunx *) Bash(bun *)
5
+ effort: high
6
+ ---
7
+
8
+ # Generate Workflow
9
+
10
+ Interactively scaffold a new workflow from a plain-English description.
11
+
12
+ > **Mental model.** A workflow is `async (ctx, sandbox) => T`. The `ctx`
13
+ > exposes `run`, `input?`, `setMetadata`, and `step` (for named timeline
14
+ > phases). The `sandbox` is the runner's own VM — pass it to
15
+ > `runAgent({ sandbox, ... })` and to any helper that takes a
16
+ > `SandboxProvider`. Agent loops live *inside* the workflow body via
17
+ > `runAgent`. There's no `defineAgent` / `spawnAgent` model anymore.
18
+
19
+ ## Steps
20
+
21
+ 1. Ask the user:
22
+ - What should this workflow do? (plain English — describe the
23
+ phases, their inputs/outputs, and any external calls.)
24
+ - Workflow name? (kebab-case, e.g. `code-review`)
25
+ - Where to create it? (project-relative path, e.g. `src/workflows/`)
26
+ - Runtime for agent loops? (default `claudeRuntime`)
27
+ - Network policy needed? (which domains + which secrets to inject?)
28
+ - Snapshot on success? (default off; on for setup/environment
29
+ workflows whose end-state other workflows boot from)
30
+
31
+ 2. If the user has a reference workflow in their project, read it to
32
+ match their conventions (prompt structure, `promptVars` shape,
33
+ error handling). Otherwise follow the patterns in
34
+ [`sdk/README.md`](../../sdk/README.md) and the example in
35
+ [`docs/how-it-works.md`](../../docs/how-it-works.md).
36
+
37
+ 3. Generate a complete, real implementation:
38
+
39
+ ```ts
40
+ import { defineWorkflow, runAgent, claudeRuntime } from "@agent-compose/sdk";
41
+ import PROMPT from "./prompt.md" with { type: "text" };
42
+
43
+ export default defineWorkflow({
44
+ async run(ctx, sandbox) {
45
+ // Phase 1 — wrap any non-agent setup in ctx.step() so it shows
46
+ // up on the timeline with its own duration:
47
+ const data = await ctx.step("fetch-input", async () => {
48
+ // pure-server work, fetches, etc.
49
+ });
50
+
51
+ // Phase 2 — agent loop. Each `runAgent` is one iteration cycle
52
+ // with its own prompt + tool allowlist + budget.
53
+ const result = await runAgent({
54
+ sandbox,
55
+ runtime: claudeRuntime,
56
+ prompt: PROMPT,
57
+ promptVars: { /* {{VAR}} substitutions */ },
58
+ tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
59
+ budget: { turnsPerIteration: 40, maxIterations: 6 },
60
+ // responseSchema: MyZodSchema, // for typed handoffs
61
+ });
62
+
63
+ await ctx.setMetadata({ summary: result.status?.summary });
64
+ return { ok: !!result.status?.completed };
65
+ },
66
+ // Optional metadata picked up by the bundler at registration time:
67
+ // networkPolicy: { allow: { /* … */ } },
68
+ // placeholders: { /* env-var formats for brokered secrets */ },
69
+ // snapshot: "<other-workflow>", // boot from a snapshot
70
+ // snapshot: true, // capture-on-success default
71
+ });
72
+ ```
73
+
74
+ - Always declare the return type (or let TS infer + show it on hover).
75
+ - Use `Promise.all` to fan out independent `runAgent` calls.
76
+ - Use `ctx.step("phase-name", () => …)` for any named non-agent phase.
77
+
78
+ 4. Show the complete file plus a separate `prompt.md` (or per-phase
79
+ prompts) and confirm before writing.
80
+
81
+ 5. Write the files, then suggest the user run `bun run typecheck` (or
82
+ their project's equivalent) to validate.
83
+
84
+ 6. Tell the user: `agentc register <path>` to register, then
85
+ `agentc invoke <name> --follow` to test.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: ac:invoke
3
+ description: Invoke a registered workflow and stream its live output.
4
+ argument-hint: <workflow-name> [--input '{"key":"value"}']
5
+ allowed-tools: Bash(agentc *)
6
+ ---
7
+
8
+ # Invoke Workflow
9
+
10
+ ## Context
11
+
12
+ Registered workflows:
13
+ ```
14
+ !`agentc list 2>/dev/null`
15
+ ```
16
+
17
+ ## Instructions
18
+
19
+ The user wants to invoke: **$ARGUMENTS**
20
+
21
+ If the line above is blank, ask which workflow to invoke. Use the registered workflows list above as suggestions.
22
+
23
+ Once you have the workflow name, dispatch it:
24
+
25
+ ```bash
26
+ agentc invoke <name> --follow
27
+ ```
28
+
29
+ ## Output
30
+
31
+ Stream events as they arrive. When complete, report:
32
+ - Final outcome (success / failed)
33
+ - Final wall time (`run_complete` includes elapsed seconds)
34
+ - Any PR URL, plan URL, or artifact produced (visible in the streamed events
35
+ or via `agentc logs <run-id>` after the fact)
36
+
37
+ ## Next Steps
38
+
39
+ - **Success** → Report the outcome and any output.
40
+ - **Failed** → Show the failure reason. Offer to debug: "Run `/ac:logs <run-id>` for the full event log."
41
+ - **Secrets missing** → "Run `/ac:secrets set <workflow> <KEY> <value>` to configure the required secret."
42
+ - **Template not found** → "Run `/ac:register <workflow.ts>` to register it first."
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: ac:logs
3
+ description: Stream live or historical events for a workflow run.
4
+ argument-hint: [run-id]
5
+ allowed-tools: Bash(agentc *)
6
+ ---
7
+
8
+ # Stream Run Logs
9
+
10
+ ## Context
11
+
12
+ The CLI doesn't ship a "list runs" subcommand — to find a run id, dispatch
13
+ a workflow with `agentc invoke <name>` (it prints the id) or browse the
14
+ dashboard's Workflows page.
15
+
16
+ ## Instructions
17
+
18
+ The user wants to stream logs for: **$ARGUMENTS**
19
+
20
+ If `$ARGUMENTS` is blank, ask the user for a run id (UUID).
21
+
22
+ Once you have the run id, stream it:
23
+
24
+ ```bash
25
+ agentc logs <run-id>
26
+ ```
27
+
28
+ ## Output
29
+
30
+ Show events as they stream — agent turns, tool calls, step transitions,
31
+ and the final `run_complete` (with elapsed wall time) or `run_failed`
32
+ (with reason).
33
+
34
+ ## Next Steps
35
+
36
+ - **Run still active** → Logs stream live until the run completes.
37
+ - **Run failed** → Identify the failure reason and suggest a fix.
38
+ - **Run not found** → The id may be wrong. Find recent runs from the
39
+ dashboard's Workflows page or grab the id printed by `agentc invoke`.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: ac:register-invoke
3
+ description: Register a workflow then immediately invoke it. Useful during development to test changes without separate steps.
4
+ argument-hint: <workflow.ts> [--input '{"key":"value"}']
5
+ allowed-tools: Bash(agentc *)
6
+ ---
7
+
8
+ # Register and Invoke
9
+
10
+ Register the workflow at `$0`, then invoke it.
11
+
12
+ ## Plan
13
+
14
+ ```bash
15
+ agentc register $0
16
+ agentc invoke $(basename "$0" .ts) --follow $1
17
+ ```
18
+
19
+ If `$ARGUMENTS` is empty, ask for the workflow path first.
20
+
21
+ ## Output
22
+
23
+ Show register output, then stream the run. When complete, report outcome and any artifacts.
24
+
25
+ ## Next Steps
26
+
27
+ - **Registration failed** → Fix the error and re-run.
28
+ - **Run failed** → Show failure reason from the final event. Offer `/ac:logs <run-id>`.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: ac:register
3
+ description: Bundle and register a workflow (and its agents) with the agent-compose server.
4
+ argument-hint: <workflow.ts>
5
+ allowed-tools: Bash(agentc *) Bash(bun *)
6
+ ---
7
+
8
+ # Register Workflow
9
+
10
+ ## Context
11
+
12
+ Registered workflows:
13
+ ```
14
+ !`agentc list 2>/dev/null`
15
+ ```
16
+
17
+ Current branch: !`git branch --show-current`
18
+
19
+ ## Instructions
20
+
21
+ The user wants to register: **$ARGUMENTS**
22
+
23
+ If the line above is blank, ask the user which workflow file to register before proceeding.
24
+
25
+ Once you have the path, bundle and register it:
26
+
27
+ ```bash
28
+ agentc register <path>
29
+ ```
30
+
31
+ ## Output
32
+
33
+ Confirm:
34
+ - Workflow name and version registered
35
+ - Which runtime sources were inlined into the bundle
36
+
37
+ ## Next Steps
38
+
39
+ - **Success** → "Registered. Run `/ac:invoke <name>` to test it."
40
+ - **Bundle failed** → Re-read the bundler error; usually a missing import path
41
+ or a runtime that couldn't be resolved.
42
+ - **Validation error** → Fix the reported issue in the source file and re-run.
43
+ - **Server not running** → from this repo's root, `bun --cwd server run dev`.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: ac:secrets
3
+ description: Manage per-workflow secrets in GCP Secret Manager. Values are injected at the network layer — never readable inside the sandbox.
4
+ argument-hint: <set|list|delete> <workflow> [key] [value]
5
+ allowed-tools: Bash(agentc secrets *)
6
+ ---
7
+
8
+ # Workflow Secrets
9
+
10
+ Secret values are stored in GCP Secret Manager and injected by the Vercel firewall at runtime — they never exist as readable env vars inside the sandbox.
11
+
12
+ > **Never echo secret values** back in conversation text or summaries. Show key names and metadata only.
13
+
14
+ ## Context
15
+
16
+ Registered workflows:
17
+ ```
18
+ !`agentc list 2>/dev/null | awk '{print $1}'`
19
+ ```
20
+
21
+ ## Plan
22
+
23
+ Based on `$ARGUMENTS`:
24
+
25
+ | Arguments | Action |
26
+ |---|---|
27
+ | `set <workflow> <key> <value>` | Create or update a secret |
28
+ | `list <workflow>` | List key names (no values) |
29
+ | `delete <workflow> <key>` | Delete a secret |
30
+ | *(none)* | Ask which workflow and action |
31
+
32
+ ```bash
33
+ agentc secrets $ARGUMENTS
34
+ ```
35
+
36
+ For `delete`: confirm with the user before running — "Delete `<key>` from `<workflow>`? Runs depending on it will fail."
37
+
38
+ ## Next Steps
39
+
40
+ - **After set** → "Secret saved. Re-register the workflow if the network policy changed."
41
+ - **After delete** → "Secret removed. Any future run will not have `<key>` available."
42
+ - **GCP auth error** → Run `gcloud auth application-default login` and check `GCP_PROJECT_ID` in `server/.env.local`.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: ac:setup
3
+ description: First-time setup — install the CLI, authenticate, and verify the connection.
4
+ allowed-tools: Bash(agentc *) Bash(bun *) Bash(source *) Bash(curl *)
5
+ ---
6
+
7
+ # Setup — agent-compose
8
+
9
+ ## Pre-check
10
+
11
+ ```
12
+ !`agentc auth status 2>/dev/null`
13
+ ```
14
+
15
+ Use the output above to skip steps that are already done.
16
+
17
+ ## Steps
18
+
19
+ ### 1. Install the CLI (skip if `which agentc` found it)
20
+
21
+ ```bash
22
+ cd cli && bun link
23
+ ```
24
+
25
+ Then reload the shell:
26
+
27
+ ```bash
28
+ source ~/.zshrc
29
+ ```
30
+
31
+ Verify: `agentc --version`
32
+
33
+ ### 2. Install skills
34
+
35
+ ```bash
36
+ agentc init
37
+ ```
38
+
39
+ This installs all `/ac:*` slash commands into Claude Code.
40
+
41
+ ### 3. Authenticate (skip if auth status shows an API key)
42
+
43
+ Open the dashboard URL from `agentc auth status` in a browser
44
+ (prod: `https://platform.agentcompose.ai`; local dev: `http://localhost:3000`)
45
+ and add `/login`. Enter your email; click the magic-link in the email we
46
+ send. A personal team is auto-created on first sign-in and you become
47
+ its owner. Mint your CLI key from **Settings → API Keys → Create key**:
48
+
49
+ - Defaults are `read+invoke` — right for the typical CLI / CI caller.
50
+ - Tick `admin` only if this key needs to mint other keys, register templates,
51
+ or manage workflow secrets.
52
+ - The `ac_…` value is shown once in the reveal dialog. Copy it immediately.
53
+
54
+ Save the key locally:
55
+
56
+ ```bash
57
+ agentc auth login <pasted-key>
58
+ ```
59
+
60
+ Verify:
61
+
62
+ ```bash
63
+ agentc auth status
64
+ ```
65
+
66
+ Should show the server URL and `API key: set`. (The `Env:` line only
67
+ appears if the project's `.agentc/settings.json` defines a named
68
+ environment — see step below if you want to pin one.)
69
+
70
+ > Scoped keys (read-only, invoke-only, admin-only) or keys that auto-expire
71
+ > can also be minted from the CLI by anyone with an admin-scoped caller key:
72
+ > `agentc keys create <name> --scopes ... --expires-in ... --admin-key ac_…`.
73
+ > The CLI default with no `--scopes` flag is **full team access**; pass
74
+ > `--scopes read,invoke` for least-privilege CI keys. See `/ac:dev-setup`
75
+ > for the full flag reference.
76
+
77
+ ### 4. Verify the connection
78
+
79
+ ```bash
80
+ agentc list
81
+ ```
82
+
83
+ This lists registered workflows. If it returns without error, setup is complete.
84
+
85
+ ### 5. Done
86
+
87
+ > "You're all set. Here's what you can do now:"
88
+ >
89
+ > - `/ac:demo` — watch AI agents build a browser game end-to-end
90
+ > - `agentc invoke <workflow> --follow` — run any registered workflow
91
+ > - `/ac:generate-workflow` — build your own workflow from a description