| Crates.io | daikokucli |
| lib.rs | daikokucli |
| version | 1.0.0 |
| created_at | 2024-03-27 09:48:30.580975+00 |
| updated_at | 2024-03-27 10:01:40.977018+00 |
| description | A CLI to create and build WASM binaries |
| homepage | https://github.com/MAIF/daikoku/tree/cli |
| repository | https://github.com/MAIF/daikoku/tree/cli |
| max_upload_size | |
| id | 1187714 |
| size | 485,453 |
daikokucli
This project can be installed and compiled from source with this Cargo command:
$ cargo install daikokucli
or
$ brew tap maif/daikokucli
$ brew install daikokucli
Additionally there are precompiled artifacts built on CI which are available for download as well.
Installation can be confirmed with:
$ daikokucli version
Subcommands can be explored with:
$ daikokucli help
Daikokucli uses your home folder to store the list of projects inside a .daikoku file. Each project created with the CLI should contain a src folder and a .daikoku/.environments. This file will contain
You can start a new project
daikokucli create --name=<PROJECT_NAME> --path=<PROJECT_PATH_OR_CURRENT_FOLDER>
then add a default Daikoku environment
daikokucli environments add --name=<ENVIRONMENT_NAME> --server=<ENVIROMNENT_SERVER>
The Daikoku server has to be reachable and will be checked before saving the configuration
you can start to develop and watch file changes
daikokucli watch
Common practices involve utilizing the directives within the Daikoku CMS to access private entities based on the connected user's permissions. You have the option to configure the token for accessing your CMS with an authenticated user by pasting the token from your Daikoku profile page.
daikokucli login --token=<YOUR_TOKEN>
If you have many environments you can switch between us simply using
daikokucli watch --environment=<NAME_OF_YOUR_ENVIRONMENT>
or permanently by changing the default project or environment
daikokucli environments default --name=<NAME_OF_YOUR_ENVIRONMENT>
daikokucli projects default --name=<NAME_OF_YOUR_PROJECT>
you can view the currently used project and the others
daikokucli projects list
At anytime, you can track an existing CMS folder or update its information
daikokucli projects add --name=<NAME_OF_YOUR_PROJECT> --path=<PATH_TO_YOUR_PROJECT> --overwrite=<true|false>
Once ready, you can synchronize your sources with the Daikoku environment
daikokucli sync
If you already have a legacy CMS on your Daikoku, you can start by importing it
daikokucli projects import --name=<NEW_NAME_OF_YOUR_PROJECT> \
--path=<PATH_TO_THE_NEW_PROJECT> \
--server=<DAIKOKU_SERVER_TO_PULL> \
--token=<AUTHENTICATION_TOKEN>
You can manage your images, diagrams, or any type of files directly by creating a /assets folder inside your CMS project.
Each asset is save in the S3 of your Daikoku using the following command
daikokucli assets add --filename=<ASSET_FILENAME> \
--path=<ONLY_NESTED_FOLDER_BEHIND_ASSETS_FOLDER> \
--desc=<ASSET_DESCRIPTION> \
--title=<ASSET_TITLE>
--slug=<ASSET_SLUG>
If you require a particular slug for your asset, you have the option to replace the automatically generated one by specifying the slug field. Additionally, you can exclude the path field, which is only necessary when creating an asset from a subfolder within the assets directory.
To delete your asset you have to give the filename and the slug iif it differs
daikokucli assets remove --slug=<CUSTOM_SLUG> --filename=<ASSET_FILENAME>
As others commands, you can display all registered assets
daikokucli assets list
If you prefer to synchronize all assets with a single command, it offers speed advantages over doing so individually, albeit with reduced configurability.
daikokucli assets sync
Just before running the daikoku login command, you have to configure your tenant by adding the CLI server. By default, the server is set to http://localhost:3334 but you can overwrite it using the WATCHING_PORT environment variable.
daikokucli login
parameters:
{{#daikoku-user "{{userId}}"}}
<div>
<span>{{user.name}}</span>
<img src="{{user.picture}}" />
</div>
{{/daikoku-user}}
parameters
{{#daikoku-owned-apis visibility="Private"}}
<span>Mon api : {{api.name}}</span>
{{/daikoku-owned-apis}}
parameters:
{{#daikoku-owned-api "{{apiId}}" version="1.0.0"}}
<span>Mon api : {{api.name}}</span>
{{/daikoku-owned-api}}
parameters:
{{#daikoku-json-owned-apis visibility="Private"}}
{{/daikoku-json-owned-apis}}
parameters:
{{#daikoku-json-owned-api "{{apiId}}" version="1.0.0"}}
{{/daikoku-json-owned-api}}
{{#daikoku-owned-teams}}
<span>Ma team : {{team.name}}
{{/daikoku-owned-teams}}
parameters:
{{#daikoku-owned-team "{{teamId}}"}}
<span>Mon team : {{team.name}}</span>
{{/daikoku-owned-team}}
{{daikoku-json-owned-teams}}
parameters:
{{#daikoku-json-owned-team "{{teamId}}"}}
{{/daikoku-json-owned-team}}
{{tenant.name}} - {{tenant.style.description}}
{{is_admin}}
{{connected}}
When you have an user returned from directive, you can use the following fields
nameemail_id_humandReadableIdpictureisDaikokuAdminstarredApis<div>
{{user.name}} - {{user.email}}
</div>
<div>
{{request.path}} - {{request.method}} - {{request.headers}}
</div>
<div>
{{daikoku-css}}
</div>
parameters:
{{#for '{{team.users}}' field='myuser' }}
{{myuser.userId}}
{{/for}}
{{size '{{team.users}}'}}
{{#ifeq "{{plan.type}}" "FreeWithoutQuotas"}}
You'll pay nothing and do whatever you want
{{/ifeq}}
{{#ifnoteq "{{plan.type}}" "FreeWithoutQuotas"}}
You'll pay nothing and do whatever you want
{{/ifnoteq}}
{{getOrElse "{{plan.customName}}" "Un plan"}}
{{translate 'Logout'}}
parameters:
{{daikoku-path-param '0'}}
parameters:
{{daikoku-query-param 'my-query-param'}}
parameters:
{{#daikoku-template-wrapper '<wrapper-id>' <named-parameter>="<value>" }}
{{/daikoku-template-wrapper}}"
{{#daikoku-apis}}
<span>Api : {{api.name}}</span>
{{/daikoku-apis}}
parameters:
{{#daikoku-api "{{apiId}}" version="1.0.0"}}
<span>Mon api : {{api.name}}</span>
{{/daikoku-api}}"
{{daikoku-json-apis}}
parameters:
{{#daikoku-json-api "{{apiId}}" version="1.0.0"}}
{{/daikoku-json-api}}
{{#daikoku-teams}}
<span>Team : {{team.name}}</span>
{{/daikoku-teams}}
parameters:
{{#daikoku-team "{{<teamId>}}"}}
<span>My team : {{team.name}}</span>
{{/daikoku-team}}
{{daikoku-json-teams}}
parameters:
{{#daikoku-json-team "{{<teamId>}}"}}
{{/daikoku-json-team}}
parameters:
{{#daikoku-documentations "{{<apiId>}}"}}
<span>{{documentation.title}}</span>
{{/daikoku-documentations}}
parameters:
{{#daikoku-documentations-page "<apiId>" page="<pageId>"}}
{{documentation.content}}
{{/daikoku-documentations-page}}
parameters:
{{#daikoku-documentations-page-id "<apiId>" page="<pageId>"}}
{{content}}
{{/daikoku-documentations-page-id}}"
parameters:
{{#daikoku-plans "<apiId>"}}
<span>{{plan.type}}</span>
{{/daikoku-plans}}
This project is licensed under the Apache 2.0 license with the LLVM exception.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.