@noya-app/cli
v0.2.4
Published
Noya CLI to deploy static sites and create apps
Readme
@noya-app/cli
Noya CLI for deploying static sites to Noya and optionally creating an app pointing to the deployed site.
Install
- Global:
npm i -g @noya-app/cli - Ad‑hoc:
npx @noya-app/cli deploy
Command
noya deploy [dir]- Deploys a static folder to Noya. If no
diris provided, it looks fordistorout. - Flags:
--appAlso create an app (tool) that points to the deployed URL.--name <name>Name to use when--appis passed (otherwise prompted).--token <token>Personal access token. Alternatively, setNOYA_TOKEN.--workspace-id <id>Workspace to deploy to. Alternatively, setNOYA_WORKSPACE_ID.--api <url>API base URL. Defaults tohttps://www.noya.io/apiorNOYA_API_URL.--dry-runShow what would happen without making any network calls or writes.--preflightShow discovered config (API, paths, files, siteId) and ask to confirm before deploying.-y, --yesSkip the preflight confirmation prompt.
- Deploys a static folder to Noya. If no
noya login- Stores a personal access token in the global Noya config.
- Flags:
--token <token>Personal access token. Alternatively, setNOYA_TOKEN.-f, --forceReplace an existing token without confirmation.
noya init [name]- Initializes an app using the supplied project name, or prompts when omitted.
noya set [image transform options]- Sets
theme.transform.image.urland/or workflow-formattheme.transform.image.inputswhile preserving other theme properties. - Uses
appIdfrom the nearest.noya/deploy.jsonby default. - Flags:
--theme.transform.image.url <url>Set the transform script URL.--theme.transform.image.inputs <json>Set input definitions from one JSON array.--app-id <id>Target a specific app instead of using deploy config.--token <token>Personal access token. Alternatively, setNOYA_TOKEN.--api <url>API base URL. Defaults tohttps://www.noya.io/apiorNOYA_API_URL.
- Sets
Environment variables
NOYA_TOKENPersonal access token for authenticated deploys.NOYA_WORKSPACE_IDWorkspace to use for new sites.NOYA_API_URLOverride API base URL (e.g.https://staging.noya.io/api).
Config file
- After a successful deploy (non–dry‑run), the CLI writes
.noya/deploy.jsonin your project root so subsequent deploys go to the same site. - Fields:
siteId: Site to deploy to on subsequent runssubdomain: Subdomain used for pretty URLs (if available)url: Resolved URL to the sitedeployDir: The relative folder that was deployedappId: The created app’s id (when--appis used)workspaceId: Workspace used when the site was created
Examples
- First deploy from default folder:
noya deploy - Explicit folder:
noya deploy ./out - With token env:
NOYA_TOKEN=… noya deploy - Also create an app:
noya deploy --app --name "My App" - Non-interactive deploy:
noya deploy --workspace-id workspace_123 --token "$NOYA_TOKEN" --app --name "My App" --preflight --yes - Non-interactive login:
noya login --token "$NOYA_TOKEN" --force - Configure an image transform:
noya set --theme.transform.image.url "https://my-app.noya.io/imageTransform.js" - Configure image transform inputs:
noya set --theme.transform.image.inputs '[{"kind":"data","name":"width","required":true,"schema":{"type":"number","_kind":"Number","default":1200}}]' - Dry run (no network/writes):
noya deploy --dry-run - Preflight confirmation:
noya deploy --preflight
