func (b *Base) InitAPI() (err error) {
	var (
		c            *auth.Credentials
		privateToken string
	)
	if privateToken = os.Getenv("C14_PRIVATE_TOKEN"); privateToken != "" {
		c = &auth.Credentials{
			AccessToken: privateToken,
		}
	} else {
		if c, err = auth.GetCredentials(); err != nil {
			return
		}
	}
	b.OnlineAPI = api.NewC14API(oauth2.NewClient(oauth2.NoContext, c), version.UserAgent, Root.Verbose)
	return
}
InitAPI initiates the Online API with the credentials
package commands
import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
	"text/template"
	"golang.org/x/oauth2"
	"github.com/cocooma/mflag"
	"github.com/scaleway/c14-cli/pkg/api"
	"github.com/scaleway/c14-cli/pkg/api/auth"
	"github.com/scaleway/c14-cli/pkg/version"
)
type Config struct {
	UsageLine   string
	Description string
	Help        string
	Examples    string
}
type Streams struct {
	Stdout io.Writer
	Stderr io.Writer
	Stdin  io.Reader
}
type Command interface {
	GetName() string
	Parse(args []string) ([]string, error)
	Run(args []string) error
	CheckFlags(args []string) error
	PrintUsage()
}
type Base struct {
	Config
	Flags mflag.FlagSet
	*api.OnlineAPI
	flHelp *bool
}
func (b *Base) Init(c Config) {
	b.Config = c
	b.Flags.SetOutput(ioutil.Discard)
	b.flHelp = b.Flags.Bool([]string{"h", "-help"}, false, "Print usage")
}