Skip to content

Commit

Permalink
feat: migrated CLI to commander; CLI improvments; README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbv committed Oct 6, 2024
1 parent 45abed1 commit 01d42fe
Show file tree
Hide file tree
Showing 17 changed files with 1,035 additions and 696 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Project seeks to eliminate the need of managing nodes dependencies and establish
## Setup

```bash
npm i -g cognigy-hammer
$ npm i -g cognigy-hammer

$ cognigy-hammer create scaffold
```

## Features
Expand All @@ -30,14 +32,21 @@ npm i -g cognigy-hammer
- Connections and Nodes are imported automatically.
- Helper function for setting the next node.

## CLI commands
## CLI overview

The following commands should be available after installing the package globally. If they are not, you may need to use `npm exec` / `npx`
```bash
ch.create-project # create a new extension project scaffold
ch.create-node # create a new node in an extension project
ch.delete-node # delete a node from an extension project
ch.create-connection # create a new connection in an extension project
Usage: cognigy-hammer [options] [command]

An extension development suite for CognigyAI.

Options:
-V, --version output the version number
-h, --help display help for command

Commands:
create <entity> Guided way to create a new entity.
delete <entity> Guided way to delete an existing entity.
help [command] display help for command
```

## Standard
Expand Down
Binary file modified demos/create-extension.demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
360 changes: 170 additions & 190 deletions demos/create-extension.demo.yml

Large diffs are not rendered by default.

Binary file modified demos/create-node.demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
368 changes: 261 additions & 107 deletions demos/create-node.demo.yml

Large diffs are not rendered by default.

Binary file modified demos/delete-node.demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
186 changes: 130 additions & 56 deletions demos/delete-node.demo.yml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "commonjs",
"name": "cognigy-hammer",
"description": "An extension development suite for CognigyAI.",
"version": "0.5.0",
"version": "0.6.0",
"license": "MIT",
"main": "./build/index.js",
"types": "./build/index.d.ts",
Expand All @@ -14,7 +14,13 @@
"type": "git",
"url": "https://github.com/tgbv/cognigy-hammer.git"
},
"keywords": ["cognigy", "ai", "extension", "development-suite", "cli"],
"keywords": [
"cognigy",
"ai",
"extension",
"development-suite",
"cli"
],
"files": [
"build",
"templates",
Expand All @@ -32,6 +38,7 @@
"create:node": "npx ts-node ./src/commands/create:node.ts",
"create:connection": "npx ts-node ./src/commands/create:connection.ts",
"delete:node": "npx ts-node ./src/commands/delete:node.ts",
"cw": "npx ts-node ./src/commands/commanderWrapper",
"transpile": "npx jest --coverage --passWithNoTests ./src && npx tsc",
"local:build": "npm run transpile && npm pack && npm i --global cognigy-hammer-*"
},
Expand All @@ -41,19 +48,22 @@
"ch.create-extension": "./build/commands/create:scaffold.js",
"ch.create-connection": "./build/commands/create:connection.js",
"ch.create-node": "./build/commands/create:node.js",
"ch.delete-node": "./build/commands/delete:node.js"
"ch.delete-node": "./build/commands/delete:node.js",
"cognigy-hammer": "./build/commands/commanderWrapper.js"
},
"devDependencies": {
"@types/commander": "^2.12.0",
"@types/jest": "^29.5.5",
"@types/node": "^20.8.6",
"@types/prompts": "^2.4.5",
"ts-jest": "^29.1.1"
},
"dependencies": {
"@cognigy/extension-tools": "^0.15.1",
"node-console-colors": "^1.1.5",
"commander": "^12.1.0",
"detect-ts-node": "^1.0.5",
"handlebars": "^4.7.8",
"node-console-colors": "^1.1.5",
"prompts": "^2.4.2"
}
}
Loading

0 comments on commit 01d42fe

Please sign in to comment.