> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ohmyho.st/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For account actions, read https://ohmyho.st/skills/ohmyhost-get-started/SKILL.md and use the authenticated ohmyho.st CLI or local product MCP. Mintlify search only reads documentation. Preserve the customer’s selected project, environment and authentication provider.

# CLI

> Install the public clients and deploy a GitHub commit with real commands.

## Install and sign in

Requires Node.js 22 or newer.

```sh theme={null}
npm install --global https://ohmyho.st/releases/0.1.28/ohmyhost-product-cli-0.1.28.tgz https://ohmyho.st/releases/0.1.28/ohmyhost-mcp-0.1.28.tgz
export OHMYHOST_ENVIRONMENT=production
ohmyhost login --json
ohmyhost whoami --json
```

The same release is on npm as `@amerged/ohmyhost-cli` and `@amerged/ohmyhost-mcp`. Both sources install the `ohmyhost` and `ohmyhost-mcp` commands, so keep one source per computer and upgrade from the one already installed (`npm ls --global` names it). To switch, first remove the other pair: `npm uninstall --global @ohmyhost/product-cli @ohmyhost/mcp` for the archives, `npm uninstall --global @amerged/ohmyhost-cli @amerged/ohmyhost-mcp` for npm.

[Release manifest and checksums](https://ohmyho.st/releases/0.1.28/manifest.json) · [Current release](https://ohmyho.st/client-release.json)

Run `ohmyhost login --json` and open the returned sign-in URL. The link already carries its confirmation code, so you do not type one. Sign in there, or create your account on that same page if you do not have one yet; signing up is open. Use the organizations returned by `whoami`; when several are available, select the one for this project. If none exists, create one through the get-started Skill.

## Authenticate

The CLI accepts two credentials and picks in this order:

1. `OHMYHOST_TOKEN` — a user API token. Set it and the CLI works immediately. No browser, no login.
2. A login saved by `ohmyhost login` — used only when `OHMYHOST_TOKEN` is unset. With several, choose `--profile-name NAME` or `OHMYHOST_PROFILE=NAME` ([saved accounts](/login-tokens#several-accounts-on-one-computer)).

`OHMYHOST_TOKEN` wins whenever set; no saved login is read. Naming another account or a checkout linked for another organization fails `environment_token_context_mismatch` before execution. If the value is not a valid `sk_…` token the command fails with `invalid_environment_token` and does not fall back.

These commands need the interactive login and refuse a token: `login`, `logout`, `organization create|list|use`, and `token create|list|revoke`. Run those in a process without `OHMYHOST_TOKEN`; preserve the existing private token file. Other commands use the token's current permissions and workspace role.

## Inspect and select a project

Run inside the repository:

```sh theme={null}
ohmyhost init --dry-run --json
ohmyhost project list --json
```

Resolve actual hosted blockers. Without a root `ohmyhost.yaml`, run `ohmyhost init --json` once blockers are resolved; `--root DIR` selects a nested app and `--region eu` prepares EU storage. Commit and push the file. Init never overwrites an existing configuration. Reuse an existing project, or create one after choosing isolated or shared data, protected or public Dev access, and setting `HOSTING_REGION` to the chosen `us` or `eu`:

```sh theme={null}
ohmyhost project create --organization "$ORGANIZATION_ID" --name "My app" --data-mode isolated --dev-access-mode protected --region "$HOSTING_REGION" --idempotency-key "$PROJECT_REQUEST_KEY" --json
ohmyhost operation get "$PROJECT_OPERATION_ID" --json
ohmyhost project list --json
```

`ORGANIZATION_ID` comes from `whoami`. Create a unique `PROJECT_REQUEST_KEY` once and retain it for retries. `PROJECT_OPERATION_ID` is the creation response's `operation.id`. After success, select the created project's ID from the list as `PROJECT_ID`.

## Connect and deploy

Read the workspace's GitHub connection first. If it is not connected, an Owner or Admin runs connect:

```sh theme={null}
ohmyhost github status --organization "$ORGANIZATION_ID" --json
ohmyhost github connect --organization "$ORGANIZATION_ID" --idempotency-key "$GITHUB_CONNECT_KEY" --json
```

Open its single `authorization.authorization_url`, then repeat the same connect request/key after browser confirmation until status is `connected`. This link handles installation/user authorization when needed. A failed or expired attempt needs the reported `last_failure` resolved and a new connect key for the same workspace.

Set `GITHUB_OWNER` and `GITHUB_REPOSITORY` to a repository covered by that installation. Retain one unique `SOURCE_REQUEST_KEY` for this source link:

```sh theme={null}
ohmyhost link --project "$PROJECT_ID" --repository-owner "$GITHUB_OWNER" --repository-name "$GITHUB_REPOSITORY" --idempotency-key "$SOURCE_REQUEST_KEY" --json
```

Observe the returned source-link operation; it needs no second browser authorization for a covered repository. Missing access is repaired through `github.connection.settings_url` returned by GitHub status, then the same link command/key. No build starts until you deploy a plan. From the repository root, link also records `.ohmyhost/` and adds `/.ohmyhost/` to `.gitignore`. Later commands may omit `--project`; the CLI names the selected project on stderr. A checkout keeps one link per organization: when several match, supply `--project` or `--profile-name` (`linked_project_selection_required`).

Use the full SHA of the pushed commit as `COMMIT_SHA`:

```sh theme={null}
ohmyhost plan --project "$PROJECT_ID" --commit "$COMMIT_SHA" --json
```

Read the plan, its requirements and credit effects. Set application [runtime secrets](/secrets) if required. Take `PLAN_ID` from `plan.id`, retain a new `DEPLOY_REQUEST_KEY`, and execute the approved plan:

```sh theme={null}
ohmyhost deploy --project "$PROJECT_ID" --plan-id "$PLAN_ID" --idempotency-key "$DEPLOY_REQUEST_KEY" --yes --wait --json
```

## Verify progress and the application

```sh theme={null}
ohmyhost operation get "$OPERATION_ID" --json
ohmyhost project status --project "$PROJECT_ID" --json
ohmyhost project dev-share link --project "$PROJECT_ID" --json
```

`OPERATION_ID` is the deploy response's `operation.id`. A wait timeout leaves the accepted operation running; inspect it without submitting another deployment. Follow returned polling guidance. If `dev_access_mode` is `protected`, the clean URL answers 404 without a session: open the reusable `share_url` first, then test the clean Dev URL. If it is `public`, open the clean Dev URL directly. Keep the share link out of logs and project notes. The Owner can change the mode with `ohmyhost project dev-access mode`, replace the link with `ohmyhost project dev-share rotate`, or revoke it with `ohmyhost project dev-share revoke`.

## Common follow-ups

```sh theme={null}
ohmyhost project context --project "$PROJECT_ID" --json
ohmyhost project handle check --handle quiet-otter-waves --json
ohmyhost project handle set --project "$PROJECT_ID" --handle quiet-otter-waves --if-match "$PROJECT_ETAG" --idempotency-key rename-1 --json
ohmyhost credits account --organization "$ORGANIZATION_ID" --json
ohmyhost budget get --project "$PROJECT_ID" --json
```

`PROJECT_ETAG` is `project.etag` from project status. Renaming breaks links to the old address; read [project addresses](/domains) first.

For later automation, create a token from Profile → API Tokens or the [token commands](/login-tokens). New tokens stay valid until revoked. [MCP setup](/agents/mcp) uses the same account access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.