# Clone CLI

Native npm launcher for the Clone CLI.

Status: early alpha. This package is proprietary to Clone Labs, Inc. and
licensed for Clone Labs, Inc. internal/company use only. Public registry
visibility does not grant public usage, modification, redistribution, or
commercial rights.

## Install

```sh
npm install -g @cloneisyou/cli
clone
```

## Distribution Model

This package follows the native-launcher pattern used by tools such as Claude
Code: the public npm package contains only a small JavaScript launcher and
installer. It does not bundle Clone Labs, Inc.'s proprietary Python source.

At runtime, the launcher resolves the native `clone` executable in this order:

1. `CLONE_NATIVE_BINARY`, for internal development or manual installs.
2. A matching npm optional dependency alias, such as
   `@cloneisyou/cli-win32-x64`, which points to
   `@cloneisyou/cli@<version>-win32-x64`.
3. A private artifact mirror, but only when `CLONE_DOWNLOAD_BASE_URL` is set
   explicitly.

Clone Labs, Inc.'s GitHub repository and GitHub Releases are private. Public
npm installs do not depend on GitHub Releases or GitHub Actions artifacts. The
release workflow builds each native binary on its matching runner and publishes
that platform package directly to npm before publishing the main launcher.

The package metadata links to the private Clone Labs, Inc. repository and issue
tracker. Access requires repository permissions.

Expected private artifact names when `CLONE_DOWNLOAD_BASE_URL` is used:

- `clone-darwin-arm64`
- `clone-darwin-x64`
- `clone-linux-x64`
- `clone-win32-x64.exe`

If a `manifest.json` is present at the release URL, the installer will use
`platforms.<platform>.url` and verify `sha256` or `checksum` when provided.

## Requirements

- Node.js 18+
- A supported platform: macOS arm64/x64, Linux x64, or Windows x64.

Python is not required by this npm package once native binaries are published.

## Local Data And Keys

Clone stores local state under `~/.clone` by default. This includes session
metadata, local memory/soul files, and optional context screenshots.

If you run `clone login`, provider API keys are stored locally in:

```text
~/.clone/secrets.json
```

Environment variables such as `ANTHROPIC_API_KEY` and `OPENAI_API_KEY` take
precedence over locally stored keys.

## Configuration

Useful environment variables:

- `CLONE_NATIVE_BINARY`: explicit path to a native `clone` executable.
- `CLONE_DOWNLOAD_BASE_URL`: explicit private artifact base URL for internal testing.
- `CLONE_NPM_RUNTIME`: override the native binary cache directory.
- `CLONE_HOME`: override Clone's data directory. Defaults to `~/.clone`.
- `CLONE_DISABLE_TRAY=1`: disable the desktop tray/menu-bar recording indicator.
- `CLONE_DISABLE_CONTEXT_WORKER=1`: disable background context screenshots.
- `CLONE_SKIP_UPDATE_CHECK=1`: skip the npm `latest` version check before launching.
- `CLONE_SKIP_NATIVE_INSTALL=1`: skip download attempts during install.

Development smoke test:

```sh
npm --prefix apps/cli/npm run smoke
```
