Metadata-Version: 2.4
Name: cal-docs-client
Version: 1.0.0b9
Summary: CLI client for cal-docs-server documentation API
Project-URL: Repository, https://gitlab.com/cyberassessmentlabs/public/tools/cal-docs-client
Project-URL: Documentation, https://cyberassessmentlabs.gitlab.io/public/docs/cal-docs-client/latest
Author: Cyber Assessment Labs
License-Expression: MIT
License-File: LICENSE
Keywords: api,cli,client,docs,documentation
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# cal-docs-client

CLI client for [cal-docs-server](https://gitlab.com/cyberassessmentlabs/public/tools/cal-docs-server) documentation API.

## Requirements

- Python 3.12+
- No external dependencies (stdlib only)

## Installation

```bash
pip install cal-docs-client
```

Or install from source:

```bash
git clone https://gitlab.com/cyberassessmentlabs/public/tools/cal-docs-client.git
cd cal-docs-client
pip install .
```

## Configuration

Configuration is optional. You can provide settings via command-line options, environment variables, or a config file.

### Config File (Optional)

For convenience, create a config file at `~/.config/cal-docs-client/config.json`:

```json
{
    "server": "https://docs.example.com",
    "token": "your-api-token",
    "no_colour": false
}
```

You can also specify a different config file with `-c`/`--config`.

### Configuration Priority

Settings are resolved in this order (first wins):
1. Command-line arguments (`-s`, `--no-colour`)
2. Environment variables (`CAL_DOCS_SERVER`, `CAL_DOCS_TOKEN`)
3. Config file

## Usage

```bash
# Show help
cal-docs-client --help

# Show server and client version
cal-docs-client version

# List all projects
cal-docs-client projects

# Search for projects
cal-docs-client projects --search myproject

# Download documentation
cal-docs-client download myproject latest
cal-docs-client download myproject 1.0.0 -o docs.zip

# Upload documentation (requires token in config or -t)
cal-docs-client upload myproject-1.0.0-docs.zip

# Delete a documentation version (requires token with delete permission)
cal-docs-client delete myproject 1.0.0

# Show server API help
cal-docs-client help

# Get OpenAPI specification
cal-docs-client spec -o openapi.json
```

### Command-Line Options

You can pass all settings directly on the command line:

```bash
cal-docs-client -s https://docs.example.com projects
cal-docs-client -s https://docs.example.com upload -t YOUR_TOKEN docs.zip
```

### Environment Variables

You can also use environment variables:

- `CAL_DOCS_SERVER` - Server URL
- `CAL_DOCS_TOKEN` - Authentication token

## API Version Compatibility

This client requires cal-docs-server API version 1.x. It will refuse to connect to servers with incompatible API versions.

## License

MIT License - (c) 2026 Cyber Assessment Labs
