diff --git a/README.md b/README.md index 38a48a5..ca99ea7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Console Integration Plugin for the Adobe I/O CLI * [Usage](#usage) +* [Skills](#skills) * [Commands](#commands) @@ -35,6 +36,45 @@ $ aio discover -i $ aio console --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 console` commands. + +Install all skills: + +```sh +npx skills add adobe/aio-cli-plugin-console +``` + +Install a specific skill: + +```sh +npx skills add adobe/aio-cli-plugin-console --skill aio-console-context +``` + +Target a specific agent: + +```sh +npx skills add adobe/aio-cli-plugin-console -a cursor +npx skills add adobe/aio-cli-plugin-console -a claude-code -a codex +``` + +Install globally (available in all projects): + +```sh +npx skills add adobe/aio-cli-plugin-console --global +``` + +### Available skills + +| Skill | Description | +|-------|-------------| +| `aio-console-setup` | Plugin install, IMS login, context hierarchy, and `aio console where` | +| `aio-console-context` | Select and list orgs, projects, and workspaces | +| `aio-console-projects` | Create projects and workspaces | +| `aio-console-api-services` | Subscribe Adobe APIs and configure product profiles | +| `aio-console-credentials` | Public key certificates and workspace config download | + # Commands * [`aio console`](#aio-console) diff --git a/skills/aio-console-api-services/SKILL.md b/skills/aio-console-api-services/SKILL.md new file mode 100644 index 0000000..d9efe10 --- /dev/null +++ b/skills/aio-console-api-services/SKILL.md @@ -0,0 +1,119 @@ +--- +name: aio-console-api-services +description: >- + Add and list Adobe API services on Developer Console workspaces via aio-cli. + Use when subscribing to Adobe APIs, configuring product profiles, license-config, + or aio console api / workspace api commands. +--- + +# Console API Services + +Subscribe Adobe API services to a workspace. Uses OAuth Server-to-Server credentials. + +## List available org APIs + +Shows APIs enabled for the current org: + +```bash +aio console api list +# alias: aio console api ls + +# With product profile metadata +aio console api list --json +``` + +Look for `Requires product profile: yes` — these need `--license-config` when adding. + +## List workspace subscriptions + +```bash +aio console workspace api list \ + --projectName myApp \ + --workspaceName Stage + +# aliases: aio console ws api list, aio console ws api ls +``` + +## Add API services to a workspace + +```bash +aio console workspace api add \ + --projectName myApp \ + --workspaceName Stage \ + --service-code AssetComputeSDK,AdobeAnalyticsSDK +``` + +Alias: `aio console ws api add` + +### Services requiring product profiles + +Some services (e.g. Frame.io) require a product profile. Discover profiles from `aio console api list --json` — look at `properties.licenseConfigs[]` for `name`, `id`, or `productId`. + +```bash +aio console workspace api add \ + --projectName myApp \ + --workspaceName Stage \ + --service-code FrameioSDK \ + --license-config 'FrameioSDK=My Product Profile' +``` + +Multiple profiles for one service: + +```bash +--license-config 'SomeSDK=Profile1,Profile2' +``` + +Multiple services with profiles (repeat flag): + +```bash +--license-config 'SDK1=ProfileA' \ +--license-config 'SDK2=ProfileB' +``` + +### Important behavior + +- `--service-code` is comma-separated sdkCodes from `aio console api list`. +- `--license-config` keys must match codes in `--service-code`. +- Adding APIs **merges** with existing subscriptions — does not wipe previously added services. +- Check `--json` output for embedded errors; partial failures may appear in `errorDetails`. + +## Typical App Builder setup + +```bash +aio console org select +aio console project select myApp +aio console workspace select Stage + +# See what's available +aio console api list + +# Subscribe required APIs +aio console workspace api add \ + --projectName myApp \ + --workspaceName Stage \ + --service-code AdobeI/OEvents,AdobeI/OReactSpectrum + +# Verify +aio console workspace api list \ + --projectName myApp \ + --workspaceName Stage +``` + +## Quick reference + +| Task | Command | +|------|---------| +| Org-level API catalog | `aio console api list` | +| Workspace subscriptions | `aio console ws api list --projectName X --workspaceName Y` | +| Add services | `aio console ws api add --projectName X --workspaceName Y --service-code CODE` | +| JSON output | add `--json` or `--yml` | + +## Troubleshooting + +**"Service code(s) not found or not enabled"** — Run `aio console api list` to see valid codes for the org. + +**"require one or more product profiles"** — Add `--license-config '='`. Get profile names from `aio console api list --json`. + +**"Failed to add API service(s)"** — Check `--json` output for `errorDetails`. Verify org has entitlements for the service. + +For credential and config download, see **aio-console-credentials** skill. diff --git a/skills/aio-console-context/SKILL.md b/skills/aio-console-context/SKILL.md new file mode 100644 index 0000000..d4be5ef --- /dev/null +++ b/skills/aio-console-context/SKILL.md @@ -0,0 +1,86 @@ +--- +name: aio-console-context +description: >- + Select and list Adobe Developer Console orgs, projects, and workspaces via + aio-cli. Use when switching org/project/workspace context, listing console + resources, or preparing to link an App Builder project with aio app use. +--- + +# Console Context (Org, Project, Workspace) + +Navigate the Developer Console hierarchy. Selection is stored globally in aio config and drives all subsequent console, app, and runtime commands. + +## Standard workflow + +```bash +# 1. Select org (clears project + workspace) +aio console org select +# or by org code: +aio console org select + +# 2. Select project (clears workspace) +aio console project select +# or by name/id: +aio console project select myApp + +# 3. Select workspace +aio console workspace select Stage +# or: +aio console ws select Production + +# 4. Verify +aio console where +``` + +## List resources + +```bash +aio console org list +aio console project list +aio console workspace list +# or: aio console ws list +``` + +Add `--json` or `--yml` for structured output on list/select commands. + +## Link App Builder project + +After selecting the correct context, link the local app: + +```bash +aio console where # verify org/project/workspace first +aio app use -g --no-input --overwrite +``` + +`aio app use -g` links based on the **globally selected** project. If the wrong project is active, you silently link to the wrong workspace. + +## Select with explicit IDs + +Override global selection with flags: + +```bash +aio console project select myApp --orgId +aio console workspace select Stage --orgId --projectId +``` + +## Context side effects + +| Action | Clears | +|--------|--------| +| `aio console org select` | project, workspace | +| `aio console project select` | workspace | +| `aio console workspace select` | (none) | + +## Quick reference + +| Task | Command | +|------|---------| +| Current context | `aio console where` | +| List orgs | `aio console org list` | +| List projects | `aio console project list` | +| List workspaces | `aio console workspace list` | +| Select org | `aio console org select [orgCode]` | +| Select project | `aio console project select [nameOrId]` | +| Select workspace | `aio console workspace select [nameOrId]` | + +For creating new projects/workspaces, see the **aio-console-projects** skill. diff --git a/skills/aio-console-credentials/SKILL.md b/skills/aio-console-credentials/SKILL.md new file mode 100644 index 0000000..87bccb2 --- /dev/null +++ b/skills/aio-console-credentials/SKILL.md @@ -0,0 +1,106 @@ +--- +name: aio-console-credentials +description: >- + Manage Adobe Developer Console workspace credentials via aio-cli. Use when + uploading public key certificates, listing/deleting keys, downloading workspace + config, or aio console publickey / workspace download commands. +--- + +# Console Credentials and Workspace Config + +Manage public key certificates and download workspace configuration for local development. + +## Download workspace config + +Downloads the full workspace configuration (credentials, services, runtime namespace) as JSON: + +```bash +aio console workspace download +# aliases: aio console workspace dl, aio console ws download, aio console ws dl + +# Custom path +aio console workspace download ./config/console.json +aio console workspace download ./config/ # directory — writes default filename +``` + +Requires org, project, and workspace to be selected. Default filename: `--.json`. + +Override selection with flags: + +```bash +aio console workspace download \ + --orgId \ + --projectId \ + --workspaceId \ + ./my-config.json +``` + +Use downloaded config to inspect credentials or integrate with tooling outside `aio app use`. + +## Public key certificates + +Upload PEM certificates to bind JWT credentials to the selected workspace. + +### Upload + +```bash +aio console publickey upload ./public.key.pem +``` + +Requires org, project, and workspace selected. Skips upload if fingerprint already bound. + +```bash +aio console publickey upload ./public.key.pem --json +``` + +### List bindings + +```bash +aio console publickey list +``` + +### Delete binding + +```bash +aio console publickey delete +``` + +## Typical JWT credential workflow + +```bash +# 1. Select context +aio console org select +aio console project select myApp +aio console workspace select Stage + +# 2. Generate key pair (example) +openssl genrsa -out private.key 2048 +openssl rsa -in private.key -pubout -out public.key.pem + +# 3. Upload public key to workspace +aio console publickey upload ./public.key.pem + +# 4. Download config to verify binding +aio console workspace download ./console.json +``` + +Never commit private keys or downloaded config files containing secrets to source control. + +## Quick reference + +| Task | Command | +|------|---------| +| Download workspace config | `aio console workspace download [path]` | +| Upload public key | `aio console publickey upload ` | +| List key bindings | `aio console publickey list` | +| Delete key binding | `aio console publickey delete ` | + +## Troubleshooting + +**"Invalid publicKey file"** — File must exist and be a valid PEM certificate. + +**"You have not selected a Workspace"** — Run the org → project → workspace select flow first. + +**Existing binding skipped** — Upload detects matching fingerprint and reuses the existing binding (not an error). + +For context selection, see **aio-console-context** skill. diff --git a/skills/aio-console-projects/SKILL.md b/skills/aio-console-projects/SKILL.md new file mode 100644 index 0000000..acbbef6 --- /dev/null +++ b/skills/aio-console-projects/SKILL.md @@ -0,0 +1,104 @@ +--- +name: aio-console-projects +description: >- + Create Adobe Developer Console projects and workspaces via aio-cli. Use when + scaffolding new App Builder projects, creating Stage/Production workspaces, + or running aio console project create / workspace create commands. +--- + +# Console Projects and Workspaces + +Create Developer Console projects and workspaces from the CLI. + +## Create a project + +Requires a selected org (`aio console org select`). + +```bash +aio console project create \ + --name myApp \ + --title "My App" \ + --description "App Builder project for ..." +``` + +### Validation rules + +| Field | Rules | +|-------|-------| +| `name` | Alphanumeric only, 3–45 chars | +| `title` | Alphanumeric + spaces, 3–45 chars | +| `description` | Max 1000 chars | + +Project names must be unique within the org. + +```bash +# Structured output +aio console project create --name myApp --json +aio console project create --name myApp --yml +``` + +Alias: `aio console project init` + +## Create a workspace + +Requires org context. Specify project by name: + +```bash +aio console workspace create \ + --projectName myApp \ + --name Stage \ + --title "Stage" +``` + +Typical workspaces: `Stage`, `Production`. + +### Validation rules + +| Field | Rules | +|-------|-------| +| `name` | Alphanumeric only, 3–45 chars | +| `title` | Alphanumeric + spaces, 3–45 chars | + +Aliases: `aio console workspace init`, `aio console ws create`, `aio console ws init` + +## Full scaffold workflow + +```bash +# 1. Auth and org +aio login +aio console org select + +# 2. Create project +aio console project create --name myApp --title "My App" + +# 3. Select project +aio console project select myApp + +# 4. Create workspaces +aio console workspace create --projectName myApp --name Stage +aio console workspace create --projectName myApp --name Production + +# 5. Select workspace for development +aio console workspace select Stage + +# 6. Verify and link local app +aio console where +aio app use -g --no-input --overwrite +``` + +## After creation + +Add API services to the workspace (**aio-console-api-services** skill), then scaffold and deploy: + +```bash +aio app init --standalone-app --yes +aio app deploy +``` + +## Troubleshooting + +**"Project already exists"** — Choose a different `--name`. + +**"Project not found"** — Verify org with `aio console org select` and list projects with `aio console project list`. + +**"Workspace already exists"** — Choose a different workspace name or use `aio console workspace select` for the existing one. diff --git a/skills/aio-console-setup/SKILL.md b/skills/aio-console-setup/SKILL.md new file mode 100644 index 0000000..b95c1d6 --- /dev/null +++ b/skills/aio-console-setup/SKILL.md @@ -0,0 +1,87 @@ +--- +name: aio-console-setup +description: >- + Install and configure the Adobe Developer Console plugin for aio-cli. Use when + setting up @adobe/aio-cli-plugin-console, IMS login, checking org/project/workspace + context, or troubleshooting "no org selected" errors. +--- + +# Adobe Developer Console CLI Setup + +This skill covers the **console plugin** (`aio console`). It manages Developer Console orgs, projects, workspaces, and API credentials — the context layer App Builder and Runtime commands depend on. + +## Install the plugin + +```bash +aio plugins:install -g @adobe/aio-cli-plugin-console +# or discover all Adobe plugins: +aio discover -i +``` + +Verify: + +```bash +aio console --help +``` + +## Prerequisites + +Console commands require an **IMS login**: + +```bash +aio login +``` + +Auth uses the CLI context token (`@adobe/aio-lib-ims`). Without login, org/project/workspace commands fail. + +## Context hierarchy + +Console state is stored in aio config under `console.*`: + +``` +Org → Project → Workspace +``` + +Always verify before linking or deploying: + +```bash +aio console where +# alias: aio where +``` + +JSON/YAML output: + +```bash +aio console where --json +aio console where --yml +``` + +## Open Developer Console in browser + +```bash +aio console open +# alias: aio open +``` + +Opens the selected org/project/workspace in the Developer Console UI (prod or stage based on CLI env). + +## Aliases + +| Long form | Short | +|-----------|-------| +| `aio console workspace` | `aio console ws` | +| `aio console org select` | `aio console org sel` | +| `aio console project select` | `aio console project sel` | +| `aio console workspace select` | `aio console ws sel` | + +## Troubleshooting + +**"You have not selected an Organization"** — Run `aio console org select` first. + +**"You have not selected a Project"** — Select org, then `aio console project select`. + +**"You have not selected a Workspace"** — Select org and project, then `aio console workspace select`. + +**Wrong context after switching** — Always run `aio console where` before `aio app use` or deploy commands. Selecting a new org clears project and workspace; selecting a new project clears workspace. + +For selecting orgs/projects/workspaces, see the **aio-console-context** skill.