Community HubFunction Flow Overview

Function Flow Overview

Community functions are reusable units of logic (TypeScript/JavaScript) that you can create, publish to the Aerostack registry, and consume in your projects. This page summarizes the lifecycle and where each tool fits.

Lifecycle at a glance

  1. Create — Add a new function as a draft (Admin, CLI push, or CI).
  2. Publish — Change status to published so it appears on the Hub and can be installed (Admin, CLI, or CI with publish: true).
  3. Consume — Browse on the Hub and install into your project with the CLI.

Create via Admin or CLI

  • Admin: Log in to the Admin dashboard, go to My Functions, create a new function, and edit in the web editor (Monaco). Saves as draft.
  • CLI: From your project, run aerostack functions push [file] (e.g. aerostack functions push src/index.ts). Each push creates a new draft; the command outputs the function ID and a link to the Admin to edit or publish. Use an aerostack.json in the same directory (or project root) for name, description, and category.

See Publishing Overview and Publishing via CLI for details.

Publish via Admin, CLI, or CI

  • Admin: Open the function in the editor and click Publish. You can run an optional code validation first.
  • CLI: After pushing, use the returned function ID: aerostack functions publish <id>.
  • CI: Use POST /api/community/functions/ci/publish with your account API key. This is the only path that upserts by slug (create or update the same function). Set publish: true in the body to go live immediately.

See Publishing Overview, Via CLI, GitHub Actions, and GitLab CI.

Consume via Hub and CLI

  • Hub: Browse hub.aerostack.dev for published functions. Open a function to see source, README, and install instructions.
  • CLI: Install a function into your project with aerostack functions install [username/slug] or aerostack functions install <slug>. The CLI fetches the install manifest, writes files into services/<slug>/, and updates aerostack.toml.

See Using Community Logic and Universal Adapter Pattern.

Quick reference

GoalWhere
Create a draftAdmin (My Functions) or aerostack functions push
Update a draftAdmin (edit) or CI (/ci/publish); CLI push creates a new draft each time
Publish a draftAdmin (Publish) or aerostack functions publish <id> or CI with publish: true
Browse functionsHub
Install a functionaerostack functions install [username/slug]