Skip to main content
Version: LOC v0.9 (legacy)

General, Profile and Login

CLI commands for

Also see: Introduction and Setup

General

Show Help

loc help [command]
loc [command] -h
loc [command] --help

List available commands or show help on a specific command.

Example:

loc help dp
loc dp create -h
loc dp list --help

Show CLI Version

loc version
loc -V

Generate Shell Completion Scripts

loc completion <SHELL>

Generate completion scripts for specific shells. This will provide completion suggestions while pressing tab.

<SHELL> can be specified to be one of the following options:

ShellPlatform
bashLinux/macOS
elvishLinux/macOS
fishLinux/macOS
powershellWindows
zshLinux/macOS
How to setup CLI completion script

Create a loc.bash with CLI:

mkdir -p /usr/local/bin/bash
loc completion bash > /usr/local/bin/bash/loc.bash

Then edit ~/.bashrc:

echo "source /usr/local/bin/bash/loc.bash" >> ~/.bashrc

Login Profile

loc profile

A login Profile is the local profile (name, description and URL) for connecting your LOC server. The Profiles will be stored globally so any CLI binaries on the same computer would access the same Profiles.

List All Profiles

loc profile list|ls

Create a Profile

loc profile create|new [OPTIONS]

Create a login Profile.

The options, if not provided as parameters, would be prompted by CLI:

OptionDescription
--name <NAME>*Login Profile name
--description <DESCRIPTION>*Login Profile description (can be blank)
--server-url <SERVER URL>*LOC server base URL

*= will be prompted if not provided

Select a Profile

loc profile use <PROFILE NAME>

You must select a login Profile to use in order to login and manage assets in your LOC instance.

Show Current Profile

loc profile current [-v|--verbose]
OptionDescription
-v | --verboseShow more details of current logic profile

Inspect a Profile

loc profile get <PROFILE NAME>
tip

Inspecting the current profile you're using is the same as loc profile current -v.

Delete a Profile

loc profile delete <PROFILE NAME>

Login

loc login [OPTIONS]

Login LOC (requires a profile set and selected). This will generate a token which is required for managing assets in your LOC instance.

OptionDescription
--username <USERNAME>*LOC username
--password <PASSWORD>*LOC password (not recommended)
--password-stdinTake password from stdin (standard input stream)

*= will be prompted if not provided

note

You will be logout of CLI after some time of inactivity (token expired).

The CLI token does not effect the Studio token. You can login both at the same time.

If you are using Bash or similar shells, you can save your password in a file (for example, secret):

loc login --username <username> --password-stdin < ./secret

Then press Enter.

Logout

loc logout