|
1 | | -# probely_cli |
| 1 | +# probely |
2 | 2 |
|
3 | | -## So far this is more like |
| 3 | +### Package level api key setup: |
4 | 4 |
|
5 | | -Generate docs: |
| 5 | +* Config File: |
| 6 | + Create `~/.probely/config` and add: |
6 | 7 |
|
7 | | -* go to docs/ |
8 | | -* make clean |
9 | | -* make markdown |
| 8 | + ``` |
| 9 | + [AUTH] |
| 10 | + api_key = <your_api_key> |
| 11 | + ``` |
| 12 | + |
| 13 | +* Environment Variables |
| 14 | + ``` |
| 15 | + export PROBELY_API_BASE_URL=<your_api_key> |
| 16 | + ``` |
| 17 | +* Tool specific config (see below) |
| 18 | + |
| 19 | +## CLI |
| 20 | + |
| 21 | +### Usage |
| 22 | + |
| 23 | +* Use `-h/--help` for available options |
| 24 | +* General usage |
| 25 | + `Probely <context> <action> [positional_params ...] [--optinal params ...] -- [positional_params ...]` |
| 26 | + * `--` allows you to add positional args after optional |
| 27 | +* add `--api-key` for command specific api key |
| 28 | + |
| 29 | +## SDK |
| 30 | + |
| 31 | +* Init `Probely` for specific config |
| 32 | + ``` |
| 33 | + from probely_cli import Probely |
| 34 | +
|
| 35 | + Probely.init(api_key=<your_api_key>) |
| 36 | + |
| 37 | + ... |
| 38 | + ``` |
| 39 | +* Import `probely_cli` for public interface |
| 40 | + |
| 41 | + ``` |
| 42 | + import probely_cli |
| 43 | +
|
| 44 | + target = probely_cli.add_target("http://target_url.com") |
| 45 | + ``` |
10 | 46 |
|
11 | 47 | ### Development guidelines: |
12 | 48 |
|
13 | 49 | * Command structure: `Probely <context> <action> params [--optinal params]` |
14 | | -* Follow CLI output good practices. Valid output to `stdout`, erros to `stderr` |
15 | | -* Check list every step of the MR template(todo) |
16 | | - * Tests |
17 | | - * Docs |
18 | | - * Multiple version CI |
| 50 | +* Follow CLI output good practices. Valid output to `stdout`, errors to `stderr` |
19 | 51 | * Custom tooling, developers should be aware |
20 | | - * `probely_cli` fixture (to test CLI OUTPUT) |
21 | 52 | * `rich.console` is always available on the `args` |
| 53 | + * `probely_cli` fixture (to test CLI OUTPUT) |
22 | 54 | * Error message should have the following structure: `{cmd}: error: {message}`, |
23 | 55 | following the default implementation of argparse |
24 | 56 | * eg: `probely targets get: error: filters and target ids are mutually exclusive.` |
25 | | - * TBD how to handle json errors list |
26 | | - |
27 | | -### Usage tips: |
28 | 57 |
|
29 | | -* When using multiple values optional arguments you can use `--` to indicate that next |
30 | | - values are positional arguments |
|
0 commit comments