---
title: kapacitor flux task create
description: The kapacitor flux task create command creates a Flux task using a specified file or stdin.
url: https://docs.influxdata.com/kapacitor/v1/reference/cli/kapacitor/flux/task/create/
estimated_tokens: 247
product: Kapacitor
version: v1
publisher: InfluxData
canonical: https://docs.influxdata.com/kapacitor/v1/reference/cli/kapacitor/flux/task/create/
date: '2023-10-03T10:49:57-06:00'
lastmod: '2023-10-03T10:49:57-06:00'
---

The `kapacitor flux task create` command creates a Flux task using a specified
file or *stdin*.

## Usage

```sh
kapacitor flux task create [flags] [flux-script]
```

## Arguments

* **flux-script**: Flux script provided via *stdin* (`-`).

## Flags

|Flag|        |      Description       |
|----|--------|------------------------|
|`-f`|`--file`|Path to Flux script file|
|`-h`|`--help`|   Show command help    |
|    |`--json`|  Output data as JSON   |

## Examples

### Create a Kapacitor Flux task using a file

```sh
kapacitor flux task create \
  --file /path/to/task.flux
```

### Create a Kapacitor Flux task via stdin

```sh
kapacitor flux task create -
# Enter the Flux script in the stdin prompt
```

#### Related

* [Create Kapacitor Flux tasks](/kapacitor/v1/working/flux/manage/create/)
| Flag |  | Description |
| --- | --- | --- |
| Flag |  | Description |
| -f | --file | Path to Flux script file |
| -h | --help | Show command help |
|  | --json | Output data as JSON |
