CLI workspaces
#
WorkspacesAll workspace commands are available via the workspace
sub-commands of hf
.
Execute hf workspace --help
to see the list of available sub-commands.
#
ListingTo list workspaces, execute hf workspace list
.
The --sets
option can be used to display the datasets used by each workspace.
Execute hf workspace list --help
to see the list of available options.
#
CreationTo create a new workspace, execute hf workspace create <name of the workspace>
.
The --sets [dataset id[,id]]
can be used to link datasets to the new workspace.
#
DeletionTo delete a workspace, execute hf workspace --id <id of the workspace> delete
.
#
Import and exportA workspace can be exported and imported using any format supported by Studio as documented in the intents section.
For third-party integrations, refer to their respective documentation: DialogFlow CX, DialogFlow ES, Rasa.
#
Workspace formatsShorthand name | Description |
---|---|
json | HumanFirst JSON format |
cognigy_json | Cognigy intent JSON format |
csv | Simple intent CSV format |
#
ImportIn order to import a workspace file, the workspace needs to exist first.
You can create a workspace using the create
(ex: hf workspace create my-workspace-name
) command.
To import a workspace, execute hf workspace --id <id of the workspace> import [--format format] <filename>
.
You can use the --clear
option to clear the objects in the workspace before importing.
The --hierarchical-delimiter
option can be used to specify the delimiter used to separate the intent name from the intent parent name
for formats that don't support a hierarchy (ex: csv).
#
ExportTo export a workspace, execute hf workspace --id <id of the workspace> export [--format format] <filename>
.
The --hierarchical-delimiter
option can be used to specify the delimiter used to separate the intent name from the intent parent name
for formats that don't support a hierarchy (ex: csv).
#
DataThe data
sub-command is used to manage the datasets linked to a workspace.
Refer to the data management section for more information on datasets.
#
Linking & unlinking datasetsTo link a dataset to a workspace, execute hf workspace --workspace <id of the workspace> data link <id of the dataset>
and hf workspace --workspace <id of the workspace> data unlink <id of the dataset>
to unlink it.
#
List linked datasetsTo list the datasets linked to a workspace, execute hf --workspace <id of the workspace> data list
.
#
Managing filesFiles can be managed using the data management sub-command, but it is also possible to list and import files of a workspace from the workspace sub-command.
To list files available from a workspace, execute hf workspace --id <id of the workspace> data list-files
.
To import a file into a workspace, execute hf workspace --workspace <id of the workspace> data import [--format format] <filename>
.
Refer to the file formats documentation for available formats.
The file content needs to be encoded in UTF-8 and can be passed via filename or stdin.