Metadata-Version: 2.4
Name: dmint-cli
Version: 1.1.0
Summary: CLI tooling for Dmint policy creation, compilation, and management
Author: Dmint Authors
License-Expression: Apache-2.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dmint<2.0.0,>=1.0.0
Requires-Dist: mcp<3.0.0,>=2.2.0
Requires-Dist: dmint-dashboard<2.0.0,>=1.0.0
Requires-Dist: questionary>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"
Requires-Dist: dmint-mcp<2.0.0,>=1.0.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=8.0.0; extra == "test"
Requires-Dist: pytest-cov>=5.0.0; extra == "test"
Requires-Dist: dmint-mcp<2.0.0,>=1.0.0; extra == "test"
Dynamic: license-file

# dmint-cli (v1.1.0)

[![CI](https://github.com/dmint-app/dmint-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/dmint-app/dmint-cli/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/dmint-cli.svg)](https://pypi.org/project/dmint-cli/)
[![Python 3.10+](https://img.shields.io/pypi/pyversions/dmint-cli.svg)](https://pypi.org/project/dmint-cli/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)

Command-line tooling for Dmint policy authoring, offline validation, and dashboard management.

`dmint-cli` compiles natural language security requirements (`access.md`) into validated Dmint policies (`policy.json`) and runtime protection configurations (`mcp_protection.json`) for downstream MCP tools and local Python functions.

---

## Installation

```bash
pip install dmint-cli
```

Verify the installation:

```bash
dmint --version
# dmint 1.1.0
```

---

## Quickstart

### 1. Define Access Requirements (`access.md`)

```markdown
# Database Access Rules
- The agent may execute SELECT queries on any table.
- UPDATE and INSERT operations require explicit human approval.
- DROP and DELETE operations are denied.
```

### 2. Generate and Verify Policy

```bash
# Author policy from requirements using an LLM provider:
dmint create-policy -f access.md -o policy.json -y

# Verify policy offline (zero network, zero LLM):
dmint verify-policy policy.json
```

Output:
```text
✓ Verified policy.json: 3 rule(s)
  [ALLOW] tool='database', action='select', resource='*'
  [APPROVAL_REQUIRED] tool='database', action='update', resource='*'
  [DENY] tool='database', action='drop', resource='*'
```

### 3. Launch the Approval Dashboard

```bash
dmint dashboard --db-path ./approvals.sqlite3 --port 8080
```

---

## Command Reference

| Command | Purpose |
|---|---|
| `dmint create-policy` | Interactive wizard for authoring policies from local AST discovery or requirements. |
| `dmint create-mcp-policy` | Discovers live MCP server tools and outputs `policy.json` and `mcp_protection.json`. |
| `dmint verify-policy` | 100% offline schema and semantic validator for `policy.json` (exits 0 on valid). |
| `dmint install-skill` | Installs the official `dmint-policy-manager` AI agent skill for Cursor, Claude Code, or Antigravity. |
| `dmint dashboard` | Starts the local human approval web dashboard connected to Core SQLite. |

---

## Documentation

Full documentation for all CLI commands, flags, and MCP workflows is available at [docs.dmint.app/reference/cli](https://docs.dmint.app/reference/cli).

---

## Dmint Ecosystem

- [`dmint`](https://github.com/dmint-app/dmint): Core deterministic authorization engine & SQLite store.
- [`dmint-cli`](https://github.com/dmint-app/dmint-cli): Developer CLI for authoring, verifying, and running dashboards.
- [`dmint-mcp`](https://github.com/dmint-app/dmint-mcp): Out-of-process gateway for Model Context Protocol servers.
- [`dmint-dashboard`](https://github.com/dmint-app/dmint-dashboard): Local human approval web UI.
- [`dmint-skills`](https://github.com/dmint-app/dmint-skills): Agent skills for policy authoring assistants.
- [`dmint-examples`](https://github.com/dmint-app/dmint-examples): Reference integrations and attack mitigation testbeds.

---

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and pull request guidelines.

---

## License

Licensed under the [Apache License, Version 2.0](LICENSE).
