Skip to content

Commit

Permalink
Merge branch 'master' of github.com:liquidweb/liquidweb-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jakdept committed Oct 13, 2023
2 parents c346f41 + d63ffe5 commit ea0acb4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# lw (liquidweb-cli)
# lw-cli (liquidweb-cli)
Official command line interface for the LiquidWeb API
```
CLI interface for LiquidWeb.
Expand All @@ -19,7 +19,7 @@ As always, consult the various subcommands for specific features and
capabilities.
Usage:
lw [command]
lw-cli [command]
Available Commands:
asset All things assets
Expand All @@ -36,23 +36,23 @@ Available Commands:
Flags:
--config string config file (default is $HOME/.liquidweb-cli.yaml)
-h, --help help for lw
-h, --help help for lw-cli`
--use-context string forces current context, without persisting the context change
Use "lw [command] --help" for more information about a command.
Use "lw-cli [command] --help" for more information about a command.
```
## Obtaining prebuilt binaries

Head on over to the [releases page](https://github.com/liquidweb/liquidweb-cli/releases) to get prebuilt binaries for your platform.

## Building from source

You can build lw from source by running `make build` from the root of this repository. The resulting program will be located at `./_exe/lw`.
You can also build+install lw onto your system in the ordinary `go install` way. To do this, either just run `go install` from the root of this repository,
You can build lw-cli from source by running `make build` from the root of this repository. The resulting program will be located at `./_exe/lw-cli`.
You can also build+install lw-cli onto your system in the ordinary `go install` way. To do this, either just run `go install` from the root of this repository,
or `make install`. If you run `make` with no arguments, this will be the default action.

## First Time Setup
The first time you use lw, you will need to setup an auth context. An auth context holds authentication related data for a specific LiquidWeb account. You can follow a guided questionnaire to add your auth contexts if you pass arguments `auth init` to lw. By default contexts are stored in `~/.liquidweb-cli.yaml` or `%APPDATA%/.liquidweb-cli.yaml` on Windows.
The first time you use lw-cli, you will need to setup an auth context. An auth context holds authentication related data for a specific LiquidWeb account. You can follow a guided questionnaire to add your auth contexts if you pass arguments `auth init` to lw-cli. By default contexts are stored in `~/.liquidweb-cli.yaml` or `%APPDATA%/.liquidweb-cli.yaml` on Windows.

## Adding auth contexts later
If you end up wanting to add an auth context later on, you can do so with `auth add-context`. You can find the usage documentation in `help auth add-context`.
Expand All @@ -76,7 +76,7 @@ For current commands supported via plans, take a look in the `examples/plans` di

Example:

`lw plan --file plan.yaml`
`lw-cli plan --file plan.yaml`

```
---
Expand Down Expand Up @@ -110,7 +110,7 @@ If you wanted to pass user defined variables on the command line you would use t
(multiple `--var` flags can be passed). For example, if you wanted to generate the hostname of
`web3.somehost.org` you would use the following command and yaml:

`lw plan --file play.yaml --var node=3 --var role=web`
`lw-cli plan --file play.yaml --var node=3 --var role=web`

```
hostname: "{{- .Var.role -}}{{- .Var.node -}}.somehost.org"
Expand Down
18 changes: 9 additions & 9 deletions cmd/assetList.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra"

"github.com/liquidweb/liquidweb-cli/instance"
"github.com/liquidweb/liquidweb-cli/types/api"
apiTypes "github.com/liquidweb/liquidweb-cli/types/api"
)

var assetListCmdCategoriesFlag []string
Expand All @@ -36,10 +36,10 @@ An asset is an individual component on an account. Assets have categories.
Examples:
* List all assets in the Provisioned and DNS categories:
- lw asset list --categories Provisioned,DNS
- lw-cli asset list --categories Provisioned,DNS
* List all dedicated servers:
- lw asset list --categories StrictDedicated
- lw-cli asset list --categories StrictDedicated
`,
Run: func(cmd *cobra.Command, args []string) {
jsonFlag, _ := cmd.Flags().GetBool("json")
Expand All @@ -57,15 +57,15 @@ Examples:
ResultsPerPage: 100,
MethodArgs: apiArgs,
}
results, err := lwCliInst.AllPaginatedResults(&methodArgs)
results, err := lw - cliCliInst.AllPaginatedResults(&methodArgs)
if err != nil {
lwCliInst.Die(err)
lw - cliCliInst.Die(err)
}

if jsonFlag {
pretty, err := lwCliInst.JsonEncodeAndPrettyPrint(results)
pretty, err := lw - cliCliInst.JsonEncodeAndPrettyPrint(results)
if err != nil {
lwCliInst.Die(err)
lw - cliCliInst.Die(err)
}
fmt.Print(pretty)
} else {
Expand All @@ -74,7 +74,7 @@ Examples:

var details apiTypes.Subaccnt
if err := instance.CastFieldTypes(item, &details); err != nil {
lwCliInst.Die(err)
lw - cliCliInst.Die(err)
}

fmt.Printf("%d.) ", cnt)
Expand Down

0 comments on commit ea0acb4

Please sign in to comment.