Metadata-Version: 2.4
Name: harbor-check-cli
Version: 0.1.6
Summary: CLI for Harbor Check review status and rubric summaries
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: Console
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13.7

# Harbor Check CLI

Install with `python -m pip install ./saas/harbor-check-cli`.

Login once; the token is stored with mode 0600 and reused by later commands:

```bash
harbor-check login --server 101.46.8.169 --username alice --password 'secret'
harbor-check tasks
```

An address without a scheme is treated as `http://`; use `--server
http://101.46.8.169:8000` when Harbor Check is listening on a non-default port.

```bash
harbor-check --server https://review.example.com tasks
harbor-check --server https://review.example.com folders
harbor-check --server https://review.example.com folder-tasks batch-name
```

The CLI authenticates with the server's `/api/auth/login` endpoint. Configure
Django with `HARBOR_CHECK_AUTH_REQUIRED=1` and `HARBOR_CHECK_USERS_JSON`.
Values may be plaintext for local development or `pbkdf2_sha256$rounds$salt$hex`
hashes for deployment. Authenticated users can see all users' tasks and folders.
Use `--json` for machine-readable output.

For cloud hosts whose users are real SSH/system accounts, set
`HARBOR_CHECK_OS_AUTH=1` on the server. The login endpoint then verifies the
same username/password against the server's SSH daemon (optionally using
`HARBOR_CHECK_SSH_HOST`). This lets a laptop authenticate without copying the
password into the application database.

Plain HTTP exposes the login password and review data to anyone able to observe
the network path. For public access, put Django behind HTTPS, or use an SSH
tunnel from the laptop:

```bash
ssh -N -L 8000:127.0.0.1:8000 alice@101.46.8.169
harbor-check login --server http://127.0.0.1:8000 --username alice
```


## Install and use from `101.46.8.169`

On a laptop with network access to the server:

```bash
python -m pip install --upgrade harbor-check-cli
harbor-check login --server http://101.46.8.169:8000 --username YOUR_SERVER_USERNAME
harbor-check tasks
harbor-check folders
harbor-check folder-tasks YOUR_FOLDER_NAME
```

The token is stored in `~/.config/harbor-check/credentials.json` with 0600
permissions. Use `--json` for scripts. If the server is exposed only through
SSH, create a tunnel first:

```bash
ssh -N -L 8000:127.0.0.1:8000 YOUR_SERVER_USERNAME@101.46.8.169
harbor-check login --server http://127.0.0.1:8000 --username YOUR_SERVER_USERNAME
```

The server must enable `HARBOR_CHECK_AUTH_REQUIRED=1` and configure either
`HARBOR_CHECK_USERS_JSON` or `HARBOR_CHECK_OS_AUTH=1`.
