> ISPO SDK documentation. [HTML](https://ispo.ai/docs/interfaces/core.ProjectCommandsApi.html) · [Documentation index](https://ispo.ai/docs/llms.txt)

# Interface ProjectCommandsApi

```typescript
interface ProjectCommandsApi {
    define<
        const InputSchema extends ProjectCommandSchema,
        const ResultSchema extends ProjectCommandSchema,
        const ResultChannels extends CapabilityResultChannel[],
    >(
        metadata: ProjectCommandDefinition<
            InputSchema,
            ResultSchema,
            ResultChannels,
        >,
        handler: ProjectCommandHandler<
            JsonSchemaValue<InputSchema>,
            ProjectCommandResult<ResultSchema, ResultChannels>,
        >,
    ): ProjectCommand<
        JsonSchemaValue<InputSchema>,
        ProjectCommandResult<ResultSchema, ResultChannels>,
    >;
    define<Input, Result extends CapabilityResultEnvelope>(
        metadata: ProjectCommandCatalogEntry,
        handler: ProjectCommandHandler<Input, Result>,
    ): ProjectCommand<Input, Result>;
    expose(
        commandList: readonly ProjectCommand<unknown, CapabilityResultEnvelope>[],
    ): ProjectCommandExposure;
}
```

Types: [define](#define-1), [InputSchema](#defineinputschema), [ProjectCommandSchema](core.Supporting_types.ProjectCommandSchema.md), [ResultSchema](#defineresultschema), [ResultChannels](#defineresultchannels), [CapabilityResultChannel](../types/core.CapabilityResultChannel.md), [ProjectCommandDefinition](../types/core.Supporting_types.ProjectCommandDefinition.md), [ProjectCommandHandler](../types/core.ProjectCommandHandler.md), [JsonSchemaValue](../types/core.Supporting_types.JsonSchemaValue.md), [ProjectCommandResult](../types/core.Supporting_types.ProjectCommandResult.md), [ProjectCommand](../types/core.ProjectCommand.md), [define](#define-2), [Input](#defineinput), [Result](#defineresult), [CapabilityResultEnvelope](../types/core.CapabilityResultEnvelope.md), [ProjectCommandCatalogEntry](../types/core.ProjectCommandCatalogEntry.md), [expose](#expose-1), [ProjectCommandExposure](core.ProjectCommandExposure.md)

##### Index

### <a id="methods"></a>Methods

[define](#define) [expose](#expose)

## <a id="methods-1"></a>Methods

### <a id="define"></a>define

*   <a id="define-1"></a>
    
    ```typescript
    define<
        const InputSchema extends ProjectCommandSchema,
        const ResultSchema extends ProjectCommandSchema,
        const ResultChannels extends CapabilityResultChannel[],
    >(
        metadata: ProjectCommandDefinition<
            InputSchema,
            ResultSchema,
            ResultChannels,
        >,
        handler: ProjectCommandHandler<
            JsonSchemaValue<InputSchema>,
            ProjectCommandResult<ResultSchema, ResultChannels>,
        >,
    ): ProjectCommand<
        JsonSchemaValue<InputSchema>,
        ProjectCommandResult<ResultSchema, ResultChannels>,
    >
    ```
    
    Types: [InputSchema](#defineinputschema), [ProjectCommandSchema](core.Supporting_types.ProjectCommandSchema.md), [ResultSchema](#defineresultschema), [ResultChannels](#defineresultchannels), [CapabilityResultChannel](../types/core.CapabilityResultChannel.md), [ProjectCommandDefinition](../types/core.Supporting_types.ProjectCommandDefinition.md), [ProjectCommandHandler](../types/core.ProjectCommandHandler.md), [JsonSchemaValue](../types/core.Supporting_types.JsonSchemaValue.md), [ProjectCommandResult](../types/core.Supporting_types.ProjectCommandResult.md), [ProjectCommand](../types/core.ProjectCommand.md)
    
    #### Type Parameters
    
    *   <a id="defineinputschema"></a>const InputSchema extends [ProjectCommandSchema](core.Supporting_types.ProjectCommandSchema.md)
    *   <a id="defineresultschema"></a>const ResultSchema extends [ProjectCommandSchema](core.Supporting_types.ProjectCommandSchema.md)
    *   <a id="defineresultchannels"></a>const ResultChannels extends [CapabilityResultChannel](../types/core.CapabilityResultChannel.md)\[\]
    
    #### Parameters
    
    *   metadata: [ProjectCommandDefinition](../types/core.Supporting_types.ProjectCommandDefinition.md)<[InputSchema](#defineinputschema), [ResultSchema](#defineresultschema), [ResultChannels](#defineresultchannels)\>
    *   handler: [ProjectCommandHandler](../types/core.ProjectCommandHandler.md)<  
            [JsonSchemaValue](../types/core.Supporting_types.JsonSchemaValue.md)<[InputSchema](#defineinputschema)\>,  
            [ProjectCommandResult](../types/core.Supporting_types.ProjectCommandResult.md)<[ResultSchema](#defineresultschema), [ResultChannels](#defineresultchannels)\>,  
        \>
    
    #### Returns [ProjectCommand](../types/core.ProjectCommand.md)<  
        [JsonSchemaValue](../types/core.Supporting_types.JsonSchemaValue.md)<[InputSchema](#defineinputschema)\>,  
        [ProjectCommandResult](../types/core.Supporting_types.ProjectCommandResult.md)<[ResultSchema](#defineresultschema), [ResultChannels](#defineresultchannels)\>,  
    \>
    
*   <a id="define-2"></a>
    
    ```typescript
    define<Input, Result extends CapabilityResultEnvelope>(
        metadata: ProjectCommandCatalogEntry,
        handler: ProjectCommandHandler<Input, Result>,
    ): ProjectCommand<Input, Result>
    ```
    
    Types: [Input](#defineinput), [Result](#defineresult), [CapabilityResultEnvelope](../types/core.CapabilityResultEnvelope.md), [ProjectCommandCatalogEntry](../types/core.ProjectCommandCatalogEntry.md), [ProjectCommandHandler](../types/core.ProjectCommandHandler.md), [ProjectCommand](../types/core.ProjectCommand.md)
    
    Backward-compatible explicit type arguments for projects migrating from the original `commands.define<Input, Result>(...)` surface.
    
    #### Type Parameters
    
    *   <a id="defineinput"></a>Input
    *   <a id="defineresult"></a>Result extends [CapabilityResultEnvelope](../types/core.CapabilityResultEnvelope.md)
    
    #### Parameters
    
    *   metadata: [ProjectCommandCatalogEntry](../types/core.ProjectCommandCatalogEntry.md)
    *   handler: [ProjectCommandHandler](../types/core.ProjectCommandHandler.md)<[Input](#defineinput), [Result](#defineresult)\>
    
    #### Returns [ProjectCommand](../types/core.ProjectCommand.md)<[Input](#defineinput), [Result](#defineresult)\>
    

### <a id="expose"></a>expose

*   <a id="expose-1"></a>
    
    ```typescript
    expose(
        commandList: readonly ProjectCommand<unknown, CapabilityResultEnvelope>[],
    ): ProjectCommandExposure
    ```
    
    Types: [ProjectCommand](../types/core.ProjectCommand.md), [CapabilityResultEnvelope](../types/core.CapabilityResultEnvelope.md), [ProjectCommandExposure](core.ProjectCommandExposure.md)
    
    #### Parameters
    
    *   commandList: readonly [ProjectCommand](../types/core.ProjectCommand.md)<unknown, [CapabilityResultEnvelope](../types/core.CapabilityResultEnvelope.md)\>\[\]
    
    #### Returns [ProjectCommandExposure](core.ProjectCommandExposure.md)
