# gram stage function

The `gram stage function` command stages a Gram Functions zip file to a deployment configuration.

<Callout className="mt-8!">
    For more information on the base behavior of the `gram stage` command, see the
    [`gram stage` reference](/docs/ai-control-plane/reference/command-line/stage).
</Callout>

## Usage

```bash
gram stage function --slug my-gram-function --location ./path/to/function.zip
```

## Options

### <code>slug</code> (required)

This adds the slug to identify the source.

```bash
gram stage function --slug my-gram-function [command options]
```

### <code>location</code> (required)

This specifies the location of a zip file containing Gram Functions code. It can be a local file or a URL.

```bash
gram stage function --location ./path/to/function.zip [command options]
```

### <code>name</code>

This adds a human-readable name for the source. If not specified, the name defaults to the slug.

```bash
gram stage function --name "My Function" [command options]
```

### <code>runtime</code>

This specifies the runtime environment for the function. Supported values are
`nodejs:22` and `nodejs:24`. If not specified, it defaults to `nodejs:22`.

```bash
gram stage function --runtime nodejs:22 [command options]
```

### <code>scale</code>

This specifies the number of instances to run for the function.

```bash
gram stage function --scale 2 [command options]
```

### <code>memory-mib</code>

This specifies the amount of memory in MiB to allocate for the function (1 MiB = 1,024 x 1,024 bytes).

```bash
gram stage function --memory-mib 256 [command options]
```
