cotis-cli 0.1.0-alpha

Plugin host for Cotis build, check, and run routines
Documentation
# cotis-cli


`cotis-cli` is a **plugin host** for Cotis build/check/run routines. Routines are Rust dynamic libraries (`.dll/.so/.dylib`) that export a small C ABI, and are installed into a cache directory and then executed by the host.

> **Status:** Early `0.1.0-alpha` release. APIs and the plugin ABI are still evolving.

## Installation


Install from crates.io once published:

```bash
cargo install cotis-cli --version 0.1.0-alpha
```

Or install from the repository:

```bash
cargo install --git https://github.com/igna-778/cotis-cli
```

## Commands


- **Install a routine**:
  - Local Rust project (builds the `cdylib`): `cotis-cli install path:<path-to-cargo-project>`
  - crates.io (downloads source, builds): `cotis-cli install crate:<name>@<version>`
  - GitHub Releases (downloads a prebuilt library asset): `cotis-cli install gh:<owner>/<repo>@<tagOrLatest>`
  - Add `-fo` / `--overwrite` to overwrite an existing install.
  - Optional alias: `cotis-cli install path:<path> <alias>`

- **Run a routine**:
  - `cotis-cli run <routine> -- <args>`
  - `cotis-cli run <routine>@<version> -- <args>`

- **List routines**:
  - `cotis-cli list`

- **Show routine info / help**:
  - `cotis-cli info <routine[@version]>`
  - `cotis-cli help-routine <routine[@version]>`

- **Remove a routine**:
  - `cotis-cli remove <routine>`

## Install layout


Routines are stored under `ProjectDirs::cache_dir()`:

`cache/routines/<routine_name>/<version>/<target_triple>/plugin/<library>`

Where `<library>` is one of:
- Windows: `<routine_name>.dll`
- Linux: `lib<routine_name>.so`
- macOS: `lib<routine_name>.dylib`

## Routine plugin ABI


A routine dynamic library must export:

- `cotis_plugin_api_version() -> u32` (must be `1`)
- `cotis_plugin_descriptor_json() -> *mut c_char` (JSON like `{\"name\":\"...\",\"version\":\"...\"}`)
- `cotis_plugin_help() -> *mut c_char`
- `cotis_plugin_run(argc: i32, argv: *const *const c_char) -> i32` (`0` success, non-zero failure)
- `cotis_plugin_free_string(ptr: *mut c_char)` (host calls this to free strings returned by the plugin)

## Examples


Install from local project:

```bash
cotis-cli install path:C:\path\to\cotis-android-builder
```

Install from crates.io:

```bash
cotis-cli install crate:cotis-some-routine@0.2.0
```

Install from GitHub release assets:

```bash
cotis-cli install gh:my-org/cotis-some-routine@latest
```

Run a routine with passthrough args:

```bash
cotis-cli run cotis_web_builder -- --output .\dist\web
```

## Ecosystem


Cotis is split across several repositories. This repo hosts installable build and run routines; sibling repos provide the core framework and routine implementations.

| Repository | Role |
|------------|------|
| [**cotis**]https://github.com/igna-778/cotis | Core traits and `CotisApp` orchestration |
| [**cotis-cli**]https://github.com/igna-778/cotis-cli (this repo) | Plugin host for installable build and run routines |
| [`cotis-web`]https://github.com/igna-778/cotis-web | Web build routine (`cotis-web-builder`) |
| [`cotis-android`]https://github.com/igna-778/cotis-android | Android build routine (`cotis-android-builder`) |
| [`cotis-layout`]https://github.com/igna-778/cotis-layout | Flexbox-style layout engine |
| [`cotis-pipes`]https://github.com/igna-778/cotis-pipes | Layout output to render commands |
| [`cotis-wgpu`]https://github.com/igna-778/cotis-wgpu | Desktop renderer (wgpu + winit + glyphon) |
| [`cotis-raylib`]https://github.com/igna-778/cotis-raylib | Desktop renderer (raylib) |

## Documentation


- API reference: `cargo doc --open`
- Published docs: [cotis-cli]https://docs.rs/cotis-cli
- Contributing: [CONTRIBUTING.md]CONTRIBUTING.md
- Security: [SECURITY.md]SECURITY.md
- License: [MIT]LICENSE