# IResourceWithArgs.withArgsCallback

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResourceWithArgs](/reference/api/typescript/aspire.hosting/iresourcewithargs.md)
- Version: `13.4.0`
- Kind: `method`

Adds a callback to be executed with a list of command-line arguments when a resource is started.

## Definition

```typescript
interface IResourceWithArgs {
  // ... omitted for brevity
  withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise<void>): IResourceWithArgs;
}
```

## Signature

```typescript
withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise<void>): IResourceWithArgs
```

## Parameters

- `callback` (`(obj: CommandLineArgsCallbackContext) => Promise<void>`)

## Returns

[IResourceWithArgs](/reference/api/typescript/aspire.hosting/iresourcewithargs.md) `builder`

## Defined on

- [IResourceWithArgs](/reference/api/typescript/aspire.hosting/iresourcewithargs.md) -- `interface`
