Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Adobe I/O Runtime plugin for the Adobe I/O CLI
<!-- toc -->
* [aio-cli-plugin-runtime](#aio-cli-plugin-runtime)
* [Usage](#usage)
* [Skills](#skills)
* [Commands](#commands)
<!-- tocstop -->

Expand All @@ -38,6 +39,47 @@ $ aio discover -i
$ aio runtime --help
```

# Skills

This repository includes [agent skills](https://github.com/vercel-labs/skills) that teach coding agents (Cursor, Claude Code, Codex, and others) how to use `aio runtime` commands.

Install all skills:

```sh
npx skills add adobe/aio-cli-plugin-runtime
```

Install a specific skill:

```sh
npx skills add adobe/aio-cli-plugin-runtime --skill aio-runtime-deploy
```

Target a specific agent:

```sh
npx skills add adobe/aio-cli-plugin-runtime -a cursor
npx skills add adobe/aio-cli-plugin-runtime -a claude-code -a codex
```

Install globally (available in all projects):

```sh
npx skills add adobe/aio-cli-plugin-runtime --global
```

### Available skills

| Skill | Description |
|-------|-------------|
| `aio-runtime-setup` | Plugin install, auth, namespace, and property configuration |
| `aio-runtime-actions` | Create, update, invoke, and manage actions |
| `aio-runtime-deploy` | Deploy from YAML manifests (sync, undeploy, report) |
| `aio-runtime-debug` | Activations, logs, results, and troubleshooting |
| `aio-runtime-events` | Triggers, rules, and action sequences |
| `aio-runtime-api` | HTTP API routes and REST endpoints |
| `aio-runtime-log-forwarding` | Log forwarding to Splunk, New Relic, Azure, and more |

# Commands
<!-- commands -->
* [`aio runtime`](#aio-runtime)
Expand Down
129 changes: 129 additions & 0 deletions skills/aio-runtime-actions/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
name: aio-runtime-actions
description: >-
Create, update, invoke, and manage Adobe I/O Runtime actions via aio-cli.
Use when working with serverless actions, web actions, action parameters,
runtimes (nodejs:22), annotations, or aio runtime action commands.
---

# Runtime Actions

Manage individual actions with `aio runtime action` (`aio rt action`).

## Create or update

```bash
# Create from source file (kind inferred from extension)
aio runtime action create mypkg/my-action actions/my-action/index.js \
--web true \
--kind nodejs:22 \
-p greeting "hello" \
-a final true \
-a require-adobe-auth false

# Update existing action
aio runtime action update mypkg/my-action actions/my-action/index.js --web true
```

### Supported runtimes (by file extension)

| Extension | Kind |
|-----------|------|
| `.js` | `nodejs:default` |
| `.ts` | `typescript:default` |
| `.py` | `python:default` |
| `.java` | `java:default` |
| `.go` | `go:default` |

Prefer explicit `--kind nodejs:22` (or current supported version) over default.

### Web actions

- `--web true` — JSON HTTP response (standard web action)
- `--web raw` — raw HTTP (full control of status, headers, body)
- `--web-secure true` — require whisk auth on the URL

For App Builder UIs calling actions via `actionWebInvoke`, return JSON bodies — not binary Content-Type responses.

### Annotations

```bash
-a final true # prevent further updates via CLI
-a require-adobe-auth false # public web action (App Builder)
-a require-whisk-auth false # no auth header required
-a raw-http true # raw HTTP mode
```

Or load from file: `-A annotations.json`

### Limits

```bash
-m 512 # memory MB (128–4096)
-t 60000 # timeout ms (100–3600000)
-l 10 # log size MB (0–10)
-c 200 # concurrency (1–500)
```

## Invoke and inspect

```bash
# Blocking invoke, show result only
aio runtime action invoke mypkg/my-action -r -p name "World"

# From JSON param file
aio runtime action invoke mypkg/my-action -P params.json -b

# Get action URL (web actions)
aio runtime action get mypkg/my-action -r

# List actions in package
aio runtime action list mypkg

# Get action metadata (+ code if not zipped)
aio runtime action get mypkg/my-action -c

# Save deployed code locally
aio runtime action get mypkg/my-action --save
```

## Action handler pattern (Node.js)

```javascript
async function main (params) {
return {
statusCode: 200,
body: { message: `Hello ${params.name}` }
}
}
exports.main = main
```

For raw HTTP web actions, return `{ statusCode, headers, body }` with appropriate Content-Type.

## Sequences and copies

```bash
# Sequence action (comma-separated fully-qualified names)
aio runtime action create mypkg/my-seq --sequence "mypkg/step1,mypkg/step2"

# Copy from existing action
aio runtime action create mypkg/new-action --copy mypkg/existing-action
```

## Delete

```bash
aio runtime action delete mypkg/my-action
```

## Quick reference

| Task | Command |
|------|---------|
| List all actions | `aio runtime action list` |
| Count actions | `aio runtime action list --count` |
| JSON output | add `--json` to list/create/update |
| Package-scoped list | `aio runtime action list <packagename>` |

For manifest-based bulk deploy, use the **aio-runtime-deploy** skill.
134 changes: 134 additions & 0 deletions skills/aio-runtime-api/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
name: aio-runtime-api
description: >-
Create and manage Adobe I/O Runtime HTTP API routes via aio-cli. Use when
exposing actions as REST endpoints, configuring API base paths, swagger
config, or aio runtime api commands.
---

# Runtime API Routes

Map HTTP paths and verbs to web actions. Commands: `aio runtime api` (aliases: `aio rt api`, `aio runtime route`).

**Prerequisite**: Target actions must be **web actions** (`--web true` or `web: 'yes'` in manifest).

## Create a route

```bash
# basepath / relpath / verb / action
aio runtime api create /v1 /hello GET mypkg/hello-action

# With response type
aio runtime api create /v1 /data GET mypkg/data-action -r json
# response types: html, http, json, text, svg
```

## Create from Swagger config

```bash
aio runtime api create -c api-config.json
```

Swagger JSON defines multiple routes at once. Use for complex APIs.

## List and inspect

```bash
# All APIs
aio runtime api list

# Filter by base path
aio runtime api list /v1

# Get API details
aio runtime api get my-api-name
aio runtime api get /v1
```

## Delete routes

```bash
# Delete entire API (by name or base path)
aio runtime api delete my-api-name

# Delete specific route
aio runtime api delete /v1 /hello GET
```

## Manifest-based API definition

Deploy APIs with manifest:

```yaml
packages:
my-package:
version: 1.0
license: Apache-2.0
actions:
hello:
function: actions/hello.js
web: true
goodbye:
function: actions/goodbye.js
web: true
apis:
hello-world: # API name
v1: # base path segment
hello: # relpath segments
world:
hello:
method: GET
goodbye-world:
v1:
bye:
world:
goodbye:
method: DELETE
```

Deploy:

```bash
aio runtime deploy -m manifest.yaml
```

Resulting URLs follow pattern: `https://<namespace>.adobeioruntime.net/api/v1/web/<package>/<action>`

For App Builder apps, action URLs are also available via:

```bash
aio app get-url
```

## Auth on API endpoints

Control access via action annotations:

```yaml
annotations:
require-adobe-auth: true # Adobe IMS token required
require-whisk-auth: true # Namespace auth header required
```

Public endpoints:

```yaml
annotations:
require-adobe-auth: false
require-whisk-auth: false
```

## Quick reference

| Task | Command |
|------|---------|
| List APIs | `aio runtime api list` |
| JSON output | `aio runtime api list --json` |
| Get action URL | `aio runtime action get pkg/action -r` |
| Aliases | `aio rt api`, `aio runtime route` |

## Troubleshooting

- **404 on API route** — Confirm action is deployed as web action and route was created (`aio runtime api list`).
- **401 Unauthorized** — Check `require-adobe-auth` / `require-whisk-auth` annotations.
- **Wrong response format** — Set `-r json|html|text` on create, or return proper structure from raw web action.
Loading
Loading