#
Powers of the CLI
The SDK’s CLI provides the following commands:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
#
1. create command
Command:
Usage: pf-cli create [OPTIONS]
Create a new project with the specified name.
Options:
--name TEXT Name of the project
--current-dir Create the project in the current directory
--asset-category [INTEGRATOR|TOOLS]
Category of the asset (default: INTEGRATOR)
--asset-description TEXT Description of the asset
--help Show this message and exit.
Description
- Creates a new project with the provided options
Below is the project structure of the generated project
.
└── hello-world-connector/
├── generated/
│ ├── __init__.py
│ └── models.py
├── app.py
├── __init__.py
├── pyproject.toml
├── schema.json
├── README.md
├── Dockerfile
├── .dockerignore
└── .gitignore
Screenshot
#
2. run command
Command
Usage: pf-cli run [OPTIONS]
Run the project in local using the specified inputs.
Options:
--inputs TEXT Input key-value pairs (e.g., --inputs name="Purple
Fabric" --inputs secrets="credentials-123")
--inputs-file PATH Path to a JSON file containing inputs (e.g., --inputs-
file inputs.json)
--help Show this message and exit.
Description
Executes the connector locally by invoking the run function inside app.py.
User can pass arguments as key-value pairs via the CLI, or they can pass the arguments inside a JSON file and pass the JSON file as input.
Screenshot
#
3. profiles command
Command
Usage: pf-cli profiles [OPTIONS] COMMAND [ARGS]...
Manage user profiles.
Options:
--help Show this message and exit.
Commands:
create Create a new profile.
delete Delete a profile.
list List profiles.
update Update an existing profile.
Description
- A profile consists of the Purple Fabric Platform’s login credentials used by the developer
- Profiles can be created in global scope or in local scope
- Global profiles can be used by all projects
- Local profiles can only be used in the project it was created
- Profiles play an integral role in promoting the connector to the Purple Fabric Platform
Screenshot
#
4. credentials command
Command
Usage: pf-cli credentials [OPTIONS] COMMAND [ARGS]...
Manage user credentials.
When retrieving credentials, local credentials are checked first. If not
found locally, global credentials will be checked as a fallback.
Options:
--help Show this message and exit.
Commands:
create Create new credentials.
delete Delete credentials.
list List all stored credential IDs.
update Update existing credentials.
Description
- If a connector requires usage of sensitive information like credentials, the SDK supports managing the credentials locally
- Credentials are defined by the schema.json
- Credentials are always locally encrypted
- Credentials can be created in local scope or in global scope
- Global credentials can be used by any projects, provided that they have exactly identical fields
- Local credentials can only be used in the current project. This is the recommended way to use credentials.
Screenshot
#
5. build command
Command
Usage: pf-cli build [OPTIONS]
Build the project using the specified profile.
The profile will be searched for in the local scope first, then in the
global scope if not found locally.
Options:
--profile TEXT Name of the profile to use for building the connector (e.g.,
--profile my-profile) [required]
--help Show this message and exit.
Description
- This is the first stage of 2 stages to promote your connector to Purple Fabric Platform
- In this stage, the Platform will allocate the necessary identifiers, schemas and performs validations to ensure that your connector is developed with the proper schema
- The profile determines the destination where the connector will be later published
- It is imperative that build operation must be executed at-least once.
Screenshot
#
6. deploy command
Command
Usage: pf-cli deploy [OPTIONS]
Deploy the project using the specified profile.
This command initiates the deployment pipeline. Use 'status' to check
deployment progress.
Options:
--profile TEXT Name of the profile to use for deployment [required]
--help Show this message and exit.
Description
- This is the second stage of 2 stages to promote your connector to Purple Fabric Platform
- In this stage, your connector project will be converted to an artifact and then sent for deployment to the Purple Fabric Platform
- The profile determines the destination where the connector will be deployed
- It is imperative that the build operation must be executed before running this command
- Once the deployment is initiated, you can monitor the deployment status using the status command
Screenshot
#
7. status command
Command
Usage: pf-cli status [OPTIONS]
Check the status of the deployment.
Args: profile (str): Name of the profile to use for checking deployment
status watch (bool): Whether to continuously watch the deployment status
Options:
--profile TEXT Name of the profile to use for checking deployment status
[required]
--watch Watch the deployment status by polling every 10 seconds
--help Show this message and exit.
Description
- This command provides the real-time status of the deployment pipeline
- If the deployment fails due to any reason, the timeline will contain a “Failed” state
- You can use the watch option to periodically check the deployment status
Screenshot
#
8. generate command
Command
Usage: pf-cli generate [OPTIONS] COMMAND [ARGS]...
Generate project artifacts.
Options:
--help Show this message and exit.
Commands:
models Generate Pydantic models from schema.json.
Description
- This command contains sub-commands that can generate project artifacts on the fly
- Today, it contains a single sub-command called models that generates Pydantic models from the definition provided in schema.json
- These models can be used in the app.py to develop the connector with type-safeness
Screenshot
#
9. version command
Command
Usage: pf-cli version [OPTIONS]
Output the SDK version.
Options:
--help Show this message and exit.
Description
- Provides the current SDK version used by the project
Screenshot
Note: The above output is only for illustration. The version can change based on the installed SDK version.
#
10. help command
Command
Usage: pf-cli help [OPTIONS]
Show help information for available commands.
Options:
--help Show this message and exit.
Description
- Provides helpful information about all the available commands in the SDK.
Screenshot