|
1 | | -# hawaii-cli |
2 | | -CLi tool for hawaii |
3 | | -Language: C# |
4 | | -Framework: dotnet 6.0 |
| 1 | +# Hawaii CLI |
5 | 2 |
|
6 | | -**Below are the steps to install the tool in your local machine** |
| 3 | +Command line tool for Hawaii development workflows built on |
| 4 | +C# |
7 | 5 |
|
8 | | -1. To update the cli tool trigger name from hawaii to anyother, goto csProj file and update the ToolCommandName accordingly: |
9 | | -``` |
10 | | -<PackAsTool>true</PackAsTool> |
11 | | -<ToolCommandName>hawaii</ToolCommandName> |
12 | | -<PackageOutputPath>./nupkg</PackageOutputPath> |
13 | | -``` |
14 | | - |
15 | | -2. goto your project directory and pack it up. |
16 | | -``` |
17 | | -dotnet pack |
18 | | -``` |
19 | | - |
20 | | -3. Install the tool |
21 | | -``` |
22 | | -dotnet tool install --global --add-source ./nupkg hawaii-cli |
23 | | -``` |
| 6 | + - Helpful commands to improve your workflows |
| 7 | + 1.Initialize the configuration. |
| 8 | + 2.Add new Entities. |
| 9 | + 3.Update Entity Details |
| 10 | + 4.Add/Update relationship between entities. |
24 | 11 |
|
25 | | -4. after making new changes. do the below steps |
26 | | -a) update the version in *csproj: |
27 | | -``` |
28 | | - <PropertyGroup> |
29 | | - <Version>2.0.0</Version> |
30 | | - </PropertyGroup> |
31 | | -``` |
32 | | -b) pack the project : `dotnet pack` |
33 | | - |
34 | | -c) update the installed tool: |
35 | | -``` |
36 | | -dotnet tool update -g --add-source ./nupkg hawaii-cli --version 2.0.0 |
37 | | -``` |
| 12 | + - Let the user to run locally in any environment |
| 13 | + |
| 14 | +## Install |
| 15 | +You can install the CLI using `yarn` by running the following command. This will add the `graphql` binary to your path. |
38 | 16 |
|
39 | | -NOTE |
40 | | -ISSUE: If you see any error while while installing the tool due to some class not found. |
41 | | -FIX: the gql-engine(hawaii-gql) is probably not linked properly. |
42 | | -Please update the correct path in .csproj file. |
43 | | -``` |
44 | | -<ItemGroup> |
45 | | - <Reference Include="Azure.DataGateway.Config"> |
46 | | - <HintPath>..\hawaii-gql\DataGateway.Config\bin\Debug\net6.0\Azure.DataGateway.Config.dll</HintPath> |
47 | | - </Reference> |
48 | | -</ItemGroup> |
| 17 | +```sh |
| 18 | +yarn global add graphql-cli |
49 | 19 | ``` |
50 | 20 |
|
51 | | -TO SHARE THE CHANGES: |
52 | | -1) Once you create the package (dotnet pack). It's ready to be shared. |
53 | | -2) Share the latest package (.nupkg file). |
54 | | -3) To install: `dotnet tool install -g --add-source ./ hawaii-cli --version <<version_number>>` |
| 21 | +The equivalent npm global install will also work. |
55 | 22 |
|
56 | 23 |
|
| 24 | +## Usage / Initialization |
57 | 25 |
|
58 | | -**To generate the config:** |
| 26 | +### Generate the config: |
59 | 27 | ``` |
60 | 28 | hawaii init -name <<filename>> --database_type <<db_type>> --connection_string <<connection_string>> |
61 | 29 | ``` |
62 | | -**To add entity to the config:** |
| 30 | +### Add entity to the config: |
63 | 31 | ``` |
64 | 32 | hawaii add <<entity>> -source <<source.DB>> --rest <<rest_route>> --graphql <<graphql_type>> --permission <<rules:actions>> |
65 | 33 | ``` |
66 | | -**To update entity to the config:** |
| 34 | +### Update entity to the config: |
67 | 35 | ``` |
68 | 36 | hawaii update <<entity>> -source <<new_source.DB>> --rest <<new_rest_route>> --graphql <<new_graphql_type>> --permissions <<rules:actions>> --fields.include <<fields to include>> --fields.exclude <<fields to exclude>> |
69 | 37 | ``` |
70 | 38 |
|
71 | | - |
72 | | - |
73 | | -**example:** |
| 39 | +## Example |
74 | 40 | ``` |
75 | 41 | hawaii init -n todo-001 --database_type "mysql" --connection_string "localhost:8000" |
76 | 42 | ``` |
@@ -106,3 +72,6 @@ hawaii update todo --name todo-005 --relationship owner --target.entity user --c |
106 | 72 | |
107 | 73 | ``` |
108 | 74 |
|
| 75 | +## Contributing |
| 76 | + |
| 77 | +Please read through the [contributing guidelines](./CONTRIBUTING.md) |
0 commit comments