From 9a58ae3d1b36224325e79e219d992293f7fb6ab8 Mon Sep 17 00:00:00 2001 From: monoxgas Date: Tue, 21 Jan 2025 10:06:45 -0700 Subject: [PATCH 1/4] Add CLI docs generation to pre-commit --- .pre-commit-config.yaml | 12 ++++++ CLI.md | 95 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 96 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcad1b5..d9feb6f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,3 +12,15 @@ repos: hooks: - id: actionlint name: Check Github Actions + + - repo: local + hooks: + + # Generate CLI docs + - id: generate-cli-docs + name: Generate CLI Documentation + entry: poetry run typer dreadnode_cli/__main__.py utils docs --name dreadnode --output CLI.md --title "CLI Commands" + language: system + pass_filenames: false + files: ^dreadnode_cli/.*\.py$ + always_run: true diff --git a/CLI.md b/CLI.md index be24319..508037c 100644 --- a/CLI.md +++ b/CLI.md @@ -1,4 +1,4 @@ -# `dreadnode` +# CLI Commands Interact with the Dreadnode platform @@ -10,8 +10,6 @@ $ dreadnode [OPTIONS] COMMAND [ARGS]... **Options**: -* `--install-completion`: Install completion for the current shell. -* `--show-completion`: Show completion for the current shell, to copy it or customize the installation. * `--help`: Show this message and exit. **Commands**: @@ -19,6 +17,7 @@ $ dreadnode [OPTIONS] COMMAND [ARGS]... * `agent`: Interact with Strike agents * `challenge`: Interact with Crucible challenges * `login`: Authenticate to the platform. +* `model`: Manage user-defined inference models * `profile`: Manage server profiles * `refresh`: Refresh data for the active server profile. * `version`: Show versions and exit. @@ -50,7 +49,7 @@ $ dreadnode agent [OPTIONS] COMMAND [ARGS]... * `show`: Show the status of the active agent * `strikes`: List available strikes * `switch`: Switch to a different agent link -* `templates`: Interact with Strike templates +* `templates`: Manage Agent templates * `versions`: List historical versions of the active agent ### `dreadnode agent clone` @@ -256,7 +255,7 @@ $ dreadnode agent switch [OPTIONS] AGENT_OR_PROFILE [DIRECTORY] ### `dreadnode agent templates` -Interact with Strike templates +Manage Agent templates **Usage**: @@ -271,7 +270,7 @@ $ dreadnode agent templates [OPTIONS] COMMAND [ARGS]... **Commands**: * `install`: Install a template pack -* `show`: List available agent templates with their... +* `show|list`: List available agent templates with their... #### `dreadnode agent templates install` @@ -291,14 +290,14 @@ $ dreadnode agent templates install [OPTIONS] [SOURCE] * `--help`: Show this message and exit. -#### `dreadnode agent templates show` +#### `dreadnode agent templates show|list` List available agent templates with their descriptions **Usage**: ```console -$ dreadnode agent templates show [OPTIONS] +$ dreadnode agent templates show|list [OPTIONS] ``` **Options**: @@ -414,6 +413,80 @@ $ dreadnode login [OPTIONS] * `-p, --profile TEXT`: Profile alias to assign / update * `--help`: Show this message and exit. +## `dreadnode model` + +Manage user-defined inference models + +**Usage**: + +```console +$ dreadnode model [OPTIONS] COMMAND [ARGS]... +``` + +**Options**: + +* `--help`: Show this message and exit. + +**Commands**: + +* `add`: Add a new inference model +* `forget`: Remove an user inference model +* `show|list`: List all configured models + +### `dreadnode model add` + +Add a new inference model + +**Usage**: + +```console +$ dreadnode model add [OPTIONS] +``` + +**Options**: + +* `--id TEXT`: Identifier for referencing this model [required] +* `-g, --generator-id TEXT`: Rigging (LiteLLM) generator id [required] +* `-k, --api-key TEXT`: API key for the inference provider (supports $ENV_VAR syntax) [required] +* `-n, --name TEXT`: Friendly name +* `-p, --provider TEXT`: Provider name +* `-u, --update`: Update an existing model if it exists +* `--help`: Show this message and exit. + +If $ENV_VAR syntax is used for the api key, it will be replaced with the environment value when used. + +### `dreadnode model forget` + +Remove an user inference model + +**Usage**: + +```console +$ dreadnode model forget [OPTIONS] ID +``` + +**Arguments**: + +* `ID`: Model to remove [required] + +**Options**: + +* `--help`: Show this message and exit. + +### `dreadnode model show|list` + +List all configured models + +**Usage**: + +```console +$ dreadnode model show|list [OPTIONS] +``` + +**Options**: + +* `--help`: Show this message and exit. + ## `dreadnode profile` Manage server profiles @@ -431,7 +504,7 @@ $ dreadnode profile [OPTIONS] COMMAND [ARGS]... **Commands**: * `forget`: Remove a server profile -* `list`: List all server profiles +* `show|list`: List all server profiles * `switch`: Set the active server profile ### `dreadnode profile forget` @@ -452,14 +525,14 @@ $ dreadnode profile forget [OPTIONS] PROFILE * `--help`: Show this message and exit. -### `dreadnode profile list` +### `dreadnode profile show|list` List all server profiles **Usage**: ```console -$ dreadnode profile list [OPTIONS] +$ dreadnode profile show|list [OPTIONS] ``` **Options**: From 4742975fe214ee11d16c1471073acb27a804d268 Mon Sep 17 00:00:00 2001 From: monoxgas Date: Tue, 21 Jan 2025 15:12:35 -0700 Subject: [PATCH 2/4] Add mkdocs.yml --- mkdocs.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mkdocs.yml diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..d1e9199 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,12 @@ +site_name: Dreadnode CLI +site_description: Dreadnode CLI docs +site_author: Dreadnode +site_url: https://docs.dreadnode.io/cli +repo_url: https://github.com/dreadnode/cli +repo_name: dreadnode/cli + +docs_dir: . + +nav: + - cli/README.md + - Commands: cli/CLI.md \ No newline at end of file From ae36b5b9763d182c97712fd773326179a9aab58a Mon Sep 17 00:00:00 2001 From: monoxgas Date: Tue, 21 Jan 2025 15:13:29 -0700 Subject: [PATCH 3/4] Fixup nav --- mkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index d1e9199..78e7005 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,5 +8,5 @@ repo_name: dreadnode/cli docs_dir: . nav: - - cli/README.md - - Commands: cli/CLI.md \ No newline at end of file + - README.md + - Commands: CLI.md \ No newline at end of file From fa18e55f826e6c66e91880554243e41dc2e224f3 Mon Sep 17 00:00:00 2001 From: monoxgas Date: Tue, 21 Jan 2025 15:15:48 -0700 Subject: [PATCH 4/4] Remove mkdocs.yml --- mkdocs.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 mkdocs.yml diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 78e7005..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,12 +0,0 @@ -site_name: Dreadnode CLI -site_description: Dreadnode CLI docs -site_author: Dreadnode -site_url: https://docs.dreadnode.io/cli -repo_url: https://github.com/dreadnode/cli -repo_name: dreadnode/cli - -docs_dir: . - -nav: - - README.md - - Commands: CLI.md \ No newline at end of file