Build Sliprail Extensions: Customize Your Workflow

Sliprail connects tools and workflows through unified input, Nora, and an extension ecosystem. An extension can add shortcuts, data, actions, and complete interaction flows to the launcher and AI assistant. This guide explains how to build one.

Getting Started

Sliprail extensions run in a defined runtime and can use Node.js APIs together with capabilities exposed by the Sliprail SDK. Install @sliprail/sdk for the TypeScript definitions used by extension projects.

Official Templates

The Sliprail team provides an official GitHub repository template to help you get started: sliprail-extension-template.

Creating Public Extensions

If you want to create an extension that anyone can install and use:

  1. Create a GitHub Repository: Start by creating a public repository on GitHub.
  2. Register Your Extension: Visit https://account.fengcen.com/developer and create a new Sliprail extension. Make sure to provide your GitHub repository link during registration. After registration, you will receive an extension ID that uniquely identifies your extension.
  3. Configure manifest.json: In your extension's manifest.json file, set the id field to the extension ID you received during registration. This step is crucial for proper extension identification and functionality.
  4. Develop Your Extension: Use the official template as a starting point and implement the shortcuts or workflows you need.
  5. Publish: Push the built extension to GitHub and publish it from the Developer Portal. Store visibility may take up to a day.

Creating Private Extensions

For extensions that only you will use:

  1. Create a Private Extension: Create a Sliprail extension in the Developer Portal and choose Private visibility. No GitHub repository is required. Copy the generated extension ID.
  2. Configure manifest.json: In your extension's manifest.json file, set the id field to the extension ID you received during registration. This ensures your extension is properly recognized by the system.
  3. Develop Your Extension: Reference the official templates to build your extension.
  4. Load Locally: Use the Sliprail extension management interface to load your local extension for immediate testing and development.

Debugging Your Extension

Use Sliprail's built-in debug logging while you develop and troubleshoot an extension:

Debug Logging

The debug logging API records messages while your extension runs:

  • Use the debug logging API provided by the @sliprail/sdk package to output debug information
  • Debug messages help you track the execution flow and identify potential issues
  • You can control the verbosity of debug output based on your development needs

Accessing Debug Logs

To view debug messages from your extension:

  1. Open Settings: Navigate to the Sliprail settings panel
  2. Click Debug Log: Locate and click the "Debug Log" option to directly open the debug log file
  3. Review Output: The debug log file will open, showing all debug messages from your extensions

The debug log gives you a direct view of extension behavior and loading errors during development.

Important Technical Considerations

Dependency Management

Sliprail does not automatically run npm install for extensions. If your extension uses npm packages, you must:

  • Bundle all dependencies with your code
  • Include all bundled files when pushing to your GitHub repository
  • Ensure the extension can run without additional installation steps

Available APIs

Extensions can use:

  • Node.js interfaces and modules
  • APIs provided by the @sliprail/sdk package
  • TypeScript definitions for a safer development experience
  • Debug logging interfaces for troubleshooting

Native Modules

Sliprail extensions do not support native modules as portable dependencies. Use JavaScript or TypeScript packages that can be bundled for every supported platform, and avoid native add-ons compiled with node-gyp or similar tools.

Extension Discovery

The Sliprail Store can surface published third-party extensions, allowing users to discover and install useful tools directly.

Next Steps

Now that you understand the basics of creating Sliprail extensions, you can:

  • Clone one of the official templates
  • Explore the @sliprail/sdk API
  • Start building your first extension
  • Use debug logging while you build and test
  • Join the community to share your creations

Happy coding!