# aerostack functions

> Install community functions from the Aerostack marketplace or publish your own. Reusable logic units callable from any project.

Install and publish community functions — reusable units of logic from the Aerostack marketplace.

Community functions follow the [Open Function Standard (OFS)](/ofs). When you install one, the code is copied directly into your project (not added as an npm dependency), giving you full control.

## Install a function

```bash
aerostack functions install <username/slug>
```

```bash
# Install a payment processor function
aerostack functions install @acme/payment-processor

# Install by username/slug
aerostack functions install johndoe/email-sender
```

**What happens:**

1. Downloads the function source
2. Copies it to `src/modules/<slug>/`
3. Registers the route in your Hono app (for HTTP functions) automatically

```
src/modules/
└── payment-processor/
    ├── index.ts
    ├── types.ts
    └── README.md
```

---

## Publish a function

```bash
aerostack functions publish
```

Publishes your function to the Aerostack marketplace. Must have an OFS-compliant `function.json` in the current directory.

---

## Push / Pull

```bash
# Push local changes to a published function
aerostack functions push

# Pull latest version of an installed function
aerostack functions pull
```

Unlike npm packages, functions are copied into your project directory. You own the code and can modify it freely after installing.

## Related

- [Open Function Standard](/ofs)
- [Community Hub](/hub)
