Skip to content

KZN-19254 - add app builder CLI commands for working with business apps - #40

Merged
keegandonley merged 7 commits into
mainfrom
feature/KZN-19254-cli-business-apps-push
Oct 29, 2026
Merged

keegandonley merged 7 commits into
mainfrom
feature/KZN-19254-cli-business-apps-push

Conversation

@keegandonley

Copy link
Copy Markdown
Member

Adds commands for working with business-level apps, to support the kicode agent as well as local development with Claude/Codex/etc.

New commands

Command What it does Notable options
appbuilder app versions Shows the app's Live, released and preview versions, this folder's base, and the state of each JS action's links —
appbuilder app push Saves this folder as your preview of the app. Uploads the source zip with its base recorded, so publish works from any machine --force (push despite merge conflict markers), --base-from-preview <id> (take this folder's base from your preview; only offered as an explicit choice)
appbuilder app publish Publishes your preview as the next Live version. Stops with a conflict if Live changed since your preview's base --force (publish despite a base conflict; never publishes a preview other than the one reviewed), --expect-preview <id> (publish only if your preview is still that source package)
appbuilder app merge Merges Live (or a release) into this folder with a three-way merge in a throwaway git repo, leaving conflict markers where needed --release <n>, --base <n> (the release this folder was copied from, when none is recorded), --accept-live-base (record that the folder already contains Live)
appbuilder app rollback <version> Restores a released version as your preview without touching Live; publish it to make it Live —
appbuilder app pull <version> Downloads a released version's source into a new folder and records it as that folder's base --out <dir> (default ../<api_name>-v<version>)
appbuilder app actions list Shows the app's JS actions and the objects they're linked to —
appbuilder app actions link [action] [object] Links a JS action to an object, or changes whether it shows in the object's Perform Action menus. Warns when the action is in Live, since the change reaches every Live user at once --menu, --no-menu (default for a new link)
appbuilder app actions unlink [action] [object] Removes a JS action's link to an object —
appbuilder app preview delete Deletes your preview, or another developer's with --owner. Deleting the app's only version needs --delete-app --owner <userId>, --expect-updated <ts> (delete only if the preview hasn't changed since it was reviewed), --delete-app
appbuilder setup-codex Installs or refreshes the Codex skills (.agents/skills) in a plugin --include-lib

Changed commands

Command Change
appbuilder whoami New --json flag prints the identity as JSON

Common to every app command

  • Dry run by default: every write command is a dry run unless you pass --yes (or confirm at a terminal). --dry-run forces one.
  • Production: writes to go/fmo need --allow-production.
  • Headless JSON: --json prints a JSON result (always headless). Each dry run includes an applyArgv pinned to the account (and preview) it reviewed. When a decision is needed, the result lists its choices and the command exits 2.
  • Account selection: --env, --business and --user pick the signed-in account. -c / --profile select deprecated API-key credentials.
  • Interactive mode: at a terminal, commands run interactively. --no-interactive or APPBUILDER_NO_INTERACTIVE forces headless.

Jira: https://kizen.atlassian.net/browse/KZN-19254

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Cancellation during readPushMap with --forget can still allow writePushMap to remove the remembered target after the flow is aborted, so the write path needs an abort check.

No open issues 🎉

What changed in this PR

Adds Business App workflows to appbuilder, extending the CLI beyond plugin scaffolding and local development to preview, release, merge, rollback, and action-link management.

Changes:

  • Registers Business App commands with shared interactive UI and headless controls.
  • Adds Codex skill setup and shared Claude/Codex template management.
  • Adds JSON identity output, OAuth storage checks, safer API redirects, and local app-state tracking.

The .copilot-docs/ reference files were unavailable, so plugin-contract verification was limited; the documentation setup workflow may not have run.

File Description
src/​ui/​Working.tsx Extracts the shared progress indicator.
src/​ui/​SessionFrame.tsx Shares session framing and command-exit handling.
src/​ui/​SelectList.tsx Adds filtering and initial selection.
src/​ui/​PushUI.tsx Adopts shared UI and cancellation handling.
src/​ui/​Lines.tsx Extracts multiline text rendering.
src/​ui/​ErrorFrame.tsx Shares error and choice rendering.
src/​ui/​ConfirmPrompt.tsx Shares standard and production confirmations.
src/​ui/​commandSession.ts Centralizes account resolution and flow controls.
src/​ui/​ChoiceList.tsx Maps command choices to selectable items.
src/​ui/​AppUI.tsx Renders interactive Business App workflows.
src/​templates/​claude/​skills/​kizen-custom-block/​SKILL.md Updates agent guidance and harness placeholders.
src/​program.ts Registers app and Codex setup commands.
src/​lib/​whoamiCommand.ts Adds structured JSON identity output.
src/​lib/​setupCodex.ts Implements Codex managed-file setup.
src/​lib/​setupCodex.test.ts Covers Codex setup and unsafe paths.
src/​lib/​setupClaude.ts Reuses shared agent-file management.
src/​lib/​setupClaude.test.ts Updates skill coverage and symlink checks.
src/​lib/​oauthStore.ts Adds storage probes and write-error classification.
src/​lib/​oauthSession.ts Checks storage before login and refresh.
src/​lib/​oauthSession.test.ts Covers unwritable storage and disk exhaustion.
src/​lib/​oauthCommands.ts Shares interactivity detection and storage-error hints.
src/​lib/​oauthCommands.test.ts Covers JSON identity and failure responses.
src/​lib/​oauth.ts Defines actionable session-storage errors.
src/​lib/​managedFiles.ts Validates managed paths before reading or writing.
src/​lib/​managedFiles.test.ts Covers symlinks and invalid managed paths.
src/​lib/​listSearch.ts Implements accent-insensitive list filtering.
src/​lib/​listSearch.test.ts Covers filtering and original item indices.
src/​lib/​kizenTypes.ts Extends API types for app operations.
src/​lib/​kizenClient.ts Adds request primitives and redirect restrictions.
src/​lib/​interactive.ts Centralizes interactive versus headless selection.
src/​lib/​interactive.test.ts Covers terminal, automation, and flag detection.
src/​lib/​gitignore.ts Reports whether ignore entries were written.
src/​lib/​gitignore.test.ts Covers the write-status return value.
src/​lib/​createPlugin.ts Includes Codex skills in new projects.
src/​lib/​createPlugin.test.ts Verifies both scaffolded skill sets.
src/​lib/​createHeadless.ts Clarifies marketplace versus Business App requirements.
src/​lib/​createCopilotFiles.ts Renders shared skills for both agents.
src/​lib/​createCopilotFiles.test.ts Covers harness-specific generated files.
src/​lib/​commandCore.test.ts Covers credentials, write gates, and failure output.
src/​lib/​businessAppPayload.ts Maps packaged plugins to app publish bodies.
src/​lib/​businessAppPayload.test.ts Covers payload mapping and field filtering.
src/​lib/​appState.ts Persists folder bases and preview state.
src/​lib/​appState.test.ts Covers state preservation and write safeguards.
src/​lib/​agentSkills.test.ts Validates templates and documented CLI commands.
src/​lib/​agentSetup.ts Shares agent-file setup and staleness detection.
src/​lib/​agentSetup.test.ts Covers managed-file staleness across agents.
src/​lib/​agentHarness.ts Defines agent metadata and template rendering.
src/​commands/​setupCodex.ts Exposes Codex setup options.
src/​commands/​interactive.test.ts Covers command-level UI routing.
src/​commands/​encrypt.ts Adds shared headless-mode selection.
src/​commands/​create.ts Adds explicit noninteractive scaffolding control.
src/​commands/​block.ts Adds shared headless-mode selection.
src/​commands/​auth.ts Exposes JSON identity and login interactivity flags.
src/​commands/​app.ts Defines Business App commands and options.
src/​__snapshots__/​program.test.ts.snap Updates help output for new commands.
pnpm-lock.yaml Locks archive and ignore-rule dependencies.
package.json Bumps the version and adds dependencies.

Review effort: Balanced

@mauricebecnel400 mauricebecnel400 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@keegandonley
keegandonley merged commit 3811cee into main Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants