Content
<div align="center">
<h1>Cube</h1>
<p>Netwrix Identity Manager (Usercube) CLI & MCP Server</p>
</div>
---
Cube provides two tools for managing your [Netwrix Identity Manager](https://netwrix.com/en/products/identity-manager/) (formerly [Usercube](https://www.usercube.com)) Identity Governance platform:
- **`cube`**: a resource-first command-line interface for authentication and API operations
- **`cube-mcp`**: a Model Context Protocol (MCP) server for AI-assisted workflows
## Quick Start
### Installation
**Option 1: Install from source**
```bash
cargo install --path crates/cube-cli
cargo install --path crates/cube-mcp
```
**Option 2: Build from source**
```bash
cargo build --release
# Binaries:
# target/release/cube
# target/release/cube-mcp
```
### Initial Configuration
```bash
# Initialize config with your Usercube server URL
cube config init --base-url https://example.usercube.com
# For agent login (service accounts, CI/CD)
cube config set openid.client my-agent-client
cube config set openid.secret my-client-secret
# For SaaS login (OAuth2)
cube config set oauth2.client_id my-oauth2-client
cube config set oauth2.token_endpoint https://auth.usercube.com/token
```
### Authentication
```bash
# Agent login (OpenID client credentials)
cube login agent
# On-premise login (username/password)
cube login account -u admin -p secret
# SaaS login (OAuth2 ROPC)
cube login saas -e user@example.com -p password
# Clear credentials
cube login logout
```
### API Operations
The CLI uses a resource-first pattern. The resource name *is* the command. No need to specify the API group, it is resolved automatically.
```bash
# Discover available resources
cube resources
cube resources Metadata
# List all entity types
cube entitytype
# Get a single entity type by ID
cube entitytype get 1337
# Create a new entity type
cube entitytype create -d '{"identifier":"Directory_Test", "displayName_L1":"Test"}'
# Update
cube entitytype update 1337 -d '{"displayName_L1": "New Name"}'
# Delete
cube entitytype delete 1337
# List with filtering and pagination
cube entitytype list --query "Identifier='Directory_HR'"
# Compact JSON output (for piping)
cube --output compact entitytype list | jq '.[].Name'
# Read JSON body from stdin
cat payload.json | cube entitytype create -d -
```
### MCP Server (experimental)
Configure in your MCP client:
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
```json
{
"mcpServers": {
"usercube": {
"command": "/path/to/cube-mcp"
}
}
}
```
## Documentation
<div align="center">
<p>Coming soon...</p>
</div>
## Configuration
| File | Format | Description |
|------|--------|-------------|
| `~/.cube/config.toml` | TOML | Server URL, API version, OpenID/OAuth2 settings |
| `~/.cube/credentials.json` | JSON | Auth method and token (mode `0600` on Unix) |
Both binaries share the same configuration and credentials.
## License
See [LICENSE](LICENSE) for details.