-
Notifications
You must be signed in to change notification settings - Fork 0
docs: headless & AI — CLI reference for the new commands + AI & MCP tab #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gawtier
wants to merge
4
commits into
main
Choose a base branch
from
docs/cli-reference-headless-commands
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fad27c4
docs(cli): document the headless commands (projects/layout/workflow/r…
27a8b14
docs(cli): one page per category (not per command); drop non-existent…
23d6188
docs(cli): per-command pages everywhere + grouped nav (coherent with …
62dc819
docs(ai): add AI & MCP tab (Claude Code plugin + Forest MCP server)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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:<skill>`. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| <Steps> | ||
| <Step title="Claude Code"> | ||
| Install [Claude Code](https://docs.claude.com/en/docs/claude-code). | ||
| </Step> | ||
| <Step title="Forest CLI, logged in"> | ||
| ```bash | ||
| npm install -g forest-cli | ||
| forest login | ||
| ``` | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| ## 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 | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card title="/forest:onboard" icon="rocket"> | ||
| 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. | ||
| </Card> | ||
| <Card title="/forest:layout" icon="table-cells"> | ||
| Build the UI as code — workspaces with master→detail components, dashboards & charts, collection display, and folders. | ||
| </Card> | ||
| <Card title="/forest:workflows" icon="diagram-project"> | ||
| Author workflows from a declarative `steps` spec — the skill compiles them to BPMN and deploys them, editable afterwards in the UI. | ||
| </Card> | ||
| <Card title="/forest:management" icon="users-gear"> | ||
| Administer the project — roles (RBAC as code), users, teams, environments, branches, and production deploys. | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## 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 | ||
|
|
||
| <Steps> | ||
| <Step title="Describe"> | ||
| Tell Claude the outcome you want, in plain language. | ||
| </Step> | ||
| <Step title="Preview"> | ||
| The skill shows the plan (and supports `--dry-run` on the underlying commands) before sending anything. | ||
| </Step> | ||
| <Step title="Apply"> | ||
| Claude runs the CLI — creating the workspace, compiling the workflow, applying the layout… | ||
| </Step> | ||
| <Step title="Review"> | ||
| Open the result in the Forest app, or pull it back as code (`forest layout pull`). Iterate by asking for changes. | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| ## 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. | ||
|
|
||
| <Tip> | ||
| Working on a `development` environment? Layout and workflow edits need a branch first (`forest branch <name>`) — the skills handle this. A zero-DB `create:demo` project accepts direct edits without a branch. | ||
| </Tip> | ||
|
|
||
| <Info> | ||
| 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). | ||
| </Info> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card title="Read" icon="magnifying-glass"> | ||
| List and search records, follow relationships, and read a single record. | ||
| </Card> | ||
| <Card title="Write" icon="pen"> | ||
| Create, update, and delete records, and associate/dissociate relationships. | ||
| </Card> | ||
| <Card title="Act" icon="bolt"> | ||
| Run your collection's **Smart Actions** — the same business operations exposed in the UI. | ||
| </Card> | ||
| <Card title="Understand" icon="sitemap"> | ||
| Describe collections, fields, and relationships so the agent can reason about your schema. | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## 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. | ||
|
|
||
| <Warning> | ||
| 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. | ||
| </Warning> | ||
|
|
||
| ## 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 | ||
| ``` | ||
|
|
||
| <Info> | ||
| 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. | ||
| </Info> | ||
|
|
||
| ## 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) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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: | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card title="Claude Code — the forest plugin" icon="wand-magic-sparkles" href="/ai/claude-code"> | ||
| 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.** | ||
| </Card> | ||
| <Card title="MCP — the Forest MCP server" icon="plug" href="/ai/mcp"> | ||
| Expose your Forest project's data and actions to any MCP-compatible agent — query records, create/update/delete, run Smart Actions, inspect the schema. | ||
| </Card> | ||
| </CardGroup> | ||
|
|
||
| ## 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**. | ||
|
|
||
| <Info> | ||
| These capabilities are rolling out. The `forest` Claude Code plugin ships onboarding today, with layout, workflows and management skills in the same plugin. | ||
| </Info> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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=<option>` | [default: table] Ouput format. <options: table\|json> | | ||
| | `-n, --name=<value>` | (required) Environment name. | | ||
| | `-p, --projectId=<value>` | Forest project ID. | | ||
| | `-t, --type=<option>` | Environment type (defaults to "remote" when omitted). Use "production" to create the first production environment. Development environments are created with "forest init". <options: production\|remote> | | ||
| | `-u, --url=<value>` | Application URL. Required, except with --type production where it may be omitted. | | ||
| | `--disableRoles` | Disable roles on new environment. | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| title: forest environments:delete | ||
| description: "Delete an environment" | ||
| --- | ||
|
|
||
| # forest environments:delete | ||
|
|
||
| Delete an environment. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| forest environments:delete [ENVIRONMENTID] [options] | ||
| ``` | ||
|
|
||
| ## Arguments | ||
|
|
||
| | Argument | Description | | ||
| |---|---| | ||
| | `ENVIRONMENTID` | ID of an environment. | | ||
|
|
||
| ## Options | ||
|
|
||
| | Option | Description | | ||
| |---|---| | ||
| | `-f, --force` | Force delete. | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| title: forest environments:get | ||
| description: "Get the configuration of an environment" | ||
| --- | ||
|
|
||
| # forest environments:get | ||
|
|
||
| Get the configuration of an environment. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| forest environments:get [ENVIRONMENTID] [options] | ||
| ``` | ||
|
|
||
| ## Arguments | ||
|
|
||
| | Argument | Description | | ||
| |---|---| | ||
| | `ENVIRONMENTID` | ID of an environment. | | ||
|
|
||
| ## Options | ||
|
|
||
| | Option | Description | | ||
| |---|---| | ||
| | `-f, --format=<option>` | [default: table] Output format. <options: table\|json> | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| title: forest environments:reset | ||
| description: "Reset a remote environment by removing all layout changes" | ||
| --- | ||
|
|
||
| # forest environments:reset | ||
|
|
||
| Reset a remote environment by removing all layout changes. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| forest environments:reset [options] | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| | Option | Description | | ||
| |---|---| | ||
| | `-e, --environment=<value>` | The remote environment name to reset. | | ||
| | `-p, --projectId=<value>` | The id of the project to work on. | | ||
| | `--force` | Skip reset changes confirmation. | | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
ai/claude-code.mdx:74The Preview step states that the skills support
--dry-runon the underlying commands, but mutating commands used by these skills — such asforest layout:apply,forest roles:apply,forest users:invite, andforest projects:create:demo— have no--dry-runoption. Users following the described loop for layout, management, or onboarding cannot obtain the promised no-write CLI preview and may expect a command not to make changes when it will. Consider either qualifying the claim to the commands that actually support--dry-runor documenting which steps do not offer a dry-run preview.🚀 Reply "fix it for me" or copy this AI Prompt for your agent: