The OwnStak CLI is a useful tool that allows users to build, deploy, and manage their projects on the Ownstak platform. With a focus on simplicity and efficiency, this CLI provides a seamless experience for developers.
You can install OwnStak CLI globally by running:
- NPM
- PNPM
- Yarn
- Bun
npm i -g ownstak
pnpm add -g ownstak
yarn global add ownstak
bun add -g ownstak
You can display CLI help by running:
npx ownstak --help
OwnStak CLI v0.1.5 help
Usage: ownstak [options] [command]
Build and deploy your project to OwnStak
Options:
-v, --version Output the version number
-d, --debug Enable debug mode
-h, --help Display help for command
Commands:
build [options] [framework] Build the app for production
dev Start the project in development mode
start|run Start the project in production mode
deploy [options] Deploy the project to the platform
login [options] Log in to the platform
logout [options] Log out of the platform
config Manage the OwnStak project config
upgrade [version] Upgrade the CLI to the latest or specified version
help [command] Display help for command
Examples:
npx ownstak build nextjs
npx ownstak build astro
npx ownstak config init
Global Options
The following global options are available for all commands:
-d, --debug
: Enables debug mode with more verbose output (by settingLOG_LEVEL=debug
). This is useful for issues troubleshooting.-h, --help
: Displays help information for the specified command.
Available commands
ownstak deploy
Builds and deploys your project to the Ownstak platform.
Options:
--organization <org>
: Deploy to a specific organization.--project <name>
: Deploy under a specific project name.--environment <env>
: Deploy to a specific environment (e.g.,development
,production
).--api-key <secret-key>
: Use a specific API Key (useful for CI/CD).--skip-build
: Skips the build step and uses existing build from.ownstak
folder produced by thenpx ownstak build
command.--skip-framework-build
: Skips the framework build step and uses existing build output (for example:.next
folder from Next.js framework).
Example:
npx ownstak deploy --organization=my-org --project=my-app --environment=prod --api-key=<my-secret-key>
- If the user isn't logged in on the current machine and no
--api-key
argument is provided, the command will prompt the user to log in. - If no organization or project name is defined in
ownstak.config.js
and they aren't provided via CLI arguments, the command will prompt the user for these values and save them to the config file for future deployments.
ownstak build
Builds your project for production deployment.
Arguments:
[framework]
(optional): Specify the framework to use for the build (e.g.,nextjs
,astro
). If omitted, the CLI will auto-detect.
Options:
--skip-framework-build
: Skip the build of the framework and use existing build output--assets-dir
: Specify a directory with static assets. If omitted, the CLI will auto-detect.
Example:
npx ownstak build nextjs
ownstak start
Starts your previously built project in production mode locally.
Example:
npx ownstak start
ownstak dev
Starts your project in development mode with hot reloading if this option is available for the given framework.
Example:
npx ownstak dev
ownstak login
Logs you into the Ownstak platform on the given device for convenience. Use this command only on devices you trust.
Options:
--api-key <secret-key>
: Log in using an API Key (for CI or headless environments).
Example:
npx ownstak login
ownstak logout
Logs you out from the Ownstak platform on the given device.
Example:
npx ownstak logout
ownstak upgrade
Upgrades the CLI to the latest or a specified version.
Arguments:
[version]
(optional): The version to upgrade to. If omitted, upgrades to the latest minor version.
Example:
npx ownstak upgrade
npx ownstak upgrade 0.2.0
ownstak config init
Initializes a new Ownstak configuration file in your project. This configuration file allows you to override default values for your project.
Example:
npx ownstak config init
ownstak config print
Displays the current Ownstak configuration for your project.
Example:
npx ownstak config print
ownstak help
Displays help information for the CLI or a specific command.
Arguments:
[command]
(optional): The command to show help for.
Example:
npx ownstak help
npx ownstak help deploy