WEBINARLive webinar: Terraform in Buddy, Oct 21st.Terraform: plan, approve, apply with state in Buddy. Live on October 21st.Save your seat

bdy target create

View as Markdown
$bdy target create|add [options]

Create a target from YAML Required scopes: TARGET_WRITE

OPTIONS
--context <name>
Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation.
--examples
Show only examples; with this flag --format accepts text, json or jsonl
--verbose
Show REST API requests, responses, timing and retries on stderr
-w, --workspace <domain>
Workspace URL handle. Can be set via variable: BUDDY_WORKSPACE
-p, --project <name>
Project name. Can be set via variable: BUDDY_PROJECT
--pipeline <identifier>
Pipeline identifier to scope the target to. Requires --project
--environment <identifier>
Environment identifier to scope the target to. Resolves a workspace environment; add --project to point at a project environment
--scope <scope>
Force scope (WORKSPACE, PROJECT, ENVIRONMENT, PIPELINE). By default calculated by provided options and environmental variables (--pipeline,
--environment, --project
BUDDY_PROJECT, linked project)
--yaml <content|@path>
Complete target YAML. To specify file use @path/to/file format in value
--format <text|json>
Output format: json, text. JSON CLI errors: {error:{code,message,hint}}, exit 1. Default: text (choices: "text", "json")
-h, --help
display help for command

Documentation for bdy v1.25.20

Last modified on Oct 14, 2026

Examples

Create workspace target from yaml file
bdy tg create --yaml @target.yml$
Create project target
bdy tg create --yaml @target.yml -p project$
Create pipeline target
bdy tg create --yaml @target.yml -p project --pipeline pipeline-identifier$
Create workspace environment target
bdy tg create --yaml @target.yml --environment environment-identifier$
Create project environment target
bdy tg create --yaml @target.yml -p project --environment environment-identifier$
Return the result as JSON
bdy target create --yaml @target.yml --format json$