Skip to content

docs(cli): document the harper deploy command - #624

Open
Ethan-Arrowood wants to merge 1 commit into
mainfrom
docs/cli-deploy-command
Open

docs(cli): document the harper deploy command#624
Ethan-Arrowood wants to merge 1 commit into
mainfrom
docs/cli-deploy-command

Conversation

@Ethan-Arrowood

Copy link
Copy Markdown
Member

Summary

Documents the harper deploy CLI command in the CLI reference. This command was undocumented on the commands page despite being available since v4.4.18 (with live streaming progress added in v5.1.0).

Sourced from the Harper core code (bin/cliOperations.ts, bin/help.ts, components/operations.js, components/operationsValidation.js).

Changes

  • reference/cli/commands.md — new ### harper deploy entry under Process Management, covering:
    • Directory deploy (packages the current working directory) vs. package-reference deploy (package=<ref>)
    • Local vs. remote (target=<url>) deploys and how remote auth is resolved
    • Live SSE progress (upload bar + streamed install output; prepare → load → replicate → restart) added in v5.1.0, with the automatic fallback for pre-5.1 servers
    • The deployment_id / system.hdb_deployment record
    • Every supported parameter: project, package, target, restart (true/rolling), replicated, install_command, install_timeout, install_allow_scripts, deployment_timeout, ignore_replication_errors, force, urlPath, host, credentials, json, plus the directory-packaging options skip_node_modules and skip_symlinks
    • Cross-links to the deploy_component operation for full server-side behavior
  • reference/cli/overview.md — added harper deploy to the command table (Prettier realigned the table, hence the extra line churn)

Verification

  • npm run format:check — clean
  • npm run build — succeeds; the two broken-anchor warnings are pre-existing (on backups/overview and release-notes/5.1) and unrelated to this change

sent with Claude Opus 4.8

Add a full reference entry for `harper deploy` on the CLI commands page,
covering both directory (current-working-directory) and package-reference
deploys, local vs. remote (`target=`) usage, live SSE progress introduced in
v5.1.0, and every supported parameter (restart/replicated, install options,
deployment/replication controls, urlPath/host, credentials, and the
directory-packaging options skip_node_modules/skip_symlinks). Cross-link the
`deploy_component` operation for full server-side behavior.

Also add `harper deploy` to the command table in the CLI overview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-624

This preview will update automatically when you push new commits.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request documents the 'harper deploy' CLI command. It adds a detailed section to 'reference/cli/commands.md' explaining how to package and deploy Harper components, along with parameters and packaging options. It also updates the command table in 'reference/cli/overview.md' to include 'harper deploy'. There are no review comments, so I have no feedback to provide.

Comment thread reference/cli/commands.md
harper deploy target=https://server.com:9925 restart=true
```

Remote deploys authenticate the same way as any other remote CLI operation (stored login token, `auth_username`/`auth_password`, or environment variables). See [Remote Operations](./overview.md#remote-operations).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High: wrong parameter names for remote auth

This says remote deploys can authenticate with auth_username/auth_password, but that's not a real parameter name. Both the CLI source (bin/cliOperations.ts, which reads req.username/req.password) and this repo's own Remote Operations section document the parameters as username=<user> password=<pass> (no auth_ prefix). A reader following this line would pass a parameter the CLI silently ignores.

Suggested fix:

Suggested change
Remote deploys authenticate the same way as any other remote CLI operation (stored login token, `auth_username`/`auth_password`, or environment variables). See [Remote Operations](./overview.md#remote-operations).
Remote deploys authenticate the same way as any other remote CLI operation (stored login token, `username`/`password`, or environment variables). See [Remote Operations](./overview.md#remote-operations).


Generated by Barber AI

Comment thread reference/cli/commands.md
- `ignore_replication_errors=true` - Treat a peer that fails to receive the deploy as non-fatal instead of failing the whole operation.
- `force=true` - Allow deploying over a protected core component name.
- `urlPath=<path>` - HTTP path the component is mounted at (e.g. `/api/v2`). Requires `package`.
- `host=<hostname>` - Virtual hostname the component is served on (e.g. `api.example.com`). Requires `package`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High: host parameter is not implemented for deploy

deployComponent in components/operations.js never reads req.host, and deployComponentValidator in components/operationsValidation.js doesn't include it either. The applicationConfig object written via configUtils.addConfig() is built explicitly as { package, install?, urlPath? } — there is no path that writes a host/virtual-hostname value. Passing host=<hostname> to harper deploy is a silent no-op, not a way to set the component's virtual hostname.

Suggested fix: remove this parameter (or confirm with the Harper team whether it's planned/unshipped, and mark it as such rather than documenting it as supported).


Generated by Barber AI

Comment thread reference/cli/commands.md
- `force=true` - Allow deploying over a protected core component name.
- `urlPath=<path>` - HTTP path the component is mounted at (e.g. `/api/v2`). Requires `package`.
- `host=<hostname>` - Virtual hostname the component is served on (e.g. `api.example.com`). Requires `package`.
- `credentials=<json>` - Authentication for installing from a private npm registry or git repository. See [`deploy_component` credentials](../operations-api/operations.md#deploy-credentials-credentials).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High: credentials parameter doesn't exist, and the anchor is broken

Two issues on this line:

  1. credentials is not a real deploy_component parameter — it's absent from deployComponentValidator, from deployComponent()'s handling of req, and from Application.ts's install logic. I couldn't find it referenced anywhere in harper or harper-pro in connection with deploy/install/npm/registry auth.
  2. The link target ../operations-api/operations.md#deploy-credentials-credentials doesn't resolve — reference/operations-api/operations.md has no heading that produces that anchor (its deploy_component section has no credentials subsection at all).

Suggested fix: remove this parameter/line, or replace it with the real mechanism for private-registry auth during deploy (e.g. add_ssh_key for private git deploys, documented at ../operations-api/operations.md#add_ssh_key), if that's what was intended.


Generated by Barber AI

@kriszyp kriszyp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but some timeline cleanup to address.
🤖 Reviewed with Codex

Comment thread reference/cli/commands.md
- `install_command=<command>` - Override the install command run for the component.
- `install_timeout=<ms>` - Maximum time, in milliseconds, to allow the install to run.
- `install_allow_scripts=true` - Allow npm pre/post-install scripts to run (disabled by default).
- `deployment_timeout=<ms>` - How long, in milliseconds, a peer waits to receive the replicated payload before failing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current deploy_component contract at reference/operations-api/operations.md:592-603 does not include deployment_timeout or ignore_replication_errors. Repository history shows these controls originated in unfinished two-phase deployment work, so users of the released API may have these values rejected or silently fail to get the promised behavior. Unless the corresponding core implementation has landed for a documented release, please remove both bullets; otherwise add them to the canonical operation reference with the appropriate version annotation first.

— KrAIs (GPT-5.4)

Comment thread reference/cli/commands.md
- `force=true` - Allow deploying over a protected core component name.
- `urlPath=<path>` - HTTP path the component is mounted at (e.g. `/api/v2`). Requires `package`.
- `host=<hostname>` - Virtual hostname the component is served on (e.g. `api.example.com`). Requires `package`.
- `credentials=<json>` - Authentication for installing from a private npm registry or git repository. See [`deploy_component` credentials](../operations-api/operations.md#deploy-credentials-credentials).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

credentials is an array of nested credential objects, while the existing CLI contract explicitly says objects and arrays of objects are unsupported (reference/cli/operations-api-commands.md:301-306 and reference/cli/operations-api-commands.md:370-379). Advertising credentials=<json> therefore gives private-package users a command that cannot represent the required request shape. Please direct them to the HTTP Operations API instead, or, if the CLI has gained nested-JSON support, update the general CLI contract and provide a correctly shell-quoted array example here. This surface also needs its v5.2 availability called out if retained.

— KrAIs (GPT-5.4)

Comment thread reference/cli/commands.md

### `harper deploy`

<VersionBadge version="v4.4.18" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing command inventory dates both deploy_component and its deploy alias to v4.3.0 (reference/cli/operations-api-commands.md:79-83), while the 4.4.18 release note only says package deployment was added/fixed. Please use v4.3.0 for the command's introduction and annotate package-reference support separately as v4.4.18, or reconcile the older inventory if its date is incorrect.

— KrAIs (GPT-5.4)

Comment thread reference/cli/commands.md
- `ignore_replication_errors=true` - Treat a peer that fails to receive the deploy as non-fatal instead of failing the whole operation.
- `force=true` - Allow deploying over a protected core component name.
- `urlPath=<path>` - HTTP path the component is mounted at (e.g. `/api/v2`). Requires `package`.
- `host=<hostname>` - Virtual hostname the component is served on (e.g. `api.example.com`). Requires `package`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

host was added in v5.2.0, but this parameter list sits under a v4.4.18 command badge. Without an inline availability marker, users on v4 or v5.1 can reasonably expect this option to work. Please add (Added in: v5.2.0) here, matching the repository's inline-option convention and the canonical operation reference.

— KrAIs (GPT-5.4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants