Skip to content

Commit

Permalink
Add CLI doc
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvogel committed Feb 12, 2025
1 parent f7ad35e commit 40b0a3e
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ A profile contains server URL, type, credentials (token or username/password) an

- [Overview](#overview)
- [Installation](#installation)
- [SW Documentation](#sw-documentation)
- [Usage](#usage)
- [Flags](#flags)
- [Commands](#commands)
- [Examples](#examples)- [SW Documentation](#sw-documentation)
- [Used Libraries](#used-libraries)
- [Issues, Ideas And Bugs](#issues-ideas-and-bugs)
- [License](#license)
Expand All @@ -29,6 +32,26 @@ cd pyProfileMgr
pip install .
```

## Usage

```cmd
pyProfileMgr [-h] [--version] [-v] {command} ...
```

### Flags

| Flag | Description |
| :-----------: | ----------------------------------------------------------------------------------------------- |
| --help , -h | Show the help message and exit. |
| --version | Show version information and exit. |
| --verbose , -v | Print full command details before executing the command. Enables logs of type INFO and WARNING. |

## Commands

| Command | Description |
| :-----------------------------------------: | --------------------------------------------------- |
|[profile](./doc/commands/profile.md) | Add, list, delete or update server profiles. |

## SW Documentation

More information on the deployment and architecture can be found in the [documentation](./doc/README.md)
Expand Down
51 changes: 51 additions & 0 deletions doc/commands/profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Profile

Add, delete, update or list profiles.

A profile contains the following data:

* name: A unique name by which the profile can be referenced. The name is not stored in the data files, but identifies the folder. (required)
* type: The type of the profile. Allowed values are 'jira', 'polarion' and 'superset', currently. (required)
* server: The URL to the server. (required)
* token: An API token to allow for easier access. (optional)
* user/password: The credentials to authenticate with the server in case no token is given. (optional)
* certificate: A certificate for the specified server instance. (optional)

When adding a profile, the server URL and token (or user/password) are required.
The certificate is optional and can also be added later on with the --update option.

```cmd
pyProfileMgr profile [-h] {add,list,remove,update} ...
```

Output:

```cmd
usage: pyProfileMgr profile add [-h] -pt <profile type> -s <server URL> [-t <token>] [-u <user>] [-p <password>] [--cert <certificate path>] <profile name>
positional arguments:
<profile name> The name of the profile.
options:
-h, --help show this help message and exit
-pt <profile type>, --profile_type <profile type>
The type of the profile ('jira', 'polarion' or 'superset').
-s <server URL>, --server <server URL>
The server URL to connect to.
-t <token>, --token <token>
The token to authenticate at the server.
-u <user>, --user <user>
The user to authenticate at the server.
-p <password>, --password <password>
The password to authenticate at the server.
--cert <certificate path>
The server SSL certificate.
```

Example:

```cmd
pyProfileMgr profile add -pt jira -s https://jira-instance.com -t exampleToken --cert C:\\Path\\To\\Certificate.crt testProfileName
```

This will create a new Jira profile with the name "testProfileName".

0 comments on commit 40b0a3e

Please sign in to comment.