Skip to content

The CFS Plugin API allows users to customize the workspace, project and code generation features in CodeFusion Studio.

License

Notifications You must be signed in to change notification settings

analogdevicesinc/cfs-plugins

Repository files navigation

CodeFusion Studio Plugins

The CodeFusion Studio (CFS) Plugin API enables users to extend key features of CodeFusion Studio, such as workspace setup, project configuration, and source code generation — without modifying the base application.

With the Plugin API, you can develop custom plugins tailored to your project’s needs—for example, upgrading an RTOS version, integrating middleware, or generating code from proprietary templates.

This repository includes:


🔌 Plugin Architecture

Plugins are defined in their .cfsplugin file. Each plugin can implement one or more of the following services:

  • workspace – Defines the folder structure and configuration of a generated workspace.
  • project – Configures individual project cores within the workspace.
  • codegen – Generates dynamic files such as board.conf or .overlay based on hardware selections.
  • properties – Declares user-configurable fields in the System Planner UI.

See cfs-services.ts in the Plugin API for a full interface list.

💡 Codegen plugins are often included inside project plugins using the codegen section of .cfsplugin.

For information on using CFS Plugins in CFS, refer to the CFS User Guide.


🧠 How Plugins Work

  1. Plugin Discovery
    CodeFusion Studio reads your .cfsplugin to identify the offered services and supported SoCs/boards.

  2. Default Behavior (Generic Plugin)
    If there’s no index.ts/index.cjs, the default generic plugin implementation (cfs-generic-plugin.ts) in the Plugin API uses Eta to render anything under templates/.

  3. Custom Logic (Optional)
    Add an index.ts exporting a class that implements one or more service interfaces (see cfs-services.ts).
    You can:

    • Reuse the built-in components in src/generic/components in the Plugin API, or
    • Use your own from scratch (for example: swap out Eta a different engine).
  4. Static and Template Files
    Each plugin can include:

    • files/ → copied verbatim into the workspace
    • templates/ → rendered by Eta (unless you override it in your index.ts) All entries must be declared in your .cfsplugin under the appropriate service block.

🧩 Example Plugins

  • zephyr-single-core-blinky – Only implements the workspace service. No index.ts needed—uses generic behavior.
  • zephyr-project-plugin – Combines project, codegen, and properties services and ships an index.ts that implements all the required service interfaces.

📂 Plugin Structure Overview

my-plugin/
├── .cfsplugin         # Required: Declares plugin metadata, services, and output files/templates
├── index.ts           # Optional: Overrides default behavior 
├── files/             # Optional: Static files (must be listed)
├── templates/         # Optional: Eta templates (must be listed)
└── services/          # Optional: helper classes for your `index.ts`

For a full step-by-step guide to creating a plugin, see DEVELOPMENT.md

About

The CFS Plugin API allows users to customize the workspace, project and code generation features in CodeFusion Studio.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •