Commands

Did you ever play Command & Conquer? No? Continue, comrade... and you will find yourself on the floor, with Kukov! ☭

To download and install CLI, follow the instructions here.

You can invoke code.store CLI either by using the full codestore command, or by using the short version cs.

Synopsis

To get a list of all commands, call cs help:

cs help

Basic usage

Most of the commands accept some specific arguments which can be provided while invoking the command in a long or short format:

  • Long format: cs command --argumentName argumentValue

  • Short format: cs command -a argumentValue

Use cs help command to know more about the specific command and its arguments.

Authentication

$ cs help auth
Authentication commands, login, logout, whoami

USAGE
  $ codestore auth:COMMAND

COMMANDS
  auth:login   Authenticate at code.store platform
  auth:logout  Clears user credentials and invalidates local session
  auth:whoami  Display the currently logged in user

To be able to use the CLI you have to login into your code.store account. To do that use the following command:

cs login will try to authenticate through the browser (it is going to open the default browser in your system).

At any time you can check under which user you are being authenticated:

In order to finish your session and logout use the following command:

You can also use short aliases of the above commands: cs login, cs whoami and cs logout.

Services

List

The cs service:list command that can be shortened to cs service:ls, and is used to provide a list of your services along with their status.

Create

Create a new service by calling cs service:create which will display a wizard and ask for some necessary information in order to create a service.

Info

Displays more detailed information about the service:

Delete

Deletes the service. Deletes it for real, so please make sure that you are sure about what you are doing.

Dev

Launches a service locally. Requires PostgreSQL and configuration in codestore.yaml.

Generate

List

List the services in your organization. You can also use a short version of this command: cs service:ls.

Note: don't be surprised to see some services when you just created an account as those may be the services created by the colleagues in your organization.

Logs

Print out the logs of your service. Available options are:

Promote

Pushes your service from Private to Demo environment.

When launched without the optional Service ID argument, the command will look for codestore.yaml file and will promote the current service.

Pull

Downloads a service to the current directory.

hen launched without the optional Service ID argument, the command will look for codestore.yaml file and will promote the current service.

Push

Push local changes to Private environment.

Projects

In order for your Services to be published, they have to be added to Projects. Projects can be created and managed either by using the web-site or via CLI.

Create

Launches a project creation dialogue:

Delete

Deletes the project but only if there are no existing services inside it. Make sure that you remove all services from the project before removing the project itself.

List

Get a list of all your projects (you can also use a shorthand alias cs project:ls:

Services inside the Project

In order to manage services inside your project, you can use cs project:service sub-commands. Most of the commands are quite similar to those of cs service.

Add

Adds an existing service to a project. Requires a Project ID as an argument.

List

Lists services in your project:

Info

Displays detailed information about project's service, in a similar way to cs service:info.

Promote

Promotes your service inside the project between Development, Staging and Production environments.

Remove

Removes the service from the project.

Generate

This group of commands generate scaffolding (templates) of some important files.

Handler

Generates auth and context handlers.

Read more about the usage of those handlers in our dedicated tutorial here.

Models

Generates the entity models and database migrations for your GraphQL types and puts them into src/entities.

Resolver

Generate a template of a GraphQL resolver:

REST

Generates a template of a REST API endpoint handler:

Last updated

Was this helpful?