> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formae.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Scaffold a new plugin

> Start a new formae plugin from the template, either with formae plugin init or by asking an AI assistant to build one for your technology.

There are two ways to start a new plugin, and both scaffold from the same GitHub
template: the `formae plugin init` command, or an AI assistant connected to the
[formae MCP](/documentation/guides/ai-coding-assistants). Whichever you pick, the
[tutorial](/plugin-development/tutorial) then walks you through filling in the
resource schema and CRUD operations.

<Tabs>
  <Tab title="CLI">
    `formae plugin init` scaffolds a complete plugin project: manifest, entry
    point, a stub `ResourcePlugin`, schema, conformance test setup, CI, and a
    Makefile.

    <Steps>
      <Step title="Run the scaffolder">
        Interactively:

        ```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
        formae plugin init
        ```

        It prompts for the plugin name, namespace, description, category, author,
        Go module path, license, and target directory, then downloads the template
        and generates the project. It also checks the hub for name availability
        and warns if your license is not on the hub's allowlist.

        For automation or CI, pass everything as flags with `--no-input`:

        ```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
        formae plugin init \
          --name sftp \
          --namespace SFTP \
          --description "SFTP file management plugin for formae" \
          --author "Your Name" \
          --module-path github.com/your-org/formae-plugin-sftp \
          --license Apache-2.0 \
          --category data \
          --no-input
        ```

        Run `formae plugin init --help` for the complete flag list.
      </Step>

      <Step title="Build and install">
        ```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
        cd formae-plugin-sftp
        make build
        make install
        ```

        `make install` places the binary, schema, and manifest under
        `~/.pel/formae/plugins/`, where a local agent discovers it.
      </Step>

      <Step title="Implement the resource">
        The scaffold ships a stub that returns `ErrNotImplemented` for each CRUD
        method. The [tutorial](/plugin-development/tutorial) takes it from here:
        define the resource schema, then implement Create, Read, Update, Delete,
        and List with tests.
      </Step>
    </Steps>
  </Tab>

  <Tab title="AI assistant">
    With the [formae MCP plugin](/documentation/guides/ai-coding-assistants)
    connected, ask the assistant to build a plugin for the technology you want to
    manage:

    ```text theme={"languages":{"custom":["/languages/pkl.json"]}}
    I want to create a formae plugin for cloudflare
    ```

    This is what the MCP's `build_plugin` prompt drives. The assistant works
    through the [plugin SDK tutorial](/plugin-development/tutorial) from start to
    finish:

    1. Research the provider's API to understand its resources and properties.
    2. Scaffold the project with `formae plugin init --no-input`.
    3. Follow the tutorial's test-driven workflow to implement each CRUD operation.
    4. Run `make conformance-test` to verify the plugin against a running agent.
    5. Create a working example and update the README.

    It references the shipped plugins (aws, azure, gcp, oci, ovh) as prior art.
    Because most of the code is generated, the tutorial doubles as the assistant's
    playbook: keeping it accurate keeps generated plugins correct.

    <Note>
      The assistant runs `make install` before conformance tests, since the tests
      run against the installed plugin binary rather than the source.
    </Note>
  </Tab>
</Tabs>

## See also

* [Build a plugin: the tutorial](/plugin-development/tutorial): the full SFTP walkthrough the scaffold sets you up for.
* [Plugin interface](/plugin-development/reference/plugin-interface): the `ResourcePlugin` methods you implement.
* [Plugin manifest](/plugin-development/reference/manifest): every field in `formae-plugin.pkl`.
