@linguanahq/cli
v0.1.6
Published
Create and connect multilingual apps with Linguana.
Downloads
1,023
Readme
@linguanahq/cli
Create and connect multilingual apps with Linguana. Requires Node 22.12+; also runs on Bun. The executable is linguana.
npx @linguanahq/cli create app my-blog --framework solidjs --template blog --demo
cd my-blog
npm run devChoose from blank (a minimal translated hello world with hot reload), blog (Elsewhere), saas (Relay), and storefront (Common Goods) on React, Vue, Svelte, SolidJS, or TanStack Start. All 20 apps are standalone and include local assets, English/French/Spanish/Arabic demo catalogs, deployment configuration, and an MIT license. Demo mode makes no Linguana API requests.
Initial release availability: local demo scaffolding is available now. The hosted API and browser authorization deployment are pending, so login, --connect, link, and env pull require a compatible self-hosted server supplied with --api-url until that deployment is complete. Hosted template demo links are not included yet; run the generated apps locally using the commands above.
Use --connect instead of --demo for browser login and guided organization/project setup. With no mode flag, interactive creation asks you; noninteractive creation requires an explicit choice. --yes never opts you into account connection.
npx @linguanahq/cli login
npx @linguanahq/cli login --no-browser
npx @linguanahq/cli whoami
npx @linguanahq/cli orgs list
npx @linguanahq/cli projects list --organization ORGANIZATION_ID
npx @linguanahq/cli link --project PROJECT_ID
npx @linguanahq/cli env pull --environment staging
npx @linguanahq/cli languages list
npx @linguanahq/cli languages search french
npx @linguanahq/cli languages add fr es
npx @linguanahq/cli languages add
npx @linguanahq/cli doctor
npx @linguanahq/cli logoutManage connected project languages with languages list (source and enabled targets), languages list --all (the full registry and project status), languages search <query>, and languages add [codes...]. Search matches codes, English/native names, and country names/codes. Adding without codes opens a searchable multiselect; automation must supply codes, such as languages add fr,es --json. --yes never selects languages automatically.
These commands use the connected linguana.json in the current directory or an explicit --project <id>, your CLI account login, and the usual --api-url precedence. Owner/Admin/Editor access can enable targets; Viewers can read. Adding is safe to repeat: enabled languages and the source are no-ops, and re-enabling preserves existing settings. Targets apply to subsequent authenticated builds; the command does not start translation or publish catalogs. Demo catalogs are outside this workflow.
Read commands return { projectId, sourceLocale, languages } in JSON. Add returns { projectId, results }, with outcomes added, reenabled, already_enabled, or source. On a partial failure, error.details includes projectId, completed results, failedCode, and unattemptedCodes; rerun the command to finish.
The CLI account session stays outside projects, partitioned by API origin. Build tokens go into ignored .env.local or explicit staging/production environment files. The CLI preserves unrelated variables and comments, rejects tracked credential files, and asks before replacing conflicting values. Use --overwrite-env to authorize replacement in automation.
Owner/Admin access is required to create credentials. Provisioning reuses existing APIs and defaults. It never starts paid translation or publishes production catalogs. Existing project locales stay unchanged unless --locales is supplied. env pull reuses valid local secrets; the server cannot recover previously issued token secrets.
link detects your framework and configures linkage/environment only. Integrate the SDK in existing app code using the printed guide. It does not rewrite components or Vite configuration.
Options include --package-manager npm|pnpm|yarn|bun, --skip-install, --organization, --project, --new-organization, --new-project, --locales, --environment, --api-url, --yes, and --json. Run each command with --help for its supported options.
The default API is https://api.linguana.dev. Overrides require HTTPS, except HTTP loopback development. Authenticated requests do not follow redirects. LINGUANA_CONFIG_DIR overrides account-session storage; LINGUANA_AUTH_TOKEN can supply an account session for controlled automation. Never include either session credentials or build tokens in browser variables, committed files, or shared logs.
Exit codes: success 0, operational failure 1, invalid input 2, cancellation 130. If dependency installation fails, the generated app is retained. Interrupted connected setup can be resumed with link; its nonsecret recovery journal is .linguana/setup.json.
Every generated app includes DEPLOY.md for Cloudflare and generic static hosting (or a Node server for TanStack Start). Hosting authentication and deployment are outside this CLI.
Full documentation. New CLI and template code: MIT.
