---
title: " "
sidebarTitle: prefect block
---

# `prefect block`



```command
prefect block [OPTIONS] COMMAND [ARGS]...
```



<Info>
Manage blocks.
</Info>








## `prefect block register`



```command
prefect block register [OPTIONS]
```



<Info>
Register blocks types within a module or file.

This makes the blocks available for configuration via the UI.
If a block type has already been registered, its registration will be updated to
match the block's current definition.


Examples:
    
    Register block types in a Python module:
    \$ prefect block register -m prefect_aws.credentials
    
    Register block types in a .py file:
    \$ prefect block register -f my_blocks.py
</Info>






<AccordionGroup>




<Accordion title="Options" defaultOpen>

<ResponseField name="--module">
    Python module containing block types to be registered
</ResponseField>

<ResponseField name="--file">
    Path to .py file containing block types to be registered
</ResponseField>

</Accordion>

</AccordionGroup>



## `prefect block ls`



```command
prefect block ls [OPTIONS]
```



<Info>
View all configured blocks.
</Info>








## `prefect block delete`



```command
prefect block delete [OPTIONS] [SLUG]
```



<Info>
Delete a configured block.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="SLUG" type="string">
    A block slug. Formatted as '&lt;BLOCK_TYPE_SLUG&gt;/&lt;BLOCK_NAME&gt;'
</ResponseField>
</Accordion>



<Accordion title="Options" defaultOpen>

<ResponseField name="--id">
    A block id.
</ResponseField>

</Accordion>

</AccordionGroup>



## `prefect block create`



```command
prefect block create [OPTIONS] BLOCK_TYPE_SLUG
```



<Info>
Generate a link to the Prefect UI to create a block.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="BLOCK_TYPE_SLUG" type="string" required>
    A block type slug. View available types with: prefect block type ls  \[required]
</ResponseField>
</Accordion>



</AccordionGroup>



## `prefect block inspect`



```command
prefect block inspect [OPTIONS] [SLUG]
```



<Info>
Displays details about a configured block.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="SLUG" type="string">
    A Block slug: &lt;BLOCK_TYPE_SLUG&gt;/&lt;BLOCK_NAME&gt;
</ResponseField>
</Accordion>



<Accordion title="Options" defaultOpen>

<ResponseField name="--id">
    A Block id to search for if no slug is given
</ResponseField>

</Accordion>

</AccordionGroup>



## `prefect block types`



```command
prefect block types [OPTIONS] COMMAND [ARGS]...
```



<Info>
Inspect and delete block types.
</Info>








### `prefect block types ls`



```command
prefect block types ls [OPTIONS]
```



<Info>
List all block types.
</Info>








### `prefect block types inspect`



```command
prefect block types inspect [OPTIONS] SLUG
```



<Info>
Display details about a block type.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="SLUG" type="string" required>
    A block type slug  \[required]
</ResponseField>
</Accordion>



</AccordionGroup>



### `prefect block types delete`



```command
prefect block types delete [OPTIONS] SLUG
```



<Info>
Delete an unprotected Block Type.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="SLUG" type="string" required>
    A Block type slug  \[required]
</ResponseField>
</Accordion>



</AccordionGroup>



## `prefect block type`



```command
prefect block type [OPTIONS] COMMAND [ARGS]...
```



<Info>
Inspect and delete block types.
</Info>








### `prefect block type ls`



```command
prefect block type ls [OPTIONS]
```



<Info>
List all block types.
</Info>








### `prefect block type inspect`



```command
prefect block type inspect [OPTIONS] SLUG
```



<Info>
Display details about a block type.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="SLUG" type="string" required>
    A block type slug  \[required]
</ResponseField>
</Accordion>



</AccordionGroup>



### `prefect block type delete`



```command
prefect block type delete [OPTIONS] SLUG
```



<Info>
Delete an unprotected Block Type.
</Info>






<AccordionGroup>


<Accordion title="Arguments" defaultOpen>
<ResponseField name="SLUG" type="string" required>
    A Block type slug  \[required]
</ResponseField>
</Accordion>



</AccordionGroup>
