Get started
CLI
Set up your app's backend from the terminal: sign in, deploy Postgres, Auth, Storage and more, and write the .env with one command.
One command
Run this in your app's folder. It opens your browser to sign in, lets you pick or create a project, deploys the services you choose, waits until they are ready and writes the connection settings into your env file. Secret values are never printed.
npx cloudhike initIt needs Node.js 20.16 or newer. Run it with npx each time, or install it once with npm install -g cloudhike.
Commands
| Command | What it does |
|---|---|
cloudhike init | Sign in, pick or create a project, deploy services, wait and write the env file. |
cloudhike login | Sign in in the browser. --token <key> saves an API key instead. |
cloudhike logout | Sign out and revoke the CLI's token. |
cloudhike whoami | The account and plan you are signed in with. |
cloudhike projects | List your projects. cloudhike projects create <name> makes one. |
cloudhike link [project] | Link this folder to a project, by id or name. |
cloudhike status | The project's services and their status. |
cloudhike add <service...> | Deploy services, wait for them and update the env file. |
cloudhike env pull | Write the project's variables into the env file. |
cloudhike env ls | List the variable names, without values. |
cloudhike open | Open the project in the dashboard. |
Services for add and init --services: postgres, auth, storage, redis, jobs, email, ai and computer. Auth needs Postgres, so the CLI adds Postgres when you ask for Auth alone.
| Option | Meaning |
|---|---|
--project <id or name> | Use this project instead of the folder's link. |
--environment <name> | An environment other than production, such as development. |
--services <list> | For init: the services to deploy, comma separated. |
--name <name> | For init: the project's name, created if it does not exist. |
--file <path> | The env file to write. |
--no-wait, --no-pull | Do not wait for services, or do not write the env file afterwards. |
--accept-email-policy | You have read and agree to the email policy. Email needs it. |
--json | Machine-readable output for scripts. |
The env file
- The CLI writes
.env.localwhen the app uses Next.js and.envotherwise.--filepicks another. - It merges into the file: variables CloudHike.dev sets are replaced, and your own lines and comments stay as they are.
- It adds the file to
.gitignoreif nothing ignores it yet, and prints only the variable names, never the values.
Linking a folder
init and link save the project in .cloudhike/project.json, so later commands know which project to use from this folder and its subfolders. It holds no secrets. The CLI git-ignores the folder so each developer links their own.
Signing in
cloudhike login opens https://cloudhike.dev/connect in your browser. Click Allow and the CLI gets its own token. It appears in the dashboard under Settings → API key → Connected apps, where you can disconnect it. cloudhike logout revokes it too.
The token is saved in ~/.config/cloudhike/auth.json (%APPDATA%\cloudhike on Windows), readable only by you.
Your CloudHike.dev account is billed for what the CLI deploys, the same as in the dashboard. The CLI cannot delete projects or services. Do that in the dashboard.
CI and scripts
Without a browser, use your workspace API key (dashboard → Connect MCP). CLOUDHIKE_API_KEY takes precedence over a saved sign-in, and CLOUDHIKE_PROJECT_ID picks the project.
export CLOUDHIKE_API_KEY=icu_your_api_key
npx cloudhike env pull --project <project id> --file .env.production| Exit code | Meaning |
|---|---|
0 | It worked. |
1 | Something failed, such as a deploy or a plan limit. |
2 | The command or its options are wrong. |
3 | Not signed in, or the key was revoked. |
Use with AI
Coding agents with a shell can use the CLI, so secret values never pass through the chat.
- 1
Open a terminal in your app's folder and start Claude Code.
claude - 2
Paste the prompt below and press Enter. Approve the file edits and commands it asks about.
- 3
Optional: save a short note about CloudHike.dev in CLAUDE.md so every session knows about it.
Set up CloudHike.dev as the backend for this app with the CloudHike CLI. Read the app first and decide which services it needs (postgres, auth, storage, redis, jobs, email, ai). Then run: npx cloudhike init --services <the services, comma separated> Do not open or print the env file it writes. Read the docs at https://cloudhike.dev/docs for each service and write the code that connects it. If email is needed, ask me to read https://cloudhike.dev/legal/email-policy first, and only add --accept-email-policy after I agree.
Replace the placeholders in <angle brackets> before sending. Always review what the agent changes.
