---
id: "P:cAlgo.API.CommandArgs.Command"
kind: "property"
type: "T:cAlgo.API.CommandArgs"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Commands/CommandArgs/Command/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# CommandArgs.Command

Member of [CommandArgs](https://help.ctrader.com/ctrader-algo/references/Plugin/Commands/CommandArgs/index.md).

## Command

Gets the command associated with these arguments.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public Command Command {get;}
```

Python:

```python
commandArgs.Command: Command
```

### Returns

`Command` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    Commands.Add(CommandType.ChartContainerToolbar, OnCommandExecuted);
}

private void OnCommandExecuted(CommandArgs args)
{
    args.Command.IsEnabled = false;
    Print("Command {0} disabled after first use", args.Command.Id);
}
```

Python:

```python
from System import Action

def on_start(self):
    api.Commands.Add(CommandType.ChartContainerToolbar, Action[CommandArgs](self.on_command_executed))

def on_command_executed(self, args):
    args.Command.IsEnabled = False
    api.Print(f"Command {args.Command.Id} disabled after first use")
```

