Metadata-Version: 2.4
Name: reviso-cli
Version: 0.3.1
Summary: Command line client for Reviso: publish drafts for human review, read reviewer comments back, and publish revisions safely.
License: MIT License
        
        Copyright (c) 2026 Reviso
        
        This license applies to the contents of this repository: the Reviso command line
        client. It does not apply to the Reviso product, its service, or its server
        software, none of which are open source and none of which are licensed here.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://reviso.work
Project-URL: Documentation, https://github.com/reviso-si/reviso-agent
Project-URL: Repository, https://github.com/reviso-si/reviso-cli
Project-URL: Issues, https://github.com/reviso-si/reviso-cli/issues
Keywords: reviso,review,collaboration,documents,cli,agent
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: ruff<0.16,>=0.15.6; extra == "test"
Dynamic: license-file

# reviso-cli

Command line client for [Reviso](https://reviso.work), a content collaboration
system where agents publish Markdown and HTML drafts and a human team reviews
them.

This is the client half of Reviso. It talks to a Reviso server over HTTP and
contains no server code. It has **no runtime dependencies**: the transport is
`urllib`, so publishing a Markdown file does not pull a dependency graph into an
agent's environment.

## Install

```bash
pip install reviso-cli
# or run it without installing
uvx --from reviso-cli reviso --help
```

Installs the `reviso` command. No runtime dependencies: installing it will not
pull a dependency graph into an agent's environment.

## Quick start

```bash
reviso auth login --server https://reviso.work
# opens a browser for consent; use --no-browser to open the URL yourself
reviso doctor --json

reviso publish draft.md --title "Q3 launch plan" --json
# Save document_id as DOCUMENT_ID and share the returned review_url.

reviso packet "$DOCUMENT_ID" --format json
# Open the printed file. Save base_version_id as BASE_VERSION_ID in your shell
# and edit a copy of document_content in revised.md.

reviso update "$DOCUMENT_ID" revised.md \
  --description "Address reviewer feedback" \
  --base-version-id "$BASE_VERSION_ID"
```

## Browser login

When an agent is already connected, the CLI can still need its own login. Run
`reviso auth login --server https://reviso.work`, approve Reviso CLI in the
browser, then run `reviso workspaces --json`. For another server, use the exact
command printed by `reviso auth status`. To authorize the CLI to use an existing
DSH connection, run the printed `--from-dsh` command. The CLI then reads the
token and workspace for that server from DSH on each use, until you log out.
Keep the CLI running and open the login URL in a browser on the same computer.
`reviso auth status` shows the selected server and login state without credentials;
`reviso auth logout` removes that server's saved login. Revoke the connection in
Settings → Integrations to end its server access.

Credentials live in an owner-only file at `~/.config/reviso/credentials.json`
(or under `XDG_CONFIG_HOME`), separately for each server, and refresh automatically.
An existing `REVISO_AUTOMATION_KEY` or `--key` still supports headless use.
The credential lock currently supports macOS and Linux.

## The rule that matters

**`update` and `rollback` require `--base-version-id`.**

The base is the version you actually read. Without it, a write could silently
discard a human's concurrent edit, so the CLI fails before contacting the server.
Open the file printed by `packet`, save its `base_version_id`, and edit a copy
of its `document_content`. Keep them together through submission.

```bash
reviso packet "$DOCUMENT_ID" --format json
reviso update "$DOCUMENT_ID" revised.md --description "Address feedback" --base-version-id "$BASE_VERSION_ID"
# For a rollback, first review the current body and save its base_version_id.
reviso rollback "$DOCUMENT_ID" "$TARGET_VERSION_ID" \
  --description "Restore the reviewed draft" --base-version-id "$BASE_VERSION_ID"
```

If a write is rejected as a conflict, re-read and re-apply your change on top of
the human's edit. `--force-latest` is the explicit last-writer-wins opt-in: it
performs one fresh read and uses that version as the base. It cannot be combined
with `--base-version-id`.

## Command groups

| Group | Commands |
| --- | --- |
| Connection | `auth`, `doctor`, `health`, `ready`, `version` |
| Documents | `publish`, `open`, `status`, `documents`, `search`, `packet`, `document archive`, `document restore` |
| Presentations | `deck validate` |
| Revisions | `versions`, `diff`, `update`, `rollback` |
| Reviewers | `invite`, `guest`, `comment`, `reply`, `resolve` |
| Data | `export`, `import`, `workspaces` |

## Deliberately not in this client

These are boundaries, not gaps to be filled later:

- **No server commands.** Starting a Reviso server is not part of the client.
- **No share-link creation.** A share link carries a bearer token in its URL, and
  creating one is a browser action where the person handing it out can see who it
  is going to. Invites by email are here instead.
- **No owner or operator surfaces.** Metrics, debug replay, and internal replay
  endpoints are not exposed.

If you need MCP tools rather than a shell, the hosted connector is the better
path in most hosts. See [reviso-agent](https://github.com/reviso-si/reviso-agent)
for the agent skill.

## Provenance

Publishing from an agent runtime binds provenance automatically when the runtime
exposes `DSH_SESSION_ID`. You can pass an explicit pair instead:

```bash
reviso publish draft.md --source-kind dsh --source-session-id "$DSH_SESSION_ID"
```

`--source-kind` and `--source-session-id` must be supplied together. Use
`--no-source-binding` for an intentional no-source publish; it cannot be combined
with either provenance flag.

## License

MIT. See [LICENSE](LICENSE).

The Reviso product itself is **not** open source. This repository covers the
client only; it grants no rights to the service or its server software. See
[VISIBILITY.md](VISIBILITY.md) for the boundary this repository holds, and
[CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.

## HTML presentations

The CLI recognizes a `div` with the `hr-deck` class at the root. Check the original HTML and images against the target workspace's limits, then publish the same file.

```bash
reviso deck validate presentation.html --workspace-id "$REVISO_WORKSPACE_ID"
reviso publish presentation.html --workspace-id "$REVISO_WORKSPACE_ID"
```

Publish checks embedded images before creating the draft and uploads each distinct image once. To revise the same link, use the document ID and the version you reviewed. The CLI reuses matching images already in that document.

```bash
reviso deck validate presentation.html --document-id "$DOCUMENT_ID"
reviso update "$DOCUMENT_ID" presentation.html --description "Revise charts" --base-version-id "$BASE_VERSION_ID"
```

Use `--no-upload-images` on validate, publish, and update to keep original images inline. Standalone validation creates no document or assets. Add `--json` to see the measurements and per-slide diagnostics.

Ordinary HTML and Markdown publish as documents. You can also set the kind explicitly with `--kind html_deck` or `--kind document`.
