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
- Create — Add a new function as a draft (Admin, CLI push, or CI).
- Publish — Change status to published so it appears on the Hub and can be installed (Admin, CLI, or CI with
publish: true). - 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 anaerostack.jsonin 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/publishwith your account API key. This is the only path that upserts by slug (create or update the same function). Setpublish: truein 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]oraerostack functions install <slug>. The CLI fetches the install manifest, writes files intoservices/<slug>/, and updatesaerostack.toml.
See Using Community Logic and Universal Adapter Pattern.
Quick reference
| Goal | Where |
|---|---|
| Create a draft | Admin (My Functions) or aerostack functions push |
| Update a draft | Admin (edit) or CI (/ci/publish); CLI push creates a new draft each time |
| Publish a draft | Admin (Publish) or aerostack functions publish <id> or CI with publish: true |
| Browse functions | Hub |
| Install a function | aerostack functions install [username/slug] |