﻿# octopus project variables create

Create a variable for a project in Octopus Deploy

```text
Usage:
  octopus project variables create [flags]

Aliases:
  create, add

Flags:
      --channel-scope strings            Assign channel scopes to the variable. Multiple scopes can be supplied.
      --environment-scope strings        Assign environment scopes to the variable. Multiple scopes can be supplied.
      --git-ref string                   The GitRef for the Config-As-Code branch
  -n, --name string                      The name of the variable
      --process-scope strings            Assign process scopes to the variable. Valid scopes are 'deployment' or a runbook name. Multiple scopes can be supplied.
  -p, --project string                   The project
      --prompt-description string        Description for the prompted variable
      --prompt-dropdown-option strings   Options for a dropdown prompt. May be specified multiple times. Must be in format 'value|description'
      --prompt-label string              The label for the prompted variable
      --prompt-required                  Prompt will require a value for deployment
      --prompt-type string               The input type for the prompted variable. Valid values are 'text', 'multiline-text', 'checkbox' and 'dropdown'
      --prompted                         Make a prompted variable
      --role-scope strings               Assign role scopes to the variable. Multiple scopes can be supplied.
      --step-scope strings               Assign process step scopes to the variable. Multiple scopes can be supplied.
      --tag-scope strings                Assign tag scopes to the variable. Multiple scopes can be supplied.
      --target-scope strings             Assign deployment target scopes to the variable. Multiple scopes can be supplied.
  -t, --type string                      The type of variable. Valid values are text, sensitive, workerpool, awsaccount, azureaccount, googleaccount, certificate. Default is text
      --value string                     The value to set on the variable

Global Flags:
  -h, --help                   Show help for a command
      --no-prompt              Disable prompting in interactive mode
  -f, --output-format string   Specify the output format for a command ("json", "table", or "basic") (default "table")
  -s, --space string           Specify the space for operations

```

## Examples

:::div{.success}
**Octopus Samples instance**

Many of the examples we use, reference the [samples instance](https://samples.octopus.app/app#/users/sign-in) of Octopus Deploy. If you'd like to explore the samples instance, you can log in as a guest.
:::

```bash
octopus project variable create
octopus project variable create --project "Deploy Website" --name "variable name" --value "abc"
octopus project variable create --name "variable name" --value "passwordABC" --type sensitive
octopus project variable create --name "variable name" --value "abc" --scope environment='test'
octopus project variable create --name "variable name" --value "abc" --scope environment='test' --git-ref refs/heads/main

```

## Learn more

- [Octopus CLI](/docs/octopus-rest-api/cli)
- [Creating API keys](/docs/octopus-rest-api/how-to-create-an-api-key)
