create-asaje-go-vue
v0.3.11
Published
CLI to scaffold, configure, and run the Asaje Go + Vue boilerplate
Downloads
679
Maintainers
Readme
create-asaje-go-vue
CLI package for scaffolding and running the Asaje Go + Vue boilerplate.
Commands
Railway command reference
| Command | Purpose |
| --- | --- |
| asaje sync-project-config [directory] | Scan the project, detect managed services, and rewrite asaje.config.json / asaje.railway.json |
| asaje sync-readme [directory] | Regenerate the project README.md from asaje.config.json |
| asaje sync-github-workflow [directory] | Regenerate the GitHub Actions Railway deploy workflow from asaje.config.json |
| asaje setup-railway [directory] | Provision infrastructure, create missing Railway services, wire variables, and deploy |
| asaje update-railway [directory] | Reconcile an existing Railway project after changing asaje.config.json |
| asaje sync-railway-env [directory] | Reapply Railway variables without reprovisioning infra |
| asaje print-railway-config [directory] | Print resolved Railway config for one environment |
| asaje export-railway-config [directory] | Export resolved Railway config to a JSON snapshot |
| asaje import-railway-config [directory] | Apply variables from a previously exported Railway snapshot |
| asaje diff-railway-config [directory] | Compare two Railway environments or snapshots |
| asaje deploy-railway [directory] | Redeploy managed app services from the current source tree |
| asaje destroy-railway [directory] | Delete the linked Railway environment or project |
Create a project
npx create-asaje-go-vue@latest my-appLocal development:
cd cli
npm install
node ./bin/create-asaje-go-vue.js my-appStart a project
After linking or installing the package globally:
asaje start ./my-appWithout global install:
npx -p create-asaje-go-vue@latest asaje start ./my-appCheck your setup
npx -p create-asaje-go-vue@latest asaje doctor ./my-appValidate the package before publish
npx -p create-asaje-go-vue@latest asaje publishUpdate an existing project from the template
npx -p create-asaje-go-vue@latest asaje update ./my-app --dry-run
npx -p create-asaje-go-vue@latest asaje update ./my-app --yes
npx -p create-asaje-go-vue@latest asaje update ./my-app --include admin/src/stores/session.ts,admin/src/services/http/session.tsScan the project and regenerate local config manifests
npx -p create-asaje-go-vue@latest asaje sync-project-config ./my-app --dry-run
npx -p create-asaje-go-vue@latest asaje sync-project-config ./my-app --yesRegenerate the GitHub Actions Railway workflow
npx -p create-asaje-go-vue@latest asaje sync-github-workflow ./my-app
npx -p create-asaje-go-vue@latest asaje sync-github-workflow ./my-app --dry-runRegenerate the project README
npx -p create-asaje-go-vue@latest asaje sync-readme ./my-app
npx -p create-asaje-go-vue@latest asaje sync-readme ./my-app --dry-runProvision Railway resources
npx -p create-asaje-go-vue@latest asaje setup-railway ./my-app
npx -p create-asaje-go-vue@latest asaje setup-railway ./my-app --dry-run
npx -p create-asaje-go-vue@latest asaje update-railway ./my-app --yesBy default this manages six Railway app services:
apiworkerrealtime-gatewayadminlandingpwa
The default worker service reuses api/Dockerfile and starts with API_COMMAND=worker.
Sync Railway app variables
npx -p create-asaje-go-vue@latest asaje sync-railway-env ./my-app
npx -p create-asaje-go-vue@latest asaje sync-railway-env ./my-app --diff --dry-run
npx -p create-asaje-go-vue@latest asaje sync-railway-env ./my-app --dry-runPrint resolved Railway config
npx -p create-asaje-go-vue@latest asaje print-railway-config ./my-app
npx -p create-asaje-go-vue@latest asaje print-railway-config ./my-app --environment production
npx -p create-asaje-go-vue@latest asaje print-railway-config ./my-app --environment production --json
npx -p create-asaje-go-vue@latest asaje print-railway-config ./my-app --environment production --show-secrets
npx -p create-asaje-go-vue@latest asaje print-railway-config ./my-app --write-configExport resolved Railway config snapshot
npx -p create-asaje-go-vue@latest asaje export-railway-config ./my-app
npx -p create-asaje-go-vue@latest asaje export-railway-config ./my-app --environment production
npx -p create-asaje-go-vue@latest asaje export-railway-config ./my-app --environment production --output ./snapshots/railway.production.json
npx -p create-asaje-go-vue@latest asaje export-railway-config ./my-app --environment production --show-secretsImport a Railway config snapshot
npx -p create-asaje-go-vue@latest asaje import-railway-config ./my-app --file ./snapshots/railway.production.json --yes
npx -p create-asaje-go-vue@latest asaje import-railway-config ./my-app --file ./snapshots/railway.production.json --diff --dry-runDiff Railway configs or snapshots
npx -p create-asaje-go-vue@latest asaje diff-railway-config ./my-app --environment production --compare-environment staging
npx -p create-asaje-go-vue@latest asaje diff-railway-config ./my-app --environment production --compare-file ./snapshots/railway.production.json
npx -p create-asaje-go-vue@latest asaje diff-railway-config ./my-app --file ./snapshots/railway.staging.json --compare-file ./snapshots/railway.production.json --jsonRedeploy Railway app services
npx -p create-asaje-go-vue@latest asaje deploy-railway ./my-app
npx -p create-asaje-go-vue@latest asaje deploy-railway ./my-app --service worker
npx -p create-asaje-go-vue@latest asaje deploy-railway ./my-app --service api
npx -p create-asaje-go-vue@latest asaje deploy-railway ./my-app --services api,admin --dry-runDestroy Railway resources
npx -p create-asaje-go-vue@latest asaje destroy-railway ./my-app
npx -p create-asaje-go-vue@latest asaje destroy-railway ./my-app --scope project --yesWhat create does
- clones the boilerplate from GitHub with
degit - removes template-only files such as
cli/ - asks project setup questions for ports, storage, mail, seeds, and locale
- writes
asaje.config.json - generates service-local
.envfiles foradmin,api,realtime-gateway,landing, andpwa - optionally installs dependencies and starts Docker infrastructure
What asaje start does
- validates project structure
- creates missing
.envfiles from examples when possible - optionally installs dependencies
- optionally starts Docker infrastructure
- starts any combination of
api,worker,realtime-gateway,admin,landing, andpwa - supports profiles:
full,backend-only,frontend-only, andcustom - streams service logs until you stop with
Ctrl+C
What asaje doctor does
- checks required local tools:
node,pnpm,go,docker - validates the target project structure
- verifies
.envfiles or their corresponding.env.examplefallbacks
What asaje publish does
- runs
npm run check - runs
npm run pack:dry-run - prints the final manual npm release steps
What asaje update does
- validates the target project structure
- reads the template repository and branch from
asaje.config.jsonwhen available - clones the latest template into a temporary directory
- overwrites a safe set of boilerplate-managed files such as Railway config, Dockerfiles, generated Swagger docs, and
.env.examplefiles - supports
--includefor explicitly overwriting extra files or directories from the template, such asadmin/src/stores/session.ts - supports
--dry-runto preview which files would be updated - updates
asaje.config.jsonwith the template repository and branch used for the update
What asaje sync-project-config does
- scans the project tree for service-local
Dockerfilefiles - infers Railway managed services from the detected directories
- preserves existing service metadata when possible, while updating directories and Dockerfile paths from the scan
- rewrites
asaje.config.jsonwith the mergedrailway.serviceslist - rewrites
asaje.railway.jsonso local service names line up with the current managed service list - supports
--dry-runto preview the rewrite without changing local files
What asaje setup-railway does
- validates the target project structure
- checks that the Railway CLI is installed and authenticated
- reads the linked Railway project context
- provisions PostgreSQL, RabbitMQ, and S3-compatible object storage on Railway
- creates missing Railway app services for the configured app service list
- defaults to
api,worker,realtime-gateway,admin,landing, andpwawhen no custom Railway service config is present - applies Railway variables from
asaje.config.jsonwhen configured - keeps the automatic variable wiring for
api,worker,realtime-gateway,admin,landing, andpwa; by default existing Railway values are preserved unless explicitly overridden in project config - triggers the first Railway deployment for each app service using the service-local
Dockerfileandrailway.json - generates missing app secrets such as
JWT_SECRETandSWAGGER_PASSWORD, while reusing existing Railway values when present - supports
--dry-runto preview provisioning and variable changes without applying them - writes an
asaje.railway.jsonmanifest in the target project for future runs, including discovered Railway app service names
What asaje update-railway does
- runs the same reconciliation flow as
setup-railway - is intended to be rerun after changing
railway.services,railway.variables, orrailway.environmentsinasaje.config.json - provisions any newly configured services/resources that are still missing
- reapplies variables and redeploys the configured app services
- is safe to use repeatedly as an idempotent Railway reconciliation command
What asaje sync-railway-env does
- validates the target project structure
- checks that the Railway CLI is installed and authenticated
- reads the linked Railway project context
- discovers existing Railway app and infra services
- syncs configured Railway variables without provisioning infra resources
- keeps the automatic variable wiring for
api,worker,realtime-gateway,admin,landing, andpwa; by default existing Railway values are preserved unless explicitly overridden in project config - supports
--diffto show what would be added or changed compared with the current Railway variables - supports
--dry-runto preview variable changes without applying them
What asaje print-railway-config does
- validates the target project structure locally
- resolves the managed Railway services from
asaje.config.json - resolves the selected logical deployment environment and its Railway environment mapping
- computes the final variable set per managed service after all merges and overrides
- supports
--jsonfor machine-readable output - redacts secret-looking values in the printed output by default
- supports
--show-secretswhen you explicitly want the raw values in the output - supports
--write-configto write the resolved per-service variables back intoasaje.config.jsonfor later adjustment - when
--write-configis used without--show-secrets, sensitive-looking variables are omitted from the file to avoid writing redacted placeholders
What asaje export-railway-config does
- builds the same resolved config payload as
print-railway-config - writes it to a JSON file for snapshotting, auditing, or sharing between environments
- defaults the filename to
.railway-config.<environment>.jsonin the project root when--outputis omitted - redacts secret-looking values by default
- supports
--show-secretswhen you explicitly want the raw values in the exported file
What asaje import-railway-config does
- reads a JSON snapshot produced by
export-railway-configorprint-railway-config --json - applies the snapshot variables to the current project's Railway services by service key
- supports
--diffto compare current Railway values with the snapshot before applying - supports
--dry-runto preview the import without changing Railway - rejects snapshots that still contain
[redacted]placeholders, so secret imports require--show-secretsat export time
What asaje diff-railway-config does
- compares two resolved Railway configurations
- supports comparing current project environments with
--environmentand--compare-environment - supports comparing against exported snapshots with
--fileand--compare-file - shows service-level metadata changes and variable-level additions, removals, and modifications
- supports
--jsonfor machine-readable diff output
What asaje deploy-railway does
- validates the target project structure
- checks that the Railway CLI is installed and authenticated
- reads the linked Railway project context
- discovers the existing Railway app services from the linked project or
asaje.railway.json - triggers fresh Railway builds/deployments for the configured app service list from the current local source tree
- defaults to
api,worker,realtime-gateway, andadminwhen no custom Railway service config is present - supports
--serviceand--servicesto redeploy only selected app services - supports
--dry-runto preview which services would be redeployed
Railway Configuration
You can fully describe the managed Railway app services, variables, and deployment environments in asaje.config.json.
If the railway block is omitted, the CLI keeps the default built-in services and the previous automatic variable behavior.
{
"projectName": "My App",
"projectSlug": "my-app",
"railway": {
"variablesMode": "preserve-remote",
"services": [
{
"key": "api",
"directory": "api",
"dockerfile": "api/Dockerfile"
},
{
"key": "worker",
"directory": "api",
"baseName": "worker",
"aliases": ["worker", "api-worker"],
"dockerfile": "api/Dockerfile"
},
{
"key": "admin",
"directory": "admin",
"dockerfile": "admin/Dockerfile"
},
{
"key": "realtime",
"directory": "realtime-gateway",
"baseName": "realtime-gateway",
"aliases": ["realtime-gateway"],
"dockerfile": "realtime-gateway/Dockerfile"
},
{
"key": "marketing",
"directory": "marketing",
"baseName": "marketing",
"serviceName": "my-app-marketing"
}
],
"variables": {
"shared": {
"LOG_LEVEL": "info"
},
"services": {
"api": {
"APP_ENV": "local"
},
"admin": {
"VITE_APP_NAME": "My App"
},
"worker": {
"WORKER_CONCURRENCY": "4"
}
}
},
"environments": {
"staging": {
"railwayEnvironment": "staging",
"variables": {
"shared": {
"APP_STAGE": "staging"
},
"services": {
"api": {
"CORS_ALLOWED_ORIGINS": "https://staging-admin.example.com"
},
"admin": {
"VITE_API_BASE_URL": "https://${{ api.RAILWAY_PUBLIC_DOMAIN }}/api/v1",
"VITE_REALTIME_BASE_URL": "https://${{ realtime-gateway.RAILWAY_PUBLIC_DOMAIN }}"
}
}
}
},
"production": {
"railwayEnvironment": "production",
"variables": {
"shared": {
"APP_STAGE": "production"
},
"services": {
"api": {
"CORS_ALLOWED_ORIGINS": "https://admin.example.com"
},
"admin": {
"VITE_APP_NAME": "My App"
}
}
}
}
}
}
}Supported top-level Railway fields:
variablesMode:preserve-remoteby default; usesync-managedto force CLI-managed values to overwrite Railway values, orreplaceto disable automatic generated variables and rely only onrailway.variablesservices: managed Railway application services deployed bysetup-railwayanddeploy-railwayvariables.shared: variables applied to every managed servicevariables.services.<key>: variables applied only to one managed serviceenvironments.<name>.railwayEnvironment: optional mapping from a logical config key likeproductionto the real Railway environment name or idenvironments.<name>.variables.shared: shared variables only for that deployment environmentenvironments.<name>.variables.services.<key>: service-specific overrides only for that deployment environmentci.githubActions.deployRailway.enabled: generate a GitHub Actions workflow for Railway deploysci.githubActions.deployRailway.branchEnvironments: map Git branches to logical Railway environments such asdevelop -> stagingandmain -> production
Supported fields per service in railway.services:
key: unique internal identifier used in the manifest and CLI selection flagsdirectory: project-relative directory deployed withrailway up <directory> --path-as-rootbaseName: optional suffix used to build the default Railway service name as<projectSlug>-<baseName>serviceName: optional explicit Railway service name overridealiases: optional extra names that help the CLI match an already-existing Railway serviceseedImage: optional bootstrap image used only whensetup-railwayneeds to create the Railway service before the first deploydockerfile: optional project-relative Dockerfile path validated by the CLI for documentation/safety; Railway still builds from the declareddirectory
How variable resolution works:
railway.variables.shared- then
railway.variables.services.<key> - then
railway.environments.<name>.variables.shared - then
railway.environments.<name>.variables.services.<key>
Variable modes:
preserve-remote: existing Railway values win over generated CLI defaults; explicit values declared inasaje.config.jsonstill override Railwaysync-managed: CLI-managed values overwrite the matching Railway variables, while undeclared Railway-only variables are left alonereplace: disables generated defaults and only applies the declarative variables defined inasaje.config.json- legacy
mergeis still accepted as an alias ofsync-managed
Environment-aware usage:
--environment productioncan point to either the logical config key or the real Railway environment name/id- if
--environmentis omitted, the CLI uses the linked Railway environment - if
railway.environments.defaultexists and definesrailwayEnvironment, it becomes the default target when--environmentis omitted
Notes:
- the service directory should contain the
DockerfileRailway will build from - custom services are provisioned and deployed by
setup-railwayanddeploy-railway sync-railway-envcan now apply declarative variables to any managed service key, including custom services- with
variablesMode: "preserve-remote", the core services still receive generated defaults only for missing Railway variables, while explicitrailway.variablesentries override the remote values - with
variablesMode: "sync-managed", the core servicesapi,worker,realtime-gateway,admin,landing, andpwareceive the CLI-managed values even when Railway already has a different value - the default
workerservice reuses theapiimage and starts withAPI_COMMAND=worker - with
variablesMode: "replace", only the variables declared inasaje.config.jsonare applied - after changing the Railway config, run
asaje update-railway ./my-app --yesto reconcile the linked Railway project with the new configuration - you can target a custom service with
asaje deploy-railway ./my-app --service worker
GitHub Actions deploy workflow notes:
- the generated workflow triggers only on the configured branches
- it detects changes per service directory and redeploys only the impacted Railway services
- config changes trigger
asaje sync-railway-envbefore service deploys - add
RAILWAY_TOKENas a GitHub repository secret before enabling the workflow in production
What asaje destroy-railway does
- validates the target project structure
- checks that the Railway CLI is installed and authenticated
- deletes either the linked Railway environment or the whole Railway project
- supports
--scope environment(default) and--scope project - supports
--dry-runto preview the destructive action without applying it - removes the local
asaje.railway.jsonmanifest after a successful deletion
Useful flags
node ./bin/create-asaje-go-vue.js my-app --template asaje379/boilerplate-go-vue --branch main
node ./bin/create-asaje-go-vue.js my-app --yes --skip-install --skip-infra
node ./bin/asaje.js start ../my-app --yes --profile backend-only
node ./bin/asaje.js start ../my-app --yes --profile frontend-only
node ./bin/asaje.js start ../my-app --yes --skip-admin --skip-worker
node ./bin/asaje.js doctor ../my-app
node ./bin/asaje.js publish .
node ./bin/asaje.js update ../my-app --dry-run
node ./bin/asaje.js update ../my-app --include admin/src/stores/session.ts --yes
node ./bin/asaje.js setup-railway ../my-app --yes
node ./bin/asaje.js update-railway ../my-app --yes
node ./bin/asaje.js setup-railway ../my-app --yes --dry-run
node ./bin/asaje.js sync-railway-env ../my-app --yes
node ./bin/asaje.js sync-railway-env ../my-app --yes --diff --dry-run
node ./bin/asaje.js print-railway-config ../my-app --environment production
node ./bin/asaje.js print-railway-config ../my-app --environment production --show-secrets
node ./bin/asaje.js export-railway-config ../my-app --environment production
node ./bin/asaje.js import-railway-config ../my-app --file ../snapshots/railway.production.json --yes
node ./bin/asaje.js diff-railway-config ../my-app --environment production --compare-environment staging
node ./bin/asaje.js deploy-railway ../my-app --yes
node ./bin/asaje.js deploy-railway ../my-app --services api,admin --yes
node ./bin/asaje.js destroy-railway ../my-app --scope environment --yesPublish checklist
npm install
npm run check
npm run doctor
npm run publish:check
npm run pack:dry-run
npm publishNotes
- default template repo comes from
ASAJE_TEMPLATE_REPOor falls back toasaje379/boilerplate-go-vue - default branch comes from
ASAJE_TEMPLATE_BRANCHor falls back tomain - if the selected branch is missing, the CLI retries
main,master, thendevelop asaje setup-railwayworks best withRAILWAY_API_TOKENorRAILWAY_TOKENset so it can verify existing remote services before provisioning- the package currently uses
UNLICENSED; change that before public distribution if needed - OTP email delivery still requires a valid Mailchimp Transactional key for real email sends
