> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# iagctl run service executable

Executes an executable service.

Use this command to execute an executable service. The command displays the resulting `stdout`, `stderr`, return code, and execution time.

To pass arguments when running an executable service, use the `--set` flag with `key=value` syntax. If the service was created with a decorator, any variables you pass in using `--set` are validated against that decorator.

For more information, see [Run an executable service](../run-executable-service).

## Syntax

```
iagctl run service executable <service-name> [flags]
```

## How arguments are passed

The format in which arguments are passed to your executable depends on the `--arg-format` specified when the service was created. The default format is `--{{.Key}} {{.Value}}`, which passes arguments as command-line flags.

For example, if you run:

```bash
iagctl run service executable my-script --set device=10.0.0.1 --set port=22
```

With the default `--arg-format "--{{.Key}} {{.Value}}"`, Gateway executes:

```bash
/path/to/executable --device 10.0.0.1 --port 22
```

If the service was created with `--arg-format "{{.Key}}={{.Value}}"`, Gateway executes:

```bash
/path/to/executable device=10.0.0.1 port=22
```

Make sure your executable can parse arguments in the format specified when the service was created.

## Runtime secrets

You can inject secrets at runtime using the `--set-secret` flag. Runtime secrets are merged with or override the secrets defined on the service at creation time. The `--set-secret` flag uses the same comma-separated syntax as the create command:

```
--set-secret name=my-secret,type=env,target=ENV_VAR_NAME
```

## Examples

### Run an executable service with no arguments

Runs an executable service called `backup-script`.

```bash
iagctl run service executable backup-script
```

### Run an executable service with arguments

Runs an executable service called `network-config` with `device` and `interface` arguments.

```bash
iagctl run service executable network-config \
  --set device=router-01 \
  --set interface=eth0
```

### Run an executable service with a runtime secret

Runs an executable service and injects a secret at runtime as an environment variable.

```bash
iagctl run service executable api-caller \
  --set endpoint=https://api.example.com \
  --set-secret name=api-token,type=env,target=API_TOKEN
```

### Run an executable service with multiple arguments and a runtime secret

Runs an executable service with multiple arguments and a runtime secret.

```bash
iagctl run service executable deployment-script \
  --set environment=production \
  --set region=us-east-1 \
  --set replicas=3 \
  --set-secret name=deploy-key,type=env,target=DEPLOY_KEY
```

## Options

```
  -h, --help                     help for executable
      --set stringArray          Input argument to pass into the script at runtime using key=value syntax.
                                 If the service has a decorator, inputs must match what is defined in the
                                 decorator. If no decorator is defined, you can pass any arguments.
      --set-secret stringArray   Secret to use during script execution. These are merged with or override
                                 the secrets defined on the service.
      --use                      Display the possible inputs of the script via the decorator.
```

## Options inherited from parent commands

```
      --config string    Specify the path to the configuration file
      --profile string   Specify the client profile to use (case-insensitive, defaults to [client] section)
      --raw              Displays the result of the command in its raw format
      --verbose          Enable verbose output
```