Skip to main content

Quickstart

This guide walks you through installing Cube, configuring access to your NIM instance, authenticating, and performing common resource operations.

Prerequisites

Before you begin, ensure you have:

  • A working installation of Rust and Cargo
  • Access to a NIM instance
  • Valid authentication credentials (user account or OpenID client)

For Rust installation instructions, see the official Rust website: https://rust-lang.org/tools/install Pre-build binaries are coming soon.


Installation

Install the Cube CLI and MCP server directly from the Git repository using Cargo:

cargo install --git https://github.com/Fastiraz/cube.git cube-cli
cargo install --git https://github.com/Fastiraz/cube.git cube-mcp

Verify the installation:

cube --version

Initial Configuration

Cube requires the URL of your NIM instance before it can communicate with the API.

Initialize your configuration:

cube config init --base-url https://example.usercube.com

You can verify your configuration at any time:

cube config show

Configure Authentication

Cube supports both interactive user authentication and service account authentication.

Service Account (OpenID Client Credentials)

This method is recommended for:

  • Automation
  • CI/CD pipelines
  • Background services
  • Scheduled jobs

Store your OpenID credentials locally:

cube config set openid.client my-agent-client
cube config set openid.secret my-client-secret

Once configured, you can authenticate without providing credentials on every login.


Authentication

Login with a Service Account

Use the configured OpenID client credentials:

cube login agent

Or provide credentials explicitly:

cube login agent --client Job --secret secret

Login with a User Account

For username/password authentication:

cube login account --username Administrator --password secret

Logout

Clear the current authentication session:

cube login logout

Working with Resources

Cube exposes NIM resources through a consistent command structure.

Discover Available Resources

List all available resources:

cube resources

Display information about a specific resource:

cube resources Metadata

Entity Types

Entity types represent object definitions within NIM.

List Entity Types

cube entitytype list

Get an Entity Type

Retrieve a single entity type by its identifier:

cube entitytype get 1337

Create an Entity Type

cube entitytype create \
-d '{
"identifier": "Directory_Test",
"displayName_L1": "Test"
}'

Update an Entity Type

cube entitytype update 1337 \
-d '{
"displayName_L1": "New Name"
}'

Delete an Entity Type

cube entitytype delete 1337

Filtering and Queries

Filter results using a query expression:

cube entitytype list --query "Identifier='Directory_User'"

JSON Output

Generate compact JSON output for scripting and automation:

cube --output compact entitytype list

Pipe results to other tools:

cube --output compact entitytype list | jq '.[].Name'

Reading Input from Standard Input

Cube can read request payloads directly from stdin.

Create a resource using a JSON file:

cat payload.json | cube entitytype create -d -

This is particularly useful when generating payloads dynamically in shell scripts or CI/CD workflows.


Next Steps

  • Explore available resources with cube resources
  • Inspect resource schemas and supported operations
  • Integrate Cube into automation workflows and CI/CD pipelines
  • Use the MCP server to connect Cube with AI assistants and external tools