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
| Option | Required/Optional | Type | Description |
|---|---|---|---|
<application-key> | required | string | The 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 provided | string | The key of the project associated with the application. Mutually exclusive with --spec. |
--application-name "<application-name>" | optional | string | 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 |
--desc "<description>" | optional | string | Free-text description of the application. |
--business-criticality "<level>" | optional | string | A classification of how critical the application is for your business:
|
--maturity-level "<level>" | optional | string | The maturity level of the application:
|
--labels "<key1>=<value1>; <key2>=<value2>" | optional | array: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: |
--user-owners "<user-owner1>; <user-owner2>" | optional | array:string | List of users defined in the project who own the application. |
--group-owners "<group-owner1>; <group-owner2>" | optional | array:string | List of user groups defined in the project who own the application. |
--spec "<path>" | optional | string | The 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>" | optional | string | A list of variables, in the form In the file spec, use the variables as follows: |
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.
FAQs
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?
--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?
--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
Updated 2 days ago
