Skip to content

Commit

Permalink
[Doc] Add reference doc for pf service cli. (#2774)
Browse files Browse the repository at this point in the history
# Description

Please add an informative description that covers that changes made by
the pull request and link all relevant issues.

# All Promptflow Contribution checklist:
- [ ] **The pull request does not introduce [breaking changes].**
- [ ] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).**
- [ ] **Create an issue and link to the pull request to get dedicated
review from promptflow team. Learn more: [suggested
workflow](../CONTRIBUTING.md#suggested-workflow).**

## General Guidelines and Best Practices
- [ ] Title of the pull request is clear and informative.
- [ ] There are a small number of commits, each of which have an
informative message. This means that previously merged commits do not
appear in the history of the PR. For more information on cleaning up the
commits in your PR, [see this
page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).

### Testing Guidelines
- [ ] Pull request includes test coverage for the included changes.

---------

Co-authored-by: Ying Chen <2601502859@qq.com>
  • Loading branch information
YingChen1996 and Ying Chen committed Apr 12, 2024
1 parent f98ff85 commit aec51a0
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 8 deletions.
103 changes: 96 additions & 7 deletions docs/reference/pf-command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ This is an experimental feature, and may change at any time. Learn [more](../how

Manage prompt flow resources with the prompt flow CLI.

| Command | Description |
|---------------------------------|---------------------------------|
| [pf flow](#pf-flow) | Manage flows. |
| [pf connection](#pf-connection) | Manage connections. |
| [pf run](#pf-run) | Manage runs. |
| [pf tool](#pf-tool) | Init or list tools. |
| Command | Description |
|---------------------------------|--------------------------------|
| [pf flow](#pf-flow) | Manage flows. |
| [pf connection](#pf-connection) | Manage connections. |
| [pf run](#pf-run) | Manage runs. |
| [pf tool](#pf-tool) | Init or list tools. |
| [pf config](#pf-config) | Manage config for current user. |
| [pf upgrade](#pf-upgrade) | Upgrade prompt flow CLI. |
| [pf service](#pf-service) | Manage prompt flow service. |
| [pf upgrade](#pf-upgrade) | Upgrade prompt flow CLI. |

## pf flow

Expand Down Expand Up @@ -883,6 +884,94 @@ Show prompt flow for current user.
pf config show
```

## pf service

Manage prompt flow service.

| Command | Description |
|-----------------------------------------|-----------------------------------------------|
| [pf service start](#pf-service-start) | Start prompt flow service. |
| [pf service stop](#pf-service-stop) | Stop prompt flow service. |
| [pf service status](#pf-service-status) | Display the started prompt flow service info. |

### pf service start

Start prompt flow service.

```bash
pf service start [--port]
[--force]
[--debug]
```

#### Examples
Start prompt flow service.
```bash
pf service start
```

Force restart promptflow service.
```bash
pf service start --force
```

Start promptflow service with specific port.
```bash
pf service start --port 65553
```

Start prompt flow service in foreground, displaying debug level logs directly in the terminal.
```bash
pf service start --debug
```

#### Optional Parameters

`--port -p`

Port of the promptflow service.

`--force`

Force restart the existing service if the port is used.

`--debug`

Start prompt flow service in foreground, displaying debug level logs directly in the terminal.



### pf service stop

Stop prompt flow service.

```bash
pf service stop [--debug]
```

#### Example

Stop prompt flow service.

```bash
pf service stop
```

#### Optional Parameter

`--debug`

The flag to turn on debug mode for cli.

### pf service status

Display the started prompt flow service info.

```bash
pf service status
```


## pf upgrade

Upgrade prompt flow CLI.
Expand Down
2 changes: 1 addition & 1 deletion src/promptflow-devkit/promptflow/_cli/_pf/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _prepare_app_for_foreground_service(port, force_start):
app.logger.setLevel(logging.DEBUG)
else:
app.logger.setLevel(logging.INFO)
message = f"Starting prompt flow Service on {port}, version: {get_pfs_version()}."
message = f"Starting prompt flow Service on port {port}, version: {get_pfs_version()}."
app.logger.info(message)
print(message)
return port
Expand Down

0 comments on commit aec51a0

Please sign in to comment.