Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion control-plane/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM} golang:1.25.5 AS builder
FROM --platform=${BUILDPLATFORM} golang:1.25.6 AS builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion control-plane/common/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/agntcy/slim/control-plane/common

go 1.25.5
go 1.25.6

require (
github.com/google/uuid v1.6.0
Expand Down
2 changes: 1 addition & 1 deletion control-plane/control-plane/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/agntcy/slim/control-plane/control-plane

go 1.25.5
go 1.25.6

require (
github.com/agntcy/slim/control-plane/common v0.0.0-00010101000000-000000000000
Expand Down
218 changes: 176 additions & 42 deletions control-plane/slimctl/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,141 @@
# slimctl

`slimctl` is the command-line interface for the SLIM controller.
Command-line interface for managing SLIM instances and the SLIM control plane.

## Overview

`slimctl` is a unified CLI tool that provides commands for:

- **Local Development** - Run standalone SLIM instances for development and testing using production configurations
- **Route Management** - Configure message routing between services via the SLIM Control Plane
- **Connection Monitoring** - View and manage active connections on SLIM nodes
- **Direct Node Access** - Manage SLIM nodes directly without going through the Control Plane

### Command Groups

| Command | Purpose |
|---------|---------|
| `slim` | Start and manage local SLIM instances |
| `route` | Manage routes via Control Plane |
| `connection` | Monitor connections via Control Plane |
| `node-connect` | Direct node management (bypass Control Plane) |
| `version` | Display version information |

---

## Installation

Instructions can be found [here](./installation.md).
### Pre-built Binaries

Download from the [GitHub releases page](https://github.com/agntcy/slim/releases):

1. Download the binary for your OS and architecture
2. Extract the archive
3. Move `slimctl` to a directory in your `PATH`

### Homebrew (macOS)

```bash
brew tap agntcy/slim
brew install slimctl
```

### Building from Source

**Prerequisites**: Go 1.20+, Task (taskfile.dev)

```bash
# From repository root
cd control-plane
task control-plane:slimctl:build

# Binary location: .dist/bin/slimctl
```

---

## Command Usage and Examples

### `slim` - Local SLIM Instances

Run standalone SLIM instances for development and testing using production configurations.

**Start with a configuration file:**

```bash
# Start with base configuration (insecure)
slimctl slim start --config data-plane/config/base/server-config.yaml

# Start with TLS configuration
slimctl slim start --config data-plane/config/tls/server-config.yaml
```

**Override the server endpoint:**

```bash
slimctl slim start --config data-plane/config/base/server-config.yaml --endpoint 127.0.0.1:9090
```

**Control log level:**

```bash
RUST_LOG=debug slimctl slim start --config data-plane/config/base/server-config.yaml
```

**Available flags:**
- `--config` - Path to YAML configuration file (production SLIM format)
- `--endpoint` - Server endpoint (sets `SLIM_ENDPOINT` environment variable)

**Configuration files:** Use production configs from `data-plane/config/`:
- `base/server-config.yaml` - Basic insecure configuration
- `tls/server-config.yaml` - TLS-enabled server
- `mtls/` - Mutual TLS authentication
- `basic-auth/` - HTTP Basic authentication
- `jwt-auth-*/` - JWT authentication (RSA, ECDSA, HMAC)
- `spire/` - SPIFFE/SPIRE workload identity
- `proxy/` - HTTP proxy configuration
- `telemetry/` - OpenTelemetry integration

## Configuration
---

`slimctl` supports configuration via a file, environment variables, and command-line flags.
### `route` - Route Management

### Config file
Manage message routes on SLIM nodes via the Control Plane.

By default, `slimctl` looks for a config file at `$HOME/.slimctl/config.yaml` or in the current working directory.
Example `config.yaml`:
**List routes:**

```bash
slimctl route list --node-id=my-node
```

**Add a route:**

```bash
# Create connection configuration
cat > connection_config.json <<EOF
{
"endpoint": "http://127.0.0.1:46357"
}
EOF

# Add the route
slimctl route add org/namespace/service/0 via connection_config.json --node-id=my-node
```

**Delete a route:**

```bash
slimctl route del org/namespace/service/0 via http://localhost:46357 --node-id=my-node
```

**Control Plane Configuration:**

slimctl looks for Control Plane configuration at:
- `$HOME/.slimctl/config.yaml`
- `./config.yaml` (current directory)
- Via `--config` flag

Example configuration:

```yaml
server: "127.0.0.1:46358"
Expand All @@ -25,52 +147,64 @@ tls:
key_file: "/path/to/client.key"
```

`server` endpoint should point to a [SLIM Control](https://github.com/agntcy/slim/tree/main/control-plane/control-plane)
endpoint which is a central service managing SLIM node configurations.
SLIM nodes can be configured to expose a Controller endpoint of a SLIM instance, `slimctl` can connect to this endpoint
to manage the SLIM instance directly by using `slimctl node-control` sub-command.
In this case `server` should point to the SLIM instance endpoint.
---

## Commands
### `connection` - Connection Management

* `slimctl connection list --node-id=<slim_node_id>` List connection on a SLIM instance.
* `slimctl route list --node-id=<slim_node_id>` List routes on a SLIM instance.
* `slimctl route add <organization/namespace/appName/appInstance> via <config_file> --node-id=<slim_node_id>` Add a
route to the SLIM instance.
* `slimctl route del <organization/namespace/appName/appInstance> via <host:port> --node-id=<slim_node_id>` Delete a
route from the SLIM instance.
Monitor active connections on SLIM nodes via the Control Plane.

* `slimctl version` Print version information.
**List connections:**

Run `slimctl <command> --help` for more details on flags and usage.
```bash
slimctl connection list --node-id=my-node
```

## Examples
---

### Create, delete route
### `node-connect` - Direct Node Management

Connect directly to a SLIM node's control endpoint, bypassing the central Control Plane.

**List routes directly on a node:**

```bash
# Add a new route
cat >> connection_config.json <<EOF
{
"endpoint": "http://127.0.0.1:46357"
}
slimctl route add org/default/alice/0 via connection_config.json
slimctl node-connect route list --server=<node_control_endpoint>
```

**Add route directly to a node:**

```bash
slimctl node-connect route add org/namespace/service/0 via config.json --server=<node_control_endpoint>
```

---

# Delete an existing route
slimctl route del org/default/alice/0 via http://localhost:46367
### `version` - Version Information

Display version and build information:

```bash
slimctl version
```

---

### Getting Help

Get detailed help for any command:

```bash
slimctl --help
slimctl slim --help
slimctl slim start --help
slimctl route --help
```

> For full reference of connection_config.json
> checkout [client-config-schema.json](https://github.com/agntcy/slim/blob/main/data-plane/core/config/src/grpc/schema/client-config.schema.json)
---

### Manager routes & list connections connecting directly to a SLIM node
## Additional Resources

* `slimctl node-connect connection list --server=<node_control_endpoint>` List connection on a SLIM instance.
* `slimctl node-connect route list --server=<node_control_endpoint>` List routes on a SLIM instance.
*
`slimctl node-connect route add <organization/namespace/appName/appInstance> via <config_file> --server=<node_control_endpoint>`
Add a route to the SLIM instance.
*
`slimctl node-connect route del <organization/namespace/appName/appInstance> via <host:port> --server=<node_control_endpoint>`
Delete a route from the SLIM instance.
- **SLIM Project**: [https://github.com/agntcy/slim](https://github.com/agntcy/slim)
- **Issues & Questions**: [GitHub Issues](https://github.com/agntcy/slim/issues)
- **Configuration Examples**: See `data-plane/config/` directory for production configurations
- **SLIM Go Bindings**: [https://github.com/agntcy/slim-bindings-go](https://github.com/agntcy/slim-bindings-go)
Loading
Loading