Create Application CLI

Create a new application in JFrog AppTrust with JFrog CLI.

Description: Creates a new application with a specified key and optional display name. You can provide additional details, such as description, business criticality, maturity level, labels, and owners, to further describe the application’s attributes. This command enables the creation of an application using file specs.

Command:

jf apptrust app-create <app-key> --project [command options]

Alias command: jf at ac

Command Options

OptionRequired/OptionalTypeDescription
<application-key>requiredstringThe application key. Must be 2-64 lowercase alphanumeric characters, beginning with a letter (hyphens are supported). The key must be unique and immutable.
--project "<project-key>"required, unless --spec is providedstringThe key of the project associated with the application. Mutually exclusive with --spec.
--application-name "<application-name>"optionalstring

The application display name. Must be a unique string within the scope of the project, 1-255 alphanumeric characters in length, including underscores, hyphens, and spaces.

If this option is not provided, the app-key is used as the application display name.

--desc "<description>"optionalstringFree-text description of the application.
--business-criticality "<level>"optionalstringA classification of how critical the application is for your business:
  • unspecified (default)
  • low
  • medium
  • high
  • critical
--maturity-level "<level>"optionalstringThe maturity level of the application:
  • unspecified
  • experimental
  • production
  • end_of_life
--labels "<key1>=<value1>; <key2>=<value2>"optionalarray:string

Key-value pairs for labeling the application. Each key and value is free text, limited to 255 characters, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics in between.

Each label must have both a key and a value. Empty values are not permitted.

Sample labels: tier=frontend, release=canary, and AppGroup=wordpress.

--user-owners "<user-owner1>; <user-owner2>"optionalarray:stringList of users defined in the project who own the application.
--group-owners "<group-owner1>; <group-owner2>"optionalarray:stringList of user groups defined in the project who own the application.
--spec "<path>"optionalstringThe path to a file spec to be used in place of inline command options. For more information, see Using File Specs. Mutually exclusive with --application-name, --project, --desc, --business-criticality, --maturity-level, --labels, --user-owners, and --group-owners.
--spec-vars "<key-value-pairs>"optionalstring

A list of variables, in the form "key1=value1;key2=value2;..." and wrapped in quotes, to be replaced in the file spec.

In the file spec, use the variables as follows: ${key1}

Example 1: Create a minimal application

This command creates a new application with only the required app-key and --project options.

jfrog apptrust app-create my-auth-service --project="default"

Output:

Successfully created application 'my-auth-service'.

Example 2: Create an application with metadata and ownership

This command creates a new application, providing a display name, description, labels, and assigning both user and group owners.

jfrog apptrust app-create inventory-api \
  --project="default" \
  --application-name="Inventory Management API" \
  --desc="Handles stock and inventory data for all warehouses." \
  --labels="team=backend;language=go" \
  --user-owners="api-lead;dev-manager" \
  --group-owners="inventory-devs"

Output:

Successfully created application 'inventory-api'.

Example 3: Create a critical, production-maturity application

This command creates an application with critical business criticality and production maturity level.

jfrog apptrust app-create payment-gateway \
  --project="default" \
  --application-name="Global Payment Gateway" \
  --business-criticality="critical" \
  --maturity-level="production"

Output:

Successfully created application 'payment-gateway'.

Example 4: Create an application using a spec file

This command creates an application whose definition is defined in a spec file.

jf at app-create green-pizza --spec /path/to/spec.json --spec-vars "PROJECT_KEY=catalina;APP_NAME=green-pizza"

Spec file example:

{
  "project_key": "${PROJECT_KEY}",
  "application_name": "${APP_NAME}",
  "description": "A comprehensive test application",
  "maturity_level": "production",
  "criticality": "high",
  "labels": [
    {"key": "environment", "value": "production"},
    {"key": "region", "value": "us-east-1"},
    {"key": "team", "value": "devops"}
  ],
  "user_owners": [
    "john.doe",
    "jane.smith"
  ],
  "group_owners": [
    "devops-team",
    "security-team"
  ]
}

Frequently Asked Questions

Common questions about creating an application.

plusFAQs
Q: How do I create an application using the JFrog CLI?

A: Run jf apptrust app-create <app-key> --project [command options] (alias jf at ac). See Command Options for the full list of arguments.

Q: Is the --project option always required?

A: No. --project is required unless you provide --spec, since the two options are mutually exclusive.

Q: Can I create an application from a file spec instead of individual flags?

A: Yes. Use --spec to point to a file spec, optionally with --spec-vars to substitute variables. See Example 4.

Q: What happens if I don't provide --application-name?

A: The CLI uses the app-key value as the application's display name.

Q: How do I set the application's business criticality or maturity level?

A: Use --business-criticality (for example, critical) and --maturity-level (for example, production). See Command Options for the full list of accepted values.

Related Topics


Did this page help you?