# Strckro CLI reference

Use `skctl` to manage projects on your own Strckro Portal from a terminal, CI, or an AI agent.

- Web guide: https://dashboard-portal.cloud/docs/cli
- Markdown entry point: https://dashboard-portal.cloud/docs/cli/README.md
- Full Markdown reference: https://dashboard-portal.cloud/docs/cli/docs.md
- Last reviewed: 2026-11-09

## Install and discover

Requires Node.js 20.20.2 or newer and a Portal backend that supports the CLI API. Installing this package does not install or upgrade the Portal server.

```sh
npm install --global strckro
skctl --version
skctl --help
```

Run without a global installation:

```sh
npx --package strckro skctl --help
```

Update with `npm install --global strckro@latest`. Both `skctl` and `strckro` launch the same CLI. The npm installation works on Windows, macOS and Linux; a standalone Bash installer is not provided.

CLI 0.3.1 adds these shortcuts. Older installations can use the long options or update with npm install --global strckro@latest.

| Long form | Short form |
| --- | --- |
| `--help` | `-h` |
| `--version` | `-v` |
| `--server URL` | `-s URL` |
| `--project SLUG` | `-p SLUG` |
| `--json` | `-j` |

`skctl`, `skctl help` and `skctl --help` show help and the Markdown URL. `skctl version` prints only the version. `skctl docs` prints documentation URLs; `skctl docs --json` returns `{ "ok": true, "url": "...", "webUrl": "..." }`. These discovery commands do not need login, project configuration or network access.

## Connect to your Portal

Replace the example origin with the person's Portal. The documentation domain is not the default API server.

```sh
skctl login --server https://portal.example.com
skctl whoami --json
```

Browser login opens the Portal account page. The person signs in, checks the code against the terminal, and approves CLI access. An AI agent should let the person complete this approval. Over SSH or on a machine without a browser:

```sh
skctl login --server https://portal.example.com --no-browser
```

For CI, inject `STRCKRO_SERVER` and `STRCKRO_TOKEN` from your secret manager. Token login can also read stdin with `skctl login --server https://portal.example.com --token-stdin`. Create or revoke scoped CLI tokens under Settings > Account > CLI and AI access on the Portal.

Default browser login excludes `env.read`. Use `--scope` to request only the operations needed, and `--project SLUG` to restrict access to one existing project. Scopes include `project.view`, `project.create`, `project.configure`, `source.sync`, `deploy.start`, `deploy.rollback`, `domains.manage`, `env.read`, `env.write`, `logs.read` and `credentials.use`. A token cannot grant more access than its account currently has.

`skctl logout` removes the saved credential on this machine. Revoke the token on the Portal to invalidate other copies.

## Choose a project

```sh
skctl projects list
skctl project my-app --info
skctl init --project my-app
```

`projects list` shows one row per project: slug, service type, runtime, recorded deployment state and probed process state. `project SLUG --info` shows that project's source, release, deployment job and domains. `project SLUG` shows a single summary row. Add `--json` for the complete API data allowed by the token, without a table or explanatory text. The older `projects status [SLUG]` command remains supported.

`init` creates `strckro.json` in the working directory with only server and project, never a token. It does not overwrite an existing file. Project selection order is `--project`, positional slug, `STRCKRO_PROJECT`, then `strckro.json`.

Server selection order is `--server`, `STRCKRO_SERVER`, `strckro.json`, then the saved login. A supplied token is sent only when the destination comes from `--server`, `STRCKRO_SERVER`, or the already trusted saved login origin. A repository's `strckro.json` alone cannot redirect a supplied token. Set both server and token in CI.

HTTPS is required except for explicit loopback HTTP during development. Use a bare origin without path, query or credentials. Legacy `DASHBOARD_*` variables and `dpctl.json` remain supported, with `STRCKRO_*` taking priority.

## Commands

Brackets indicate optional arguments; do not type the brackets. Omit a slug when the project context is already configured.

| Command | Purpose |
| --- | --- |
| `whoami` | Account, organizations and access |
| `projects list` | Compact project overview |
| `project [SLUG] [--info]` | One project, with optional detail |
| `projects status [SLUG]` | Existing project status command |
| `projects sync --file project.json` | Create/update configuration and sync Git |
| `deployments list [SLUG]` | Deployment history and active jobs |
| `deploy [SLUG] [--sync] [--wait]` | Deploy synced Git source |
| `restart [SLUG]` | Request an application restart |
| `rollback [SLUG] --release ID` | Activate a retained release |
| `jobs status ID` | Inspect a deployment job |
| `logs [SLUG]` | Read runtime logs |
| `domains list [SLUG]` | Configured domains |
| `domains set [SLUG] --domains a.com,b.com [--sync]` | Replace all configured domains |
| `domains clear [SLUG] [--sync]` | Remove all configured domains |
| `domains check [SLUG] --hostname a.com` | Inspect DNS for a hostname |
| `domains verify [SLUG]` | Verify DNS and apply the host TLS workflow |
| `env keys [SLUG]` | Key names and revision, without values |
| `env set KEY [SLUG] --stdin` | Read one value from stdin |
| `env set KEY [SLUG] --file PATH` | Read one value from a file |
| `env set KEY [SLUG] --empty` | Set an empty value |
| `env unset KEY [SLUG]` | Remove one key |
| `env import [SLUG] --file .env` | Merge dotenv keys atomically |
| `env pull [SLUG] --file PATH` | Export values to a new file; needs env.read |

## Create or update a project

Get an organization ID from `skctl whoami --json`, then create a JSON file such as:

```json
{
  "name": "My app",
  "slug": "my-app",
  "organizationId": "ORGANIZATION_ID",
  "repository": "https://github.com/your-org/your-app.git",
  "branch": "main",
  "directory": "/",
  "runtime": "node",
  "nodeMajor": 24,
  "buildScript": "build",
  "startScript": "start"
}
```

```sh
skctl projects sync --file project.json --json
```

An existing slug updates that project's configuration. Review the file before applying it. Private repositories use a `credentialId` already configured on the Portal. The backend's existing runtime validation, permissions and host prerequisites still apply.

## Deploy and inspect

```sh
skctl deploy my-app --sync --wait --timeout 300 --json
skctl deployments list my-app --json
skctl project my-app --info --json
skctl logs my-app --json
```

Deployment uses the repository configured on the Portal, rather than uploading the terminal's working directory. `--sync` fetches source first and reuses an automatically queued deployment when applicable. Without `--wait`, an accepted job may still be queued or running. Inspect it with `jobs status ID`.

Recorded deployment state `active` is separate from process health. Process `unknown` means that the runtime probe did not establish a state. A successful CLI request alone does not prove application health. Demo mode does not activate real host systemd, Nginx or TLS.

Restart support in CLI 0.3.2 matches the Portal 1.1.0 API. It restarts the active native application with its deployed environment, without creating another release or deployment job. A project with no active release or an unsupported runtime is rejected by the backend. The command needs `deploy.start`; it does not require an additional project-list request.

## Environment and domains

```sh
skctl env keys my-app --json
skctl env import my-app --file .env.production --json
skctl domains set my-app --domains app.example.com
skctl domains check my-app --hostname app.example.com
skctl domains verify my-app
```

Environment set/import changes only supplied keys and preserves other keys and comments. Values are literal single-line strings; dotenv does not expand shell expressions. `--stdin` and `--file` remove one final newline. Environment documents are limited to 128 KB. Changes take effect on a subsequent deployment.

Writes fetch the current revision unless `--revision REV` is supplied. A concurrent change exits with code 5 and is not automatically retried. Fetch fresh metadata and review the intended change before retrying.

`env keys` needs `env.read` or `env.write`; mutations need `env.write`; `env pull` needs `env.read` and creates a new output file. Keep exported values out of logs and source control.

Domain set replaces the whole list and clear removes it. Point DNS at the host before verification. The CLI does not create records at your DNS provider. Actual Nginx and TLS activation needs a configured host backend.

## AI and CI output contract

Use `--json` for API operations. Successful stdout is one JSON object with `ok: true`, except a backend's explicit `ok: false` is preserved and exits 1. Errors use:

```json
{"ok":false,"error":{"code":"INVALID_INPUT","message":"..."}}
```

An HTTP status may also appear in `error.status`. Login instructions and progress go to stderr. Human help and version output remain text even when `--json` is supplied. Do not parse tables for automation.

Before mutating a project, inspect its slug and source and follow the person's requested scope. Let the person complete browser authentication. Never request tokens in chat, print secret values, invent organization IDs, or retry a conflicting write without reviewing it.

| Exit code | Meaning |
| --- | --- |
| 0 | Success |
| 1 | API or deployment failure |
| 2 | Invalid input, option or configuration |
| 3 | Authentication required or invalid token |
| 4 | Permission denied |
| 5 | Stale environment revision |
| 6 | Network error or timeout |

`--timeout SECONDS` accepts 1–3600, defaults to 30, and also bounds deployment waiting. Windows credentials use user-bound DPAPI; Linux/macOS use restricted configuration files. Set `STRCKRO_CONFIG_DIR` to override the configuration location. Saved credentials are never forwarded to a different origin.

## Troubleshooting

- Command not found: check Node/npm and the npm global executable directory in PATH, or use the npx command above.
- An older CLI rejects `-v`, `-h` or `docs`: update to 0.3.1 or newer, or use long options and the documentation URLs at the top.
- Login returns 404: check the Portal URL and whether its backend supports the CLI API.
- Exit 3 or 4: review token expiry/scopes and current organization permissions.
- Deployment is still running: inspect the returned job ID; avoid submitting another deployment just to poll it.
- Environment conflict: fetch current metadata, review the change, and submit against the new revision.
