### Example Installed Plugins List Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/types.md Demonstrates the structure of the array returned by `Config.getPluginsList()`. This example shows how plugin metadata is represented, including core, user, and linked plugins. ```javascript const plugins = this.config.getPluginsList() // Result: [ { type: 'core', name: '@adobe/aio-cli-plugin-app', version: '14.2.1' }, { type: 'user', name: '@my-org/custom-plugin', version: '1.0.0' }, { type: 'core', name: '@adobe/aio-cli-plugin-config', version: '5.1.0' } ] ``` -------------------------------- ### Plugin Discovery and Installation Flow Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/architecture.md Illustrates the process initiated by the 'aio discover --install' command. It covers fetching from the npm registry, filtering, sorting, user selection via inquirer, and subsequent installation of selected plugins. ```bash User: aio discover --install │ ├─→ DiscoCommand.run() │ ├─→ Fetch npm registry │ GET https://registry.npmjs.org/-/v1/search?text=aio-cli-plugin │ ├─→ Filter packages (name starts with @adobe/aio-cli-plugin) │ ├─→ Sort by date/name (sortValues helper) │ ├─→ Show interactive checklist (inquirer) │ └─→ User selects plugins │ ├─→ For each selected plugin: │ └─→ this.config.runCommand('plugins:install', [pluginName]) │ └─→ Return installed plugin names ``` -------------------------------- ### Interactive Plugin Installation Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/commands.md Enters interactive mode to select and install plugins. The `--install` flag enables this feature, prompting the user to choose plugins. ```bash aio discover --install ``` -------------------------------- ### Install and Basic Usage of Adobe I/O CLI Source: https://github.com/adobe/aio-cli/blob/master/README.md Shows how to install the CLI globally and demonstrates basic commands for checking version and help. ```sh $ npm install -g @adobe/aio-cli $ aio COMMAND running command... $ aio (--version|-v) @adobe/aio-cli/11.1.2 darwin-arm64 node-v24.11.1 $ aio --help [COMMAND] USAGE $ aio COMMAND ... ``` -------------------------------- ### Discover Plugins to Install Source: https://github.com/adobe/aio-cli/blob/master/README.md This command helps discover installable plugins. It lists plugins with the prefix '@adobe/aio-cli-plugin'. To install a plugin, use 'aio plugins install NAME'. ```bash aio discover [-i] [-f date|name] [-o asc|desc] ``` -------------------------------- ### Display Autocomplete Installation Instructions Source: https://github.com/adobe/aio-cli/blob/master/README.md Displays instructions for installing shell autocompletion. Supports zsh, bash, and powershell. The cache can be refreshed. ```bash aio autocomplete [SHELL] [-r] ``` ```bash aio autocomplete ``` ```bash aio autocomplete bash ``` ```bash aio autocomplete zsh ``` ```bash aio autocomplete powershell ``` ```bash aio autocomplete --refresh-cache ``` -------------------------------- ### Discover Plugins Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/INDEX.md Lists available plugins, with options to sort by date or name, and to install them directly. Use this command to explore and manage your installed plugins. ```bash aio discover [--sort-field date|name] [--sort-order asc|desc] [--install] ``` -------------------------------- ### Install App Builder Template from Local Path Source: https://github.com/adobe/aio-cli/blob/master/README.md Install an App Builder template from a local file path. Supports both relative and absolute paths. ```bash aio templates install file:../relative/path/to/template/folder ``` ```bash aio templates install file:/absolute/path/to/template/folder ``` ```bash aio templates install ../relative/path/to/template/folder ``` ```bash aio templates install /absolute/path/to/template/folder ``` -------------------------------- ### Install App Builder Template with Options Source: https://github.com/adobe/aio-cli/blob/master/README.md Install an App Builder template with verbose output, skipping prompts, and passing additional template options as a base64-encoded JSON string. ```bash aio templates i PATH [-v] [-y] [--install] [--process-install-config] [--template-options ] ``` -------------------------------- ### Install App Builder Template with Options Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs an App Builder template with additional options, such as skipping prompts or processing install configurations. Template options can be provided as a base64-encoded JSON string. ```bash aio templates install PATH [-v] [-y] [--install] [--process-install-config] [--template-options ] ``` -------------------------------- ### Discover plugins in interactive install mode Source: https://github.com/adobe/aio-cli/blob/master/README.md Enables interactive mode for discovering and installing plugins. The CLI will prompt for confirmation. ```bash $ aio plugins discover -i ``` -------------------------------- ### List Installed App Builder Templates Source: https://github.com/adobe/aio-cli/blob/master/README.md Lists all installed App Builder templates. Use the `-j` flag for JSON output or `-s` to include required services. ```bash aio templates info [-v] [-y | -j] [-s] ``` -------------------------------- ### Check for Updates and Install Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/commands.md Checks for available plugin updates and installs them with user confirmation. ```bash aio update ``` -------------------------------- ### Example: User Plugin with Available Update Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/types.md An example instance of ToUpdatePlugin representing a user-installed plugin that has a newer version available in the npm registry. ```javascript { type: 'user', name: '@my-org/custom-plugin', currentVersion: '1.0.0', latestVersion: '1.1.0', coreVersion: null, needsUpdate: true, needsWarning: false } ``` -------------------------------- ### Example: Core Plugin Information Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/types.md An example instance of ToUpdatePlugin for a core plugin, shown for informational purposes. Core plugins are not updated via the CLI. ```javascript { type: 'core', name: '@adobe/aio-cli-plugin-app', currentVersion: '14.0.0', latestVersion: '14.2.1', coreVersion: '14.0.0', needsUpdate: true, needsWarning: false } ``` -------------------------------- ### Install App Builder Template from URL Source: https://github.com/adobe/aio-cli/blob/master/README.md Install an App Builder template from a remote repository URL. Supports various URL formats including HTTPS, Git, and SSH. ```bash aio templates install https://github.com/org/repo ``` ```bash aio templates install git+https://github.com/org/repo ``` ```bash aio templates install ssh://github.com/org/repo ``` ```bash aio templates install git+ssh://github.com/org/repo ``` -------------------------------- ### Install a User Plugin Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/configuration.md Use this command to install custom plugins developed by users or third parties. Ensure the plugin name is correctly specified. ```bash aio plugins:install @my-org/custom-plugin ``` -------------------------------- ### Install Adobe I/O CLI Plugin from npm Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs a plugin from the npm registry. This command uses npm for installation and can be used to add new functionality to the CLI. ```bash aio plugins install myplugin ``` -------------------------------- ### Install Adobe I/O CLI Plugin from GitHub URL Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs a plugin directly from a GitHub repository URL. This is useful for installing plugins not yet published to npm. ```bash aio plugins install https://github.com/someuser/someplugin ``` -------------------------------- ### Add a plugin from a GitHub slug Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs a plugin using its GitHub username and repository name (slug). This is a shorthand for installing from GitHub. ```bash $ aio plugins add someuser/someplugin ``` -------------------------------- ### Install Adobe I/O App Package Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs an Adobe I/O application package from a specified path. Supports options for verbose output, script execution, configuration validation, and running tests. ```bash aio app install PATH [-v] [--version] [--config-validation] [--allow-scripts] [-o ] [--tests] [--no-allow-scripts] [--no-config-validation] [--no-tests] ``` -------------------------------- ### Get Help Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/INDEX.md Displays help information for the CLI or specific commands. This utilizes a custom help class for enhanced user guidance. ```bash aio --help aio -h aio --help ``` -------------------------------- ### Discover and sort plugins by date (descending) Source: https://github.com/adobe/aio-cli/blob/master/README.md Discovers plugins available for installation, sorted by date in descending order. This is the default behavior. ```bash $ aio plugins discover ``` -------------------------------- ### Add a plugin from npm registry Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs a plugin from the npm registry. Ensure the plugin name is correct. ```bash $ aio plugins add myplugin ``` -------------------------------- ### Add a plugin from a GitHub URL Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs a plugin directly from a GitHub repository URL. This is useful for plugins not yet published to npm. ```bash $ aio plugins add https://github.com/someuser/someplugin ``` -------------------------------- ### PrintTable Basic Usage Example Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/table.md Demonstrates how to use printTable with an array of data and basic column definitions, including fixed width and minimum width constraints. ```javascript const { printTable } = require('@adobe/aio-cli/src/table') const chalk = require('chalk') // Example 1: Simple table const plugins = [ { name: '@adobe/plugin-a', version: '1.2.0' }, { name: '@adobe/plugin-b', version: '2.0.1' } ] printTable(plugins, { 'Plugin Name': { width: 20, get: row => row.name }, 'Version': { minWidth: 10, get: row => row.version } }) ``` -------------------------------- ### Example: User Plugin Overriding Core Plugin (Warning Case) Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/types.md An example instance of ToUpdatePlugin where a user-installed plugin overrides a core plugin, and the user's version is older or equal to the core version, triggering a warning. ```javascript { type: 'user', name: '@adobe/aio-cli-plugin-config', currentVersion: '5.0.0', latestVersion: '5.1.0', coreVersion: '5.1.0', needsUpdate: false, needsWarning: true // User version is older than core version } ``` -------------------------------- ### Plugin Update Check and Installation Flow Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/architecture.md Details the data flow for the 'aio update --interactive' command. It explains how installed plugins are checked for updates, versions are compared, and user-selected plugins are updated. ```bash User: aio update --interactive │ ├─→ UpdateCommand.run() │ ├─→ GetPluginsList (oclif) │ └─→ Returns [InstalledPlugin, ...] │ ├─→ For each plugin: │ ├─→ Fetch latest version from npm (getNpmLatestVersion) │ ├─→ Compare versions (semver.gt) │ ├─→ Check for overrides (plugin.type === 'user' && inCore) │ └─→ Construct ToUpdatePlugin │ ├─→ Categorize plugins: │ ├─→ needsUpdateCore (info only) │ ├─→ needsUpdateUserNonCore (can update) │ ├─→ needsWarning (user override of old version) │ └─→ needsUpdateCoreButUserInstalled (rollback first) │ ├─→ Display warnings and tables │ ├─→ Interactive mode: Show checkbox │ └─→ User selects plugins to update │ ├─→ For each selected plugin: │ ├─→ hideNPMWarnings() (if not --verbose) │ └─→ this.config.runCommand('plugins:install', [pluginName]) │ └─→ Return updated plugin names ``` -------------------------------- ### Oclif Configuration Example Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/AIOCommand.md This JSON configuration object defines oclif settings for the Adobe I/O CLI, including command paths, plugins, and help class. ```json { "oclif": { "topicSeparator": " ", "commands": "./src/commands", "bin": "aio", "helpClass": "./src/custom-help", "plugins": [ "@oclif/plugin-help", "@oclif/plugin-plugins", "@oclif/plugin-autocomplete", "@oclif/plugin-not-found", "@oclif/plugin-warn-if-update-available", "@adobe/aio-cli-plugin-config", "@adobe/aio-cli-plugin-console", "@adobe/aio-cli-plugin-runtime", "@adobe/aio-cli-plugin-app", "@adobe/aio-cli-plugin-app-dev", "@adobe/aio-cli-plugin-app-storage", "@adobe/aio-cli-plugin-app-templates", "@adobe/aio-cli-plugin-auth", "@adobe/aio-cli-plugin-certificate", "@adobe/aio-cli-plugin-info", "@adobe/aio-cli-plugin-events", "@adobe/aio-cli-plugin-telemetry" ] } } ``` -------------------------------- ### Configure Log Forwarding Destination (Interactive) Source: https://github.com/adobe/aio-cli/blob/master/README.md Use this command for an interactive setup of your log forwarding destination. It allows for flexible configuration through prompts. ```bash aio rt namespace log-forwarding set [--cert] [--key] [--apiversion] [--apihost] [-u] [-i] [--debug ] [-v] [--version] [--help] ``` -------------------------------- ### Check Plugin Compatibility Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/examples.md List installed plugins and check for core plugin overrides to ensure compatibility. Use rollback commands if warnings appear or issues arise. ```bash # List all installed plugins with versions aio rollback --list # Check for core plugin overrides aio update --list # If warnings appear, review and rollback if needed aio rollback --interactive ``` -------------------------------- ### List User Plugins Without Uninstalling Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/commands.md Uses the `--list` flag to display installed user plugins without performing any uninstallation. ```bash aio rollback --list ``` -------------------------------- ### Rollback CLI Command Usage Source: https://github.com/adobe/aio-cli/blob/master/README.md This snippet shows the usage and available flags for the `aio rollback` command, which clears installed plugins. Use the interactive flag for a guided process. ```bash USAGE $ aio rollback [-i] [-l] [-c] [-v] FLAGS -c, --[no-]confirm confirmation needed for clear (defaults to true) -i, --interactive interactive clear mode -l, --list list plugins that will be cleared -v, --verbose Verbose output DESCRIPTION Clears all installed plugins. ``` -------------------------------- ### Get Log Forwarding Errors CLI Usage Source: https://github.com/adobe/aio-cli/blob/master/README.md This snippet outlines the USAGE and FLAGS for retrieving log forwarding errors in Adobe I/O Runtime namespaces. Use this command to diagnose issues with your log forwarding setup. ```bash USAGE $ aio rt ns log-forwarding errors [--cert] [--key] [--apiversion] [--apihost] [-u] [-i] [--debug ] [-v] [--version] [--help] FLAGS -i, --insecure bypass certificate check -u, --auth [env: WHISK_AUTH] whisk auth -v, --verbose Verbose output --apihost [env: WHISK_APIHOST] whisk API host --apiversion [env: WHISK_APIVERSION] whisk API version --cert client cert --debug= Debug level output --help Show help --key client key --version Show version DESCRIPTION Get log forwarding errors ALIASES $ aio runtime ns log-forwarding errors $ aio runtime ns lf errors $ aio runtime namespace lf errors $ aio rt namespace log-forwarding errors $ aio rt namespace lf errors $ aio rt ns log-forwarding errors $ aio rt ns lf errors ``` -------------------------------- ### Read Local NPM Package Version Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/helpers.md Use this function to get the version of an npm package installed locally within the CLI's node_modules directory. It reads the package.json file directly and will throw errors if the file is not found or invalid. ```javascript async getNpmLocalVersion(cliRoot, npmPackageName) → Promise Reads the version of an npm package installed in the CLI's node_modules directory. Returns `Promise` that resolves to the version string extracted from the package's package.json. 1. Constructs the path: `{cliRoot}/node_modules/{npmPackageName}/package.json` 2. Reads the file using `fs.readFileSync()` (blocking I/O) 3. Parses JSON and extracts the `version` field 4. Returns the version string Throws an error if the file doesn't exist, is unreadable, or is invalid JSON. ``` ```javascript const { getNpmLocalVersion } = require('@adobe/aio-cli/src/helpers') // Get installed version from CLI's node_modules const installedVersion = await getNpmLocalVersion('/usr/local/lib/node_modules/@adobe/aio-cli', '@adobe/aio-cli-plugin-app') console.log(`Installed version: ${installedVersion}`) // e.g., "14.0.0" ``` -------------------------------- ### Initialize a New App Builder Project Source: https://github.com/adobe/aio-cli/blob/master/README.md Use this command to create a new App Builder Project. You must provide a name for the project. Optional flags allow setting a description, title, and specifying the organization ID. ```bash aio console project init -n [--help] [-o ] [-t ] [-d ] [-j | -y] ``` -------------------------------- ### Install Adobe I/O CLI Plugin from GitHub Slug Source: https://github.com/adobe/aio-cli/blob/master/README.md Installs a plugin using its GitHub username and repository name (slug). This provides a shorthand for installing from GitHub. ```bash aio plugins install someuser/someplugin ``` -------------------------------- ### Display CLI Help Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/examples.md Access help documentation for the CLI. Use `--help` or `-h` for general help or specific commands. ```bash # Display main help aio --help aio -h # Display help for specific command aio discover --help aio discover -h # Display help for command with alias resolution aio rt --help # Shows 'runtime' subcommands (alias 'rt' → 'runtime') ``` -------------------------------- ### Conditional AIO Plugin Installation Script Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/examples.md Bash script to conditionally install AIO CLI plugins based on the NODE_ENV environment variable. Installs different sets of plugins for production and development environments. ```bash #!/bin/bash # Install plugins based on environment if [ "$NODE_ENV" = "production" ]; then aio plugins:install @adobe/aio-cli-plugin-app aio plugins:install @adobe/aio-cli-plugin-config else # For development, include additional plugins aio plugins:install @my-org/dev-tools aio plugins:install @my-org/debug-plugin fi aio update --list ``` -------------------------------- ### Display Certificate Help Source: https://github.com/adobe/aio-cli/blob/master/README.md Shows the general help information for the `aio certificate` command. ```bash aio certificate ``` -------------------------------- ### List Updates Without Installing Source: https://github.com/adobe/aio-cli/blob/master/_autodocs/api-reference/commands.md Lists plugins that have updates available without performing the installation. ```bash aio update --list ``` -------------------------------- ### aio app init Command Usage Source: https://github.com/adobe/aio-cli/blob/master/README.md This snippet shows the general usage and available flags for the `aio app init` command. Use this command to create a new Adobe I/O App, with options to specify installation path, templates, and configuration details. ```bash USAGE $ aio app init [PATH] [--install] [-v] [--version] [--config-validation] [-y] [--login] [-e ... | -t ... | --repo ] [--standalone-app | | ] [--template-options ] [-o | -i | ] [-p | | ] [-w | | ] [--confirm-new-workspace] [--use-jwt] [--github-pat ] [--linter none|basic|adobe-recommended] ARGUMENTS [PATH] [default: .] Path to the app directory FLAGS -e, --extension=... Extension point(s) to implement -i, --import= Import an Adobe I/O Developer Console configuration file -o, --org= Specify the Adobe Developer Console Org to init from (orgId, or orgCode) -p, --project= Specify the Adobe Developer Console Project to init from (projectId, or projectName) -t, --template=... Specify a link to a template that will be installed -v, --verbose Verbose output -w, --workspace= [default: Stage] Specify the Adobe Developer Console Workspace to init from, defaults to Stage -y, --yes Skip questions, and use all default values --[no-]config-validation [default: true] Validate the app configuration file(s) before continuing. --[no-]confirm-new-workspace Prompt to confirm before creating a new workspace --github-pat= github personal access token to use for downloading private quickstart repos --[no-]install [default: true] Run npm installation after files are created --linter=