# daacini — DaaCini CLI

A thin command-line client for **[DaaCini](https://daacini.ijyalabs.in)** —
diagrams-as-code for architecture, network, cloud, and security. You write
diagram text; DaaCini returns clean SVG. **Source in, SVG out** — the rendering
engine runs on IjyaLabs servers and is never bundled here.

## Install

```sh
npm install -g @ijyalabs/daacini
```

## Use

```sh
# render a .daacini diagram to SVG
daacini render diagram.daacini              # → diagram.svg
daacini render diagram.daacini -o out.svg
cat diagram.daacini | daacini render        # → stdout

# check a diagram before rendering (CI-friendly: exit 1 on errors)
daacini lint diagram.daacini
daacini lint diagram.daacini --json          # machine-readable findings
cat diagram.daacini | daacini lint --strict  # also fail on warnings

# transpile an existing diagram (Mermaid / Graphviz DOT / PlantUML / D2)
daacini convert legacy.mmd                   # → legacy.daacini
daacini convert legacy.mmd --from mermaid
daacini convert legacy.dot --render -o out.svg   # convert then render in one call

# discover what you can draw
daacini kinds                                # every kind & mode (catalog)
daacini examples security:dfd                # a worked, ready-to-render example
daacini spec network                         # the machine capability spec for a surface
daacini audit topology.daacini               # network analysis: SPOF / segments / HA / oversub
daacini project daacini.project.json         # resolve local imports, write reviewable derived artifacts
daacini doctor                               # check the service is reachable + versions
```

A tiny example — `web.daacini`:

```
network
title: Web Service
Users -> Load Balancer
Load Balancer -> Web A
Load Balancer -> Web B
Web A -> DB @primary
Web B -> DB
```

```sh
daacini render web.daacini    # → web.svg
```

## Configuration

| | |
| --- | --- |
| `--endpoint <url>` / `DAACINI_ENDPOINT` | service URL (default `https://daacini.ijyalabs.in`) |

For controlled test environments, set `DAACINI_ENDPOINT` to an approved compatible service URL.

## Notes

- Requires Node 18+ (uses the built-in `fetch`).
- Personal & private use only; no commercial use or redistribution.
- Source retention is disabled by default by the hosted service. Do not put secrets in a diagram.

## Project manifests

For a repository with local, reusable source blocks, store a `daacini.project.json` with the diagrams and run `daacini project daacini.project.json`. The client resolves bounded local `@@` imports and produces SVG, lint, audit, SARIF, and SHA-256 input records in `.daacini-artifacts`; it does not copy source into that output. See [`docs/55-hosted-project-manifest.md`](../../docs/55-hosted-project-manifest.md).

Support / feedback: **daacini@ijyalabs.in** · Licensing: **legal@ijyalabs.in**
