> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pragmatiks.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Resources

> Manage resources with the CLI

## Apply

Create or update resources from YAML (starts provisioning immediately by default):

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources apply myresource.yaml
```

Apply multiple files:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources apply file1.yaml file2.yaml
```

Create in draft state (skip provisioning):

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources apply --draft myresource.yaml
```

<Note>
  Resources are deployed by default when you apply them. Use `--draft` to save a resource configuration without triggering provisioning.
</Note>

### File References

For `pragma/secret` resources, use `@path` syntax to inline file contents:

```yaml theme={"theme":{"light":"min-light","dark":"min-dark"}}
provider: pragma
resource: secret
name: gcp-credentials
config:
  data:
    service_account_key: "@./service-account.json"
```

For `pragma/file` resources, use `@path` in the `content` field to upload a file:

```yaml theme={"theme":{"light":"min-light","dark":"min-dark"}}
provider: pragma
resource: file
name: training-data
config:
  content: "@./data/training-set.jsonl"
  content_type: "application/jsonl"
```

The file is uploaded to Pragmatiks storage, and the resource outputs include a URL for downloading it.

## List

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources list
```

Output as JSON for scripting:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources list --output json
```

Filter by provider:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources list --provider gcp
```

Filter by resource type:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources list --resource warehouse
```

Filter by tags:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources list --tag env:production
```

## Types

List available resource types from deployed providers:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources types
```

Filter by provider:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources types --provider gcp
```

## Get

Get resources by type:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources get gcp/storage
```

Get a specific resource:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources get gcp/storage my-bucket
```

## Describe

Get detailed information about a resource, including full configuration, resolved config, and outputs:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources describe gcp/storage my-bucket
```

Output as JSON to inspect `resolved_config` for dependency debugging:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources describe agno/agent my-agent -o json
```

## Tags

Manage tags on existing resources:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# List tags
pragma resources tags list gcp/storage my-bucket

# Add tags
pragma resources tags add gcp/storage my-bucket --tag env:prod --tag cost-center:123

# Remove tags
pragma resources tags remove gcp/storage my-bucket --tag env:prod
```

## Delete

Delete a resource by type and name:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources delete gcp/storage my-bucket
```

Delete all resources defined in a YAML file:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources delete -f myresources.yaml
```

This reads the provider, resource, and name from each document in the YAML file and deletes the matching resources.

## Next Steps

<Card title="Resource Concepts" icon="book" href="/concepts/resources">
  Learn about resource lifecycle, deletion behavior, and dependency resolution.
</Card>
