App Commands

App Commands

Last updated:

The Camber CLI provides comprehensive commands to create and manage applications efficiently, combining the command-line interface with the backend API capabilities.

Command Overview

The main app creation command is:

camber app create --file <path-to-app-definition.json>

Available Flags

  • --file (required): Path to JSON file containing app definition (local path or stash://path)
  • --output: Output format (json for structured output)

Creating Your First App

Step 1: Create an App Definition File

Create a JSON file (e.g., my-app.json) with the following structure:

{
  "name": "my-first-app",
  "title": "My First Application",
  "description": "A simple application to get started",
  "content": "This app demonstrates basic functionality",
  "engineType": "MPI",
  "command": "python main.py"
}

Step 2: Create the App

camber app create --file my-app.json

Step 3: Verify Creation

# List all apps
camber app list

# Get detailed information about your app
camber app describe my-first-app

App Definition File Structure

Required Fields

FieldTypeDescriptionExample
namestringUnique app identifier (lowercase, numbers, hyphens only)"data-processor-v2"
engineTypestringType of compute engine"NEXTFLOW", "MPI"
commandstringCommand to execute when launching"python main.py"

Optional Fields

FieldTypeDefaultDescription
titlestringAuto-generated from nameHuman-readable app title
descriptionstring"Description"Detailed app description
contentstring"Content"App content/instructions
imageUrlstring-URL to app’s Docker image
specarray[]App specification for user inputs
jobConfigarray[]Job configuration options
tagsarray[]Tags for categorizing the app

Complete Example

{
  "name": "mpi-hello-world",
  "title": "MPI Hello World",
  "description": "Simple MPI Hello World",
  "content": "<p class=\"text-node\">Simple MPI Hello World</p>",
  "engineType": "MPI",
  "command": "echo \"Hello world\"",
  "spec": [
    {
      "type": "Stash File",
      "label": "Sample File",
      "name": "input",
      "description": "A sample file",
      "defaultValue": "",
      "hidden": false,
      "required": true,
      "disabled": false
    }
  ],
  "jobConfig": [
    {
      "type": "Select",
      "label": "System Size",
      "name": "system_size",
      "hidden": true,
      "description": "Select the configuration for the job",
      "options": [
        {
          "label": "Small",
          "value": "small",
          "mapValue": {
            "nodeSize": "XXSMALL",
            "numNodes": 1,
            "withGpu": false
          }
        }
      ],
      "defaultValue": "small"
    }
  ],
  "tags": [
    {
      "name": "data-processing",
      "type": "field"
    },
    {
      "name": "analytics",
      "type": "subfield"
    }
  ]
}

Advanced Configuration

Supported Engine Types

The CLI supports various engine types for different computational needs: MPI, NEXTFLOW, GROMACS, LAMMPS, OPENFOAM

Input Specification (Spec)

Define user inputs when launching the app:

Supported Input Types

TypeDescriptionUse Case
InputSingle-line text inputFile paths, parameters
TextareaMulti-line text inputScripts, configurations
SelectDropdown selectionPredefined options
RadioRadio button selectionSingle choice from options
SwitchBoolean toggleEnable/disable features
CheckboxBoolean checkboxMultiple selections
Stash FileFile upload from stashSingle file input
Multi Stash FileMultiple file uploadsBatch file processing

Spec Example

{
  "spec": [
    {
      "type": "Stash File",
      "label": "Sample File",
      "name": "input",
      "description": "A sample file",
      "defaultValue": "",
      "hidden": false,
      "required": true,
      "disabled": false
    }
  ]
}

Job Configuration

Define available compute resources:

{
  "jobConfig": [
    {
      "type": "Select",
      "label": "System Size",
      "name": "system_size",
      "hidden": true,
      "description": "Select the configuration for the job",
      "options": [
        {
          "label": "Small",
          "value": "small",
          "mapValue": {
            "nodeSize": "XXSMALL",
            "numNodes": 1,
            "withGpu": false
          }
        }
      ],
      "defaultValue": "small"
    }
  ]
}

Tags

Categorize your app for better organization:

{
  "tags": [
    {
      "name": "machine-learning",
      "type": "field"
    },
    {
      "name": "data-analysis",
      "type": "subfield"
    },
    {
      "name": "image-processing",
      "type": "task"
    }
  ]
}

Tag Types:

  • field: Broad category (e.g., “machine-learning”, “physics”)
  • subfield: Specific area (e.g., “data-analysis”, “simulation”)
  • task: Specific task (e.g., “image-processing”, “optimization”)

Managing Apps

List Apps

# List all apps
camber app list

# Filter by tags
camber app list --tags analytics,data-processing

# JSON output
camber app list --output json

Describe App

# Get detailed app information
camber app describe my-app

# JSON output
camber app describe my-app --output json

Delete App

# Delete an app
camber app delete my-app

File Sources

The CLI supports multiple file sources for app definitions:

Local Files

camber app create --file ./my-app.json
camber app create --file /absolute/path/to/app.json

Stash Files

camber app create --file stash://path/to/app.json