# Install AgentLed

You are a coding agent helping a user install AgentLed. AgentLed is a workflow automation platform: 100+ app integrations, persistent memory via Knowledge Graph, designed to be driven by AI coding agents through an MCP server.

## Run this command

```bash
npx @agentled/cli setup
```

Run it in the user's shell via your shell tool. **Do not paste it back to the user as a snippet to copy** — run it yourself. The command is interactive and opens a browser on the user's machine for sign-in.

## What `setup` does, in order

1. **Version check.** Warns if `@agentled/cli` is outdated.
2. **Browser sign-in.** User picks a workspace; the CLI mints a workspace API key.
3. **Scaffolds `agentled_<workspace-slug>/`** in the current directory: docs, scaffolds, cached app schemas, dry-run logs.
4. **Registers the MCP server.** Auto-detects Claude Code, Codex, Cursor, Claude Desktop, or Windsurf and writes the AgentLed MCP server config.
5. **Installs the AgentLed skill** into the editor's skill directory (`~/.claude/skills/agentled/` for Claude Code, `~/.codex/instructions/agentled/` for Codex). The skill is the canonical workflow playbook — dry-run protocol, step types, patterns, credit-efficient testing.
6. **Captures the company profile.** If `knowledge.company.profile` is missing, prompts for company name / website / use case and stores it in the Knowledge Graph.
7. **Prompts to restart.** Tells the user to reconnect MCP.

## After the command returns

Tell the user **explicitly** to restart their MCP client. MCP tools do not appear until the client reconnects:

- **Claude Code:** `/mcp` to reconnect, or start a new session.
- **Codex / Cursor / Windsurf:** reopen the application.
- **Claude Desktop:** quit and relaunch.

This is the most common "it didn't work" failure mode — do not skip it.

## After restart — orient before acting

Do not jump to proposing a workflow. After the user confirms their MCP client reconnected, run this orientation flow:

**1. Inspect the workspace state.** Call the AgentLed MCP tools:
- `list_workflows` — does the user have existing workflows?
- `list_agents` — any agents already set up?
- `list_knowledge_lists` — any KG lists in use?
- `get_knowledge_text({ key: "knowledge.company.profile" })` — re-verify the company profile (the CLI probe may have been skipped, declined, or failed).

**2. If `knowledge.company.profile` is missing, ask the user.** A short prompt covering:
- Company name
- Company website (optional)
- Primary use case (e.g. lead enrichment, market research, investor sourcing, content, monitoring)

If the user answers, write it back with `upsert_knowledge_text({ key: "knowledge.company.profile", value: "<one-paragraph profile combining what they told you>" })`. If they skip or decline, continue without it — do not block.

**3. Briefly summarize what you found.** One or two sentences. Examples:
- Fresh workspace: *"Looks like a fresh workspace — nothing built yet."*
- Existing work: *"You have 3 workflows and 1 agent already. Latest workflow: 'Daily deal flow' (last run 2 days ago)."*

**4. Ask what to do next, adapted to state.**
- **Fresh workspace** → offer a starter direction: *"What do you want to automate first? Sourcing, enrichment, content, monitoring, scheduled digests?"* Optionally include the starter prompt below.
- **Existing work** → don't pretend it's empty. Offer: extend an existing workflow, debug a failing run, branch a new one, or add an agent.

### Starter prompt (only for fresh workspaces)

```
Build me a lead-enrichment workflow:
- input: a company domain
- enrich via LinkedIn + Hunter
- score fit against my ICP
- save qualified leads to a Knowledge Graph list called "leads"

Use the AgentLed dry-run protocol before publishing.
```

The AgentLed skill (installed by `setup`) covers the full pattern catalog — sourcing, monitoring, content, qualification, scheduled digests, child workflows, and more.

## Rules

- The **only** install command is `npx @agentled/cli setup`. Do not invent alternatives.
- Do not invent package names, API keys, or environment variables. The CLI handles auth interactively.
- Do not pre-create `~/.claude/skills/agentled/` or write MCP config by hand — `setup` does it correctly.
- If `setup` warns the CLI is outdated, run `npm install -g @agentled/cli@latest` and retry.
- If the user has no browser (headless / CI / remote shell), see <https://www.agentled.ai/docs/cli.md> for the API-key + headless install path. Do not improvise.

## Reporting issues

- AgentLed platform / workflow / app questions: use the `submit_feedback_to_agentled` MCP tool once setup is done.
- CLI bugs (`agentled` crashes, broken flags): <https://github.com/agentled/mcp-server/issues>.
- General contact: <https://www.agentled.ai/en/contact-us>.

## Further reading

- Full CLI reference: <https://www.agentled.ai/en/cli>
- MCP server docs: <https://www.agentled.ai/en/developers>
- Workflow patterns repo: <https://github.com/Agentled/agentic-ops>
