@olenbetong/appframe-cli
v4.12.1
Published
Utility functions for AppframeWeb
Readme
Appframe CLI
Utility commands for deploying and maintaining Appframe Web applications.
Installation
pnpm install --save-dev @olenbetong/appframe-cliCommands
Use af <command> --help for full usage with options.
Core
af update: Installs latest@olenbetong/appframe-cliglobally. If in a workspace, also updates local dev dependency when present.af launch:- Opens the updater web app. Options:
--server <host>(defaultdev.obet.no),--all,--browser <chrome|firefox|msedge>.
- Opens the updater web app. Options:
af auth [env]:- Logs in to
dev|stage|prod(or a hostname): asks for the password in a terminal and saves it in the OS keychain, and the session cookies in~/.af. Run it after changing your password. Options:--username <user>. af auth status [env]shows the username, where the password comes from and the session per site;af auth logout [env] [--all]removes them.af auth username [env]/af auth password [env]print the login other tools should use, for scripts and SQL clients.- Credentials, per site:
APPFRAME_LOGIN_<ENV>/APPFRAME_PWD_<ENV>(DEV,STAGE,PROD), thenAPPFRAME_LOGIN/APPFRAME_PWD, then whataf authsaved. See auth.md.
- Logs in to
af auth-cookie [env]:- Prints the auth cookie string for scripting.
envas above.
- Prints the auth cookie string for scripting.
Change Management
af namespace-to-prod [namespace](aliasntp):- From dev → stage → prod: generate + deploy on dev, download+apply+deploy on stage, and download + apply on prod (prompting first in a terminal).
- Options:
--skip-generate(dev),--no-apply(only download on prod, no prompt),--hold(put the downloaded transactions on hold on prod instead of applying them).--applyis still accepted and is the default. - Empty apply/deploy steps are skipped and the run ends with a per-server count, or "Nothing to deploy" when generate found nothing.
- Set
AF_TRACE_EXIT=1on any command to print what keeps the process alive if it does not exit on its own.
af generate [namespace]:- Generates transactions on a server and lists them. Options:
--server <host>(defaultdev.obet.no).
- Generates transactions on a server and lists them. Options:
af list [namespace]:- Lists transactions to apply or deploy. Options:
--server <host>--type <apply|deploy>(interactive prompt if TTY; defaults toapplyin non‑TTY)--group(show count per namespace)
- Lists transactions to apply or deploy. Options:
af apply [namespace]:- Applies updates. Interactive confirmation by default. Options:
--server <host>(defaulttest.obet.no)--preapprove <name>(repeatable; names to apply without prompt)
- Applies updates. Interactive confirmation by default. Options:
af deploy [namespace]:- Deploys transactions. Options:
--server <host>.
- Deploys transactions. Options:
af check-updates:- Shows how many updates are available to download per namespace. Options:
--server <host>.
- Shows how many updates are available to download per namespace. Options:
af download [namespace]:- Downloads transactions. Options:
--server <host>.
- Downloads transactions. Options:
Data Resources (Data API)
af resources list [search]:- Lists available resources (table/view/procedure). Options:
--server <host>.
- Lists available resources (table/view/procedure). Options:
af resources view [resource]:- Prints the resource definition. Options:
--server <host>.
- Prints the resource definition. Options:
af resources generate <resource>:- Generates a data object or procedure client snippet. Common options:
--id <id>(defaultdsDataObject)--global(useaf.dataglobals)--types(include generated TS types)--fields [f1,f2](limit fields; supports interactive selection with--fields)--permissions <IUD>(Insert/Update/Delete flags)--max-records <n>(default50for data objects)--sort-order <field:Asc|Desc|AscNullsLast|DescNullsFirst,...>--master <Name[:path]>and--link-fields <this:master,...>--expose [id](expose onaf.article.dataObjects)--dynamic,--unique <table>--overrides "Field:Type,Param:Type"--group-by <a,b>,--aggregates <Field:SUM,...>,--distinct,--where <clause>
- Generates a data object or procedure client snippet. Common options:
af resources add <id>: Adds a data resource by DB object id. Options:--server <host>,--name [name].af resources delete <id>: Deletes a data resource by id or name. Options:--server <host>.
Note: To manage data objects and procedures declaratively, use the
resources.yamlconfig system in@olenbetong/appframe-vite. Seeappframe-vite resources add/edit/generatecommands.
Bundles
af bundle create: Scaffold a new bundle project.af bundle upload [package]:- Packs and uploads an npm package as a bundle. Options:
--bundle <name>to override default.
- Packs and uploads an npm package as a bundle. Options:
af bundle publish [package]:- Publishes the latest bundle version and deploys it (dev→stage→prod download). Uses current package if none provided.
Website Assets
af assets deploy:- Uploads site scripts, styles, and templates based on
package.json.appframe.assets. - Options:
--server <host>(defaultdev.obet.no),--no-test,--production,--hostname <host>(limit to one site).
- Uploads site scripts, styles, and templates based on
af assets publish:- Publishes uploaded assets with a description
v<version> (<git sha>). - Options:
--server <host>,--hostname <host>.
- Publishes uploaded assets with a description
