cmd

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 35 Imported by: 2

Documentation

Overview

Copyright The KCL Authors. All rights reserved.

Copyright The KCL Authors. All rights reserved.

#### Language & Tooling Commands

``` kcl

	run           compile kcl package from a url or filepath
	build         build the kcl package (Not yet implemented)
	check         check the current package, but don't build target files (Not yet implemented)
	doc           documentation tool
	fmt           format tool
	lint          lint tool
	vet           vet tool
	test          unit/integration/benchmark test tool
 	deps          dependency analysis, providing dependency diagrams for KCL modules and packages (Not yet implemented)
 	server        run a KCL server to provider REST APIs for other applications
	clean         remove object files and cached files
	play          open the playground

```

#### Package & Registry Related Commands (mod and registry workspace)

``` kcl

mod init         initialize new module in current directory
mod search       search a command from registry
mod add          add new dependency
mod remove       remove dependency
mod update       update dependency
mod pkg          package a kcl package into tar
mod metadata     output the resolved dependencies of a package
mod push         push kcl package to OCI registry.
mod pull         pull kcl package from OCI registry.
registry login   login to a registry
registry logout  logout from a registry

```

#### Integration Commands

``` kcl

import     migration other data and schema to kcl e.g., openapi, jsonschema, json, yaml
export     convert kcl schema to other schema e.g., openapi (Not yet implemented)

```

#### Plugin Commands (Not yet implemented)

``` kcl

plugin install     install one or more kcl command plugins
plugin list        list installed command plugins
plugin uninstall   uninstall one or more command plugins
plugin update      update one or more command plugins

```

#### Version and Help Commands

``` kcl

help, h   Shows a list of commands or help for one command
version   Shows the command version

``` #### Alias

``` alias kcl="kcl run" alias kpm="kcl mod" ```

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModAdd added in v0.7.0

func ModAdd(cli *client.KpmClient, args []string) error

func ModGraph added in v0.8.0

func ModGraph(cli *client.KpmClient, args []string) error

func ModPush added in v0.7.0

func ModPush(cli *client.KpmClient, args []string) error

func ModUpdate added in v0.7.0

func ModUpdate(cli *client.KpmClient, args []string) error

func New

func New() *cobra.Command

New creates a new cobra client

func NewCleanCmd

func NewCleanCmd() *cobra.Command

NewCleanCmd returns the clean command.

func NewDocCmd

func NewDocCmd() *cobra.Command

NewDocCmd returns the doc command.

func NewDocGenerateCmd

func NewDocGenerateCmd() *cobra.Command

NewDocGenerateCmd returns the doc generate command.

func NewFmtCmd

func NewFmtCmd() *cobra.Command

NewFmtCmd returns the fmt command.

func NewImportCmd

func NewImportCmd() *cobra.Command

NewImportCmd returns the import command.

func NewLintCmd

func NewLintCmd() *cobra.Command

NewLintCmd returns the lint command.

func NewModAddCmd added in v0.7.0

func NewModAddCmd(cli *client.KpmClient) *cobra.Command

NewModAddCmd returns the mod add command.

func NewModCmd

func NewModCmd() *cobra.Command

NewModCmd returns the mod command.

func NewModGraphCmd added in v0.8.0

func NewModGraphCmd(cli *client.KpmClient) *cobra.Command

NewModGraphCmd returns the mod graph command.

func NewModInitCmd added in v0.7.0

func NewModInitCmd(cli *client.KpmClient) *cobra.Command

NewModInitCmd returns the mod init command.

func NewModMetadataCmd added in v0.7.0

func NewModMetadataCmd(cli *client.KpmClient) *cobra.Command

NewModMetadataCmd returns the mod metadata command.

func NewModPkgCmd added in v0.7.0

func NewModPkgCmd(cli *client.KpmClient) *cobra.Command

NewModPkgCmd returns the mod pkg command.

func NewModPullCmd added in v0.7.0

func NewModPullCmd(cli *client.KpmClient) *cobra.Command

NewModPullCmd returns the mod pull command.

func NewModPushCmd added in v0.7.0

func NewModPushCmd(cli *client.KpmClient) *cobra.Command

NewModPushCmd returns the mod push command.

func NewModUpdateCmd added in v0.7.0

func NewModUpdateCmd(cli *client.KpmClient) *cobra.Command

NewModUpdateCmd returns the mod update command.

func NewRegistryCmd

func NewRegistryCmd() *cobra.Command

NewModCmd returns the mod command.

func NewRegistryLoginCmd added in v0.7.0

func NewRegistryLoginCmd(cli *client.KpmClient) *cobra.Command

NewRegistryLoginCmd returns the registry login command.

func NewRegistryLogoutCmd added in v0.7.0

func NewRegistryLogoutCmd(cli *client.KpmClient) *cobra.Command

NewRegistryLogoutCmd returns the registry logout command.

func NewRunCmd

func NewRunCmd() *cobra.Command

NewRunCmd returns the run command.

func NewServerCmd added in v0.7.0

func NewServerCmd() *cobra.Command

NewServerCmd returns the server command.

func NewTestCmd added in v0.7.0

func NewTestCmd() *cobra.Command

NewTestCmd returns the test command.

func NewVersionCmd

func NewVersionCmd() *cobra.Command

NewVersionCmd returns the version command.

func NewVetCmd

func NewVetCmd() *cobra.Command

NewVetCmd returns the vet command.

func NewWithName added in v0.10.0

func NewWithName(name string) *cobra.Command

NewWithName creates a new KCL CLI with the name

func NewWithNameAndCommands added in v0.11.2

func NewWithNameAndCommands(name string, commands []*cobra.Command) *cobra.Command

NewWithNameAndCommands creates a new KCL CLI with the specified name and additional commands.

func ParseSourceFromArgs added in v0.11.0

func ParseSourceFromArgs(cli *client.KpmClient, args []string) (*downloader.Source, error)

func ParseUrlFromArgs added in v0.9.0

func ParseUrlFromArgs(cli *client.KpmClient, args []string) (*url.URL, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL