# IResourceWithArgs

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.4.0`
- Kind: `interface`
- Source: [GitHub](https://github.com/microsoft/aspire)

Represents a resource that is associated with commandline arguments.

## Definition

```typescript
interface IResourceWithArgs {
  withArgs(args: string[]): IResourceWithArgs;
  withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise<void>): IResourceWithArgs;
}
```

## Methods

- [withArgs](/reference/api/typescript/aspire.hosting/iresourcewithargs/withargs.md) -- `method` -- Adds arguments to be passed to a resource that supports arguments when it is launched.
    ```typescript
  withArgs(args: string[]): IResourceWithArgs
  ```
- [withArgsCallback](/reference/api/typescript/aspire.hosting/iresourcewithargs/withargscallback.md) -- `method` -- Adds a callback to be executed with a list of command-line arguments when a resource is started.
    ```typescript
  withArgsCallback(callback: (obj: CommandLineArgsCallbackContext) => Promise<void>): IResourceWithArgs
  ```
