diff --git a/ai/claude-code.mdx b/ai/claude-code.mdx new file mode 100644 index 0000000..9c03f50 --- /dev/null +++ b/ai/claude-code.mdx @@ -0,0 +1,94 @@ +--- +title: Claude Code +description: The forest plugin for Claude Code — vibe-code your Forest back-office from natural language. +--- + +# Claude Code — the `forest` plugin + +The **`forest` plugin** for [Claude Code](https://docs.claude.com/en/docs/claude-code) turns natural-language requests into Forest changes. You describe what you want; Claude runs the Forest CLI to make it happen, and you review the result in the app. + +One plugin, one skill per domain — each invoked as `/forest:`. + +## Prerequisites + + + + Install [Claude Code](https://docs.claude.com/en/docs/claude-code). + + + ```bash + npm install -g forest-cli + forest login + ``` + + + +## Install the plugin + +```bash +# add the Forest Admin marketplace, then install the plugin +/plugin marketplace add forestadmin/ai-marketplace +/plugin install forest@forest-admin-ai +``` + +Then reload and check the skills are available: + +```bash +/reload-plugins +/plugin # Installed → forest → Skills +``` + +## The skills + + + + From zero to a running back-office — create a project (your database or a zero-DB demo), boot the dev agent, and (opt-in) deploy to production and invite your team. + + + Build the UI as code — workspaces with master→detail components, dashboards & charts, collection display, and folders. + + + Author workflows from a declarative `steps` spec — the skill compiles them to BPMN and deploys them, editable afterwards in the UI. + + + Administer the project — roles (RBAC as code), users, teams, environments, branches, and production deploys. + + + +## Example prompts + +Just describe the outcome — the skill picks the right commands: + +- **Onboard** — *"Create me a Forest demo and start it."* +- **Layout** — *"Add an 'AML Review' workspace: the list of AML alerts, and when I select one, the related customer's details below it."* +- **Workflows** — *"Add a refund approval workflow on refund_requests: review → approve/reject → if approved, mark refunded → end."* +- **Management** — *"Invite alice@acme.co as an editor on the Support team."* + +## The loop + + + + Tell Claude the outcome you want, in plain language. + + + The skill shows the plan (and supports `--dry-run` on the underlying commands) before sending anything. + + + Claude runs the CLI — creating the workspace, compiling the workflow, applying the layout… + + + Open the result in the Forest app, or pull it back as code (`forest layout pull`). Iterate by asking for changes. + + + +## How it works + +The plugin is a thin layer over the [Forest CLI](/reference/cli/overview): each skill resolves your intent into deterministic `forest` commands (`projects:create:*`, `layout:*`, `workflow:apply`, `roles:*`/`users:*`/`teams:*`, `environments:*`). Because the output is CLI calls and JSON (`forest-layout.json`, workflow BPMN, role CSVs), everything is versionable and reproducible. + + +Working on a `development` environment? Layout and workflow edits need a branch first (`forest branch `) — the skills handle this. A zero-DB `create:demo` project accepts direct edits without a branch. + + + +For writing agent code (Smart Actions, computed fields, hooks) use the companion **forest-code** plugin; for querying/manipulating data from an agent, see [MCP](/ai/mcp). + diff --git a/ai/mcp.mdx b/ai/mcp.mdx new file mode 100644 index 0000000..57246ea --- /dev/null +++ b/ai/mcp.mdx @@ -0,0 +1,53 @@ +--- +title: MCP +description: Expose your Forest Admin project to AI agents over the Model Context Protocol — query and manipulate data, run actions, inspect the schema. +--- + +# MCP — the Forest MCP server + +The **Forest MCP server** exposes your Forest project to any [Model Context Protocol](https://modelcontextprotocol.io) client (Claude, IDE agents, your own tools). Where the [`forest` plugin](/ai/claude-code) *builds* your back-office, MCP lets an agent *operate* on it — the same data and actions your team uses, through a governed interface. + +## What an agent can do + + + + List and search records, follow relationships, and read a single record. + + + Create, update, and delete records, and associate/dissociate relationships. + + + Run your collection's **Smart Actions** — the same business operations exposed in the UI. + + + Describe collections, fields, and relationships so the agent can reason about your schema. + + + +## Governed by your permissions + +The MCP server acts **within Forest's authorization model** — an agent only sees and does what the authenticated scope is allowed to. Roles, scopes and permissions apply exactly as they do in the app, so exposing Forest over MCP doesn't widen access. + + +Giving an agent write and action access to production data is powerful. Start against a non-production environment, and scope the agent to a role with the minimum permissions it needs. + + +## Connecting + +Add the Forest MCP server to your MCP client (for example, as a connector in Claude). It's distributed as the **`forest-mcp`** plugin in the Forest Admin marketplace: + +```bash +/plugin marketplace add forestadmin/ai-marketplace +/plugin install forest-mcp@forest-admin-ai +``` + + +Setup specifics (authentication, selecting the project/environment) are covered by the `forest-mcp` plugin. This page describes what the server enables; follow the plugin for exact connection steps. + + +## When to use MCP vs the plugin + +| Goal | Use | +|---|---| +| Let an agent **read/write data or run actions** on an existing back-office | **MCP** (this page) | +| **Build or configure** the back-office itself (layout, workflows, roles, onboarding) | [`forest` plugin](/ai/claude-code) | diff --git a/ai/overview.mdx b/ai/overview.mdx new file mode 100644 index 0000000..d42bff3 --- /dev/null +++ b/ai/overview.mdx @@ -0,0 +1,40 @@ +--- +title: AI & MCP +description: Drive Forest Admin with AI — build and operate your back-office from Claude, and expose it to your own agents over MCP. +--- + +# AI & MCP + +Forest Admin is drivable by AI, in two complementary ways: + + + + Describe what you want in plain language; Claude runs the Forest CLI to build it — onboarding, UI/layout, workflows, and administration. **Vibe-code your back-office.** + + + Expose your Forest project's data and actions to any MCP-compatible agent — query records, create/update/delete, run Smart Actions, inspect the schema. + + + +## Which one do I use? + +| You want to… | Use | +|---|---| +| **Build or configure** Forest (create a project, lay out a workspace, author a workflow, manage roles/teams) | **Claude Code** — the [`forest` plugin](/ai/claude-code) | +| **Operate on your data** from an agent (read/write records, run actions) | **MCP** — the [Forest MCP server](/ai/mcp) | + +Both talk to Forest through interfaces you already have — the plugin orchestrates the [CLI](/reference/cli/overview); MCP speaks the Model Context Protocol. No UI required. + +## The idea + +Everything you do in the Forest UI can be done **headlessly** — and therefore **driven by an AI**: + +- **Layout as code** — collections display, workspaces (master→detail), dashboards, folders. +- **Workflows as code** — author a process from a declarative `steps` spec; it compiles to BPMN. +- **Administration as code** — roles (RBAC as CSV), users, teams, environments, deploy. + +Claude composes these from natural language; you review the result in the app. Because it all maps to CLI commands and JSON, it's **versionable, reviewable, and reproducible**. + + +These capabilities are rolling out. The `forest` Claude Code plugin ships onboarding today, with layout, workflows and management skills in the same plugin. + diff --git a/docs.json b/docs.json index 29b1f58..7fe7d3e 100644 --- a/docs.json +++ b/docs.json @@ -304,6 +304,19 @@ } ] }, + { + "tab": "AI & MCP", + "groups": [ + { + "group": "AI & MCP", + "pages": [ + "ai/overview", + "ai/claude-code", + "ai/mcp" + ] + } + ] + }, { "tab": "Reference", "groups": [ @@ -343,10 +356,70 @@ "reference/cli/overview", "reference/cli/init", "reference/cli/login", - "reference/cli/branch", - "reference/cli/push", - "reference/cli/deploy", - "reference/cli/switch" + { + "group": "Branches & deployment", + "pages": [ + "reference/cli/branch", + "reference/cli/switch", + "reference/cli/push", + "reference/cli/deploy" + ] + }, + { + "group": "Projects", + "pages": [ + "reference/cli/projects-create-demo", + "reference/cli/projects-create-sql", + "reference/cli/projects-create-nosql" + ] + }, + { + "group": "Layout", + "pages": [ + "reference/cli/layout-pull", + "reference/cli/layout-apply", + "reference/cli/layout-patch" + ] + }, + { + "group": "Workflows", + "pages": ["reference/cli/workflow-apply"] + }, + { + "group": "Environments", + "pages": [ + "reference/cli/environments-create", + "reference/cli/environments-get", + "reference/cli/environments-update", + "reference/cli/environments-delete", + "reference/cli/environments-reset" + ] + }, + { + "group": "Roles", + "pages": [ + "reference/cli/roles-create", + "reference/cli/roles-apply", + "reference/cli/roles-copy", + "reference/cli/roles-export" + ] + }, + { + "group": "Teams", + "pages": [ + "reference/cli/teams-create", + "reference/cli/teams-delete", + "reference/cli/teams-copy-layout" + ] + }, + { + "group": "Users", + "pages": [ + "reference/cli/users-list", + "reference/cli/users-invite", + "reference/cli/users-edit" + ] + } ] }, { diff --git a/reference/cli/environments-create.mdx b/reference/cli/environments-create.mdx new file mode 100644 index 0000000..6a3290a --- /dev/null +++ b/reference/cli/environments-create.mdx @@ -0,0 +1,26 @@ +--- +title: forest environments:create +description: "Create a new environment" +--- + +# forest environments:create + +Create a new environment. + +## Usage + +```bash +forest environments:create [options] +``` + +## Options + +| Option | Description | +|---|---| +| `-f, --format=