CLI wizard to scaffold Optimizely Connect Platform (OCP) Opal Tools
npm install @kunalshetye/ocp-opal-wizardCLI wizard to scaffold Optimizely Connect Platform (OCP) Opal Tools.
Before using this wizard, you need the OCP CLI installed:
``bash1. Create credentials file with your API key (from OCP developer invitation email)
mkdir -p ~/.ocp
echo '{"apiKey": "
> Note: OCP requires Yarn 1.x (Classic). See the Yarn Classic installation guide.
For detailed setup instructions, see Configure your OCP development environment.
Usage
`bash
npx @kunalshetye/ocp-opal-wizard create my-app
cd my-app
yarn install
yarn build
`> Important: Always use
npx to run the wizard (not yarn create). The wizard runs via npm/npx, but the scaffolded project uses Yarn 1.x as required by OCP. This works regardless of which Yarn version you have installed globally.Interactive Wizard
The CLI guides you through setting up your OCP Opal Tool project:
1. Project directory - Where to create the project
2. App configuration - App ID, display name, description
3. Tracker ID - OCP deployment target (optional)
4. Repository info - GitHub username, contact email
5. Git initialization - Optional git setup
Command Line Options
`bash
ocp-opal-wizard create [directory] [options]Arguments:
[directory] Project directory (default: interactive prompt)
Options:
-y, --yes Skip prompts, use defaults
--no-git Skip git initialization
--dry-run Show what would be done without making changes
--app-id OCP App ID
--display-name App display name
--description App description
--tracker-id OCP Tracker ID for deployment
--email Contact email
-h, --help Show help message
-v, --version Show version number
`Examples
$3
`bash
npx @kunalshetye/ocp-opal-wizard create
`$3
`bash
npx @kunalshetye/ocp-opal-wizard create my-tool --yes
`$3
`bash
npx @kunalshetye/ocp-opal-wizard create my-tool \
--app-id my-opal-tool \
--tracker-id ABC123 \
--email dev@example.com
`$3
`bash
npx @kunalshetye/ocp-opal-wizard create my-tool --yes --dry-run
`What Gets Created
`
my-tool/
├── src/
│ ├── index.ts # Entry point
│ ├── functions/
│ │ └── OpalToolFunction.ts # Tool implementations
│ └── lifecycle/
│ └── Lifecycle.ts # OCP lifecycle hooks
├── forms/
│ └── settings.yml # Settings form
├── assets/
│ ├── icon.svg # App icon
│ ├── logo.svg # App logo
│ └── directory/
│ └── overview.md # App Directory description
├── app.yml # OCP manifest
├── package.json
├── tsconfig.json
├── .gitignore
└── README.md
`After Scaffolding
`bash
cd my-toolInstall dependencies (OCP requires Yarn 1.x)
yarn installBuild the project
yarn buildValidate configuration
yarn validateDeploy to OCP
ocp app register
ocp app prepare
ocp directory install @
`OCP CLI Commands Reference
| Command | Description |
|---------|-------------|
|
ocp app register | Register your app with OCP |
| ocp app prepare | Validate, package, upload and build |
| ocp app validate | Validate app locally |
| ocp app logs | Fetch app logs |
| ocp directory publish | Publish app version |
| ocp directory install | Install to account |
| ocp directory uninstall | Uninstall from account |
| ocp accounts whoami | Show your account info |
| ocp accounts whois | Show user info |For full CLI documentation, run
ocp -h or see the OCP CLI docs.Development
`bash
Install dependencies
yarn installBuild
yarn buildRun tests
yarn testWatch mode
yarn dev
``- OCP Documentation
- Configure OCP Development Environment
- Opal Tool SDK
- Template Repository