Overview

Hadoken hosts Rails applications. You point it at a Rails app, and it handles everything else: building a container, running migrations, provisioning TLS, and giving you a live URL. There are no config files to write.

The CLI is a standalone binary (not a Ruby gem). It reads your Gemfile.lock to detect your Ruby version, database adapter, and which parts of the Rails stack you're using. Then it packages your source, builds an image, deploys it, and prints the URL.

After deploy, you get logs, environment variables, a Rails console, and the ability to run one-off commands -- all through the same CLI.

Quickstart

1. Install

$ curl -fsSL https://hadoken.dev/install.sh | sh

2. Get a Rails app

$ git clone https://github.com/hadoken-paas/rails-hello.git && cd rails-hello

Or use any existing Rails app with committed files.

3. Deploy

$ hadoken

The CLI handles account creation and login interactively on first run. It detects your app, builds, deploys, and prints the URL.

Deploy pipeline

Every deploy runs through these steps:

  1. Package -- The CLI creates a tarball from git ls-files. Only committed files are included. Use --include-untracked to add untracked files.
  2. Upload -- The tarball goes to the Hadoken API.
  3. Build -- A build job produces a container image from your source using Cloud Native Buildpacks. No Dockerfile needed.
  4. Migrate -- rails db:prepare runs automatically.
  5. Deploy -- Your container is deployed. A health check on /up confirms the app is ready.
  6. TLS -- A Let's Encrypt certificate is provisioned for your subdomain.

Deploy statuses

building --> deploying --> live \-> failed \-> build_failed

The CLI polls and waits by default. You can also check manually with hadoken status --watch.

Rollbacks

If the health check fails, the previous working version stays live. The deploy status shows failed.

CLI reference

Global flags

FlagDescription
--api, -aAPI base URL (default: https://api.hadoken.dev)
--project, -pProject name override
--jsonMachine-readable JSON output
--quiet, -qMinimal output
--debugDiagnostic output
--no-colorDisable ANSI colors

hadoken signup

Create an account. Prompts for email, username, and password (min 8 characters). Sends a verification email and waits for confirmation, then logs you in.

$ hadoken signup

hadoken login

Log in to an existing account.

FlagDescription
--username, -uUsername
--password-stdinRead password from stdin
--tokenAPI token (instead of username/password)
$ hadoken login $ echo "$PASS" | hadoken login -u myuser --password-stdin

hadoken logout

Remove stored credentials. Use --all to clear all profiles.

hadoken whoami

Show current identity.

$ hadoken whoami User: myuser Status: active API: https://api.hadoken.dev

hadoken init

Detect your Rails app and create a project. You can also skip this -- the first hadoken deploy auto-initializes.

FlagDescription
--nameProject name (default: directory basename)
--databaseOverride database: auto, sqlite, postgresql, mysql
--forceOverwrite existing config
--yes, -yAccept defaults

What init detects

PropertySource
Rails versionGemfile.lock
Ruby version.ruby-version or Gemfile
Databasesqlite3, pg, or mysql2 gem

hadoken / hadoken deploy

Deploy the current app. Bare hadoken is an alias for hadoken deploy.

FlagDescription
--message, -mDeploy annotation
--waitWait for completion (default: true)
--timeoutTimeout (default: 20m)
--verbose, -vShow build logs
--include-untrackedInclude untracked files
--dry-runValidate only, don't deploy
--yes, -yAccept defaults
--confirm-dirtyProceed with uncommitted changes
$ hadoken # deploy $ hadoken deploy -v # deploy with build logs $ hadoken deploy --dry-run # validate only $ hadoken deploy -m "fix login bug" # with annotation

hadoken status

Check deploy status.

FlagDescription
--deployDeploy ID (default: latest)
--watchPoll until done
--intervalPoll interval (default: 3s)
$ hadoken status Project: myapp Deploy: d-abc123 Status: live URL: https://myapp.hadoken.app

hadoken logs

View app logs.

FlagDescription
--follow, -fStream in real-time
--sinceSince duration or timestamp (default: 15m)
--tailNumber of lines (default: 200)
$ hadoken logs # last 15 minutes $ hadoken logs -f # stream live $ hadoken logs --since 1h # last hour

hadoken env

Manage environment variables. See Environment variables.

$ hadoken env # list (masked) $ hadoken env --unmask # list (plaintext) $ hadoken env set KEY=VALUE $ hadoken env get KEY $ hadoken env unset KEY

hadoken console

Open a Rails console on the running app. Requires kubectl in your PATH.

$ hadoken console

hadoken run

Run a one-off command on the running app.

FlagDescription
--interactive, -iAllocate TTY
$ hadoken run -- rails db:migrate $ hadoken run -- rails db:seed $ hadoken run -i -- bash

hadoken open

Open the app in your browser.

$ hadoken open

hadoken destroy

Tear down all resources. You must type the project name to confirm (or use --yes).

$ hadoken destroy Type project name to confirm: myapp Destroying myapp... done

hadoken completion

Generate shell completions for bash, zsh, fish, or powershell.

$ hadoken completion bash >> ~/.bashrc $ hadoken completion zsh >> ~/.zshrc

Environment variables

Setting variables

$ hadoken env set SECRET_KEY_BASE=abc123 STRIPE_KEY=sk_live_xxx $ hadoken env get SECRET_KEY_BASE abc123 $ hadoken env unset STRIPE_KEY

Each change triggers a rolling restart of your app. Values are encrypted at rest and masked in hadoken env output. Use --unmask to see plaintext.

Built-in variables

Set automatically on every deploy:

VariableValue
PORT8080
RAILS_ENVproduction
RAILS_SERVE_STATIC_FILES1
RAILS_LOG_TO_STDOUT1

CLI environment variables

These control the CLI itself, not your app:

VariableEffect
HADOKEN_APIOverride API base URL
HADOKEN_PROFILESelect credential profile
HADOKEN_NONINTERACTIVEDisable prompts (set to 1)
HADOKEN_YESAuto-accept prompts (set to 1)

Logs

Logs come from your app's stdout. Rails is configured with RAILS_LOG_TO_STDOUT=1 so everything goes to stdout by default.

$ hadoken logs # last 15 minutes, 200 lines $ hadoken logs -f # stream live $ hadoken logs --since 1h # last hour $ hadoken logs --tail 50 # last 50 lines

Duration formats: 15m, 1h, 30s, 2h30m. Also accepts RFC 3339 timestamps.

Console and run

Rails console

$ hadoken console

Opens an interactive Rails console on the running app. Requires kubectl in your PATH.

One-off commands

$ hadoken run -- rails db:migrate $ hadoken run -- rails db:seed $ hadoken run -- rails runner "puts User.count" $ hadoken run -i -- bash

Separate the command from flags with --. Use -i for interactive sessions.

Projects

A project is created the first time you deploy (or when you run hadoken init). The project name defaults to your directory name. If the name is taken, a random suffix is appended.

Your app is available at https://<project-name>.hadoken.app. TLS is automatic.

hadoken destroy tears down the project and all its resources. You must confirm by typing the project name.

Limits

Per-app resources

ResourceLimit
CPU500m
Memory512 MiB
Storage1 GiB persistent volume

Account limits

LimitValue
Projects per user10
Deploys per project per day100
Concurrent builds3

Timeouts

OperationTimeout
Deploy (CLI wait)20 minutes
Rollout120 seconds
Stale builds15 minutes (auto-failed)

Exit codes

For scripting and CI:

CodeMeaning
0Success
1Usage error (bad flags, not a Rails app)
2Auth error (not logged in, expired token)
3Server error (build failed, deploy failed)
4Config error (not initialized)
5Timeout
130Cancelled (Ctrl-C)
# CI example hadoken deploy --yes --timeout 10m if [ $? -eq 3 ]; then echo "Deploy failed"; fi

Config storage

Credentials are stored in ~/.hadoken/config.json. Project configs are in ~/.hadoken/projects/, keyed by a hash of your repo path so multiple projects don't collide. Both files are created with mode 0600.

# credentials ~/.hadoken/config.json {"api_base": "https://api.hadoken.dev", "token": "<jwt>"} # project config ~/.hadoken/projects/<hash>.json {"project_id": "<uuid>", "project_name": "myapp"}