-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from jovotech/v4/dev
🔖 Release
- Loading branch information
Showing
90 changed files
with
27,349 additions
and
6,006 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,77 @@ | ||
--- | ||
title: 'CLI' | ||
excerpt: 'Learn more about the Jovo CLI.' | ||
--- | ||
# Jovo CLI | ||
|
||
> To view this page on the Jovo website, visit https://www.jovo.tech/marketplace/jovo-cli | ||
The Jovo CLI (GitHub Repository: [jovotech/jovo-cli](https://github.com/jovotech/jovo-cli)) is the center of voice app development with the Jovo Framework. With it, you can quickly create new Jovo projects, create language models and deploy them to the voice platforms, and run your voice apps locally for easy prototyping and testing. | ||
Learn more about the Jovo CLI, the command line interface that lets you create new Jovo projects, run them locally, and deploy them to various platforms. | ||
|
||
:exclamation: If you don't have access to any of these repositories, please contact ruben@jovo.tech. :exclamation: | ||
## Introduction | ||
|
||
- [Jovo Filebuilder](https://github.com/rubenaeg/filebuilder) | ||
- [Template](https://github.com/rubenaeg/jovo-template-dev) | ||
- [Jovo CLI](https://github.com/rubenaeg/jovo-cli) | ||
- [Jovo Framework](https://github.com/rubenaeg/jovo-framework) | ||
The Jovo CLI allows you to speed up the development process of voice and chat apps with the Jovo Framework. Both single developers as well as teams use the CLI to develop and test Jovo apps more efficiently.s | ||
|
||
--- | ||
With the Jovo CLI, you can do many things, including: | ||
|
||
- [Development Setup](#development-setup) | ||
- [Install the Jovo Filebuilder](äinstall-the-jovo-filebuilder) | ||
- [Download the template for `jovo new`](#download-the-template-for-jovo-new) | ||
- [Install the Jovo CLI](#install-the-jovo-cli) | ||
- [Setup Platform CLI Plugins from the Jovo Framework](#setup-platform-cli-plugins-from-the-jovo-framework) | ||
- [Usage](#usage) | ||
- [Troubleshooting](#troubleshooting) | ||
- Create new Jovo projects with the [`new` command](https://v4.jovo.tech/docs/new-command) | ||
- Develop Jovo apps locally using the [`run` command](https://v4.jovo.tech/docs/run-command) | ||
- [`build`](https://v4.jovo.tech/docs/build-command) and [`deploy`](https://v4.jovo.tech/docs/deploy-command) projects to various platforms and services | ||
- [Extend the CLI](#extend-the-jovo-cli) with your own custom hooks and plugins | ||
|
||
## Development Setup | ||
Learn how to install the Jovo CLI in the [installation](#installation) section. In the [configuration](#configuration) section, we'll take a look at configurations and plugins that can be added to the CLI. | ||
|
||
To configure the Jovo CLI for development, you'll need to complete a few steps before actually installing the CLI itself. | ||
After that, we'll take a look at all [CLI commands](#commands) and ways to [extend the Jovo CLI](#extend-the-jovo-cli). | ||
|
||
### Install the Jovo Filebuilder | ||
## Installation | ||
|
||
Since the Jovo Filebuilder is not yet registered on NPM, you have to install and link it by yourself. | ||
You can install the new Jovo CLI like this: | ||
|
||
```sh | ||
# Clone the Jovo Filebuilder | ||
# with SSH. | ||
$ git clone git@github.com:rubenaeg/filebuilder.git | ||
# with HTTPS. | ||
$ git clone https://github.com/rubenaeg/filebuilder.git | ||
# with the GitHub CLI. | ||
$ gh repo clone rubenaeg/filebuilder | ||
|
||
# Switch directories. | ||
$ cd filebuilder/ | ||
|
||
# Run the NPM script devSetup, which will install dependencies, compile TypeScript and link the package, so it is available globally on your machine. | ||
$ npm run setup:dev | ||
$ npm install -g @jovotech/cli | ||
``` | ||
|
||
### Download the template for `jovo new` | ||
|
||
`jovo new` currently uses a template folder to create new projects from. If you run `jovo new`, it's important that your working directory is the parent directory of the template repo, otherwise the CLI won't find the folder, resulting in an error. | ||
After successful installation, you should be able to see the Jovo CLI menu by typing the following into your command line: | ||
|
||
```sh | ||
# Clone the template | ||
# with SSH. | ||
$ git clone git@github.com:rubenaeg/jovo-template-dev.git | ||
# with HTTPS. | ||
$ git clone https://github.com/rubenaeg/jovo-template-dev.git | ||
# with the GitHub CLI. | ||
$ gh repo clone rubenaeg/jovo-template-dev | ||
$ jovov4 -v | ||
``` | ||
|
||
### Install the Jovo CLI | ||
**A note on versions:** For Jovo `v4`, we're moving to [organization scoped packages](https://docs.npmjs.com/creating-and-publishing-an-organization-scoped-package). Instead of e.g. `jovo-cli`, you are now installing `@jovotech/cli`. This is especially helpful for the beta phase: You will still be able to use the `jovo-cli` package with the CLI name `jovo` in parallel with the `@jovotech/cli` package and the CLI name `jovov4`. | ||
|
||
Now that you completed all prerequisites, you can go on and install the Jovo CLI. | ||
## Configuration | ||
|
||
```sh | ||
# Clone the Jovo CLI | ||
# with SSH. | ||
$ git clone git@github.com:rubenaeg/jovo-cli.git | ||
# with HTTPS. | ||
$ git clone https://github.com/rubenaeg/jovo-cli.git | ||
# with the GitHub CLI. | ||
$ gh repo clone rubenaeg/jovo-cli | ||
|
||
# Switch directories. | ||
$ cd jovo-cli/ | ||
|
||
# Switch branch to v4. | ||
$ git checkout v4 | ||
|
||
# Run the NPM script setup:dev, which will install dependencies, compile TypeScript and link all necessary packages. | ||
$ npm run setup:dev | ||
``` | ||
You can configure the Jovo CLI and its plugins in the `jovo.project.js` file in the root of a Jovo project: | ||
|
||
### Setup Platform CLI Plugins from the Jovo Framework | ||
```js | ||
const { ProjectConfig } = require('@jovotech/cli-core'); | ||
|
||
With v4 of the Jovo CLI, CLI plugins (e.g. for platforms such as Amazon Alexa) sit in their respective folder inside the Jovo Framework. So, to use those plugins, you'll need to download the Jovo Framework and set them up for local use. | ||
// ... | ||
|
||
```sh | ||
# Clone the Jovo Framework | ||
# with SSH. | ||
$ git clone git@github.com:rubenaeg/jovo-framework.git | ||
# with HTTPS. | ||
$ git clone https://github.com/rubenaeg/jovo-framework.git | ||
# with the GitHub CLI. | ||
$ gh repo clone rubenaeg/jovo-framework | ||
|
||
# Switch directories. | ||
$ cd jovo-framework | ||
|
||
# Switch the current branch. | ||
$ git checkout v4dev | ||
|
||
# Run the NPM script setup:dev, which will install dependencies, compile TypeScript and link all necessary packages. | ||
$ npm run setup:dev | ||
const project = new ProjectConfig({ | ||
endpoint: '${JOVO_WEBHOOK_URL}', | ||
plugins: [ | ||
// Add Jovo CLI plugins here | ||
], | ||
}); | ||
``` | ||
|
||
## Usage | ||
[Learn more in the project configuration documentation](https://v4.jovo.tech/docs/project-config). | ||
|
||
## Commands | ||
|
||
Learn more about the Jovo CLI commands: | ||
|
||
- [`new`](https://v4.jovo.tech/docs/new-command): Create a new Jovo project | ||
- [`run`](https://v4.jovo.tech/docs/run-command): Start the local development server | ||
- [`build`](https://v4.jovo.tech/docs/build-command): Create platform-specific project files | ||
- [`deploy`](https://v4.jovo.tech/docs/deplooy-command): Deploy to various platforms and services | ||
- [`get`](https://v4.jovo.tech/docs/get-command): Sync your local files with platform files | ||
|
||
Once you installed everything, run `jovodev` to confirm everything is working. The output should look similar to this: | ||
|
||
![Output](./img/jovodev.png) | ||
## Extend the Jovo CLI | ||
|
||
If you want help with any command, just type `jovodev {COMMAND} --help`. | ||
There are many use cases where it could make sense to customize the Jovo CLI to fit your workflow. For example, it could be necessary to call an API to get some external data that is relevant for the language model in the `build` process. Or you might want to build your own deployment integration. | ||
|
||
## Troubleshooting | ||
There are two ways how you ca extend the Jovo CLI: | ||
|
||
If the CLI reports that it can't find a command, try deleting your `~/.jovo/config`, as the new Jovo CLI comes with some updates to the configuration structure. | ||
- [CLI hooks](https://v4.jovo.tech/docs/project-config#hooks): Hook into existing CLI commands. For example, call an API and retrieve data as part of the `build` command. | ||
- [CLI plugins](https://v4.jovo.tech/docs/cli-plugins): Create your own plugins that could hook into commands, or even create commands on their own. |
Oops, something went wrong.