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.
Synopsis
To get a list of all commands, call cs help:
cs helpBasic usage
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 userTo 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
This command has been moved to cs generate:models
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.
Pull
Downloads a service to the current directory.
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.
This is a destructive operation that might result in the loss of data! Please make sure that you definitely want to remove 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.
Entity and database generation functionalities are still in alpha version. We are iterating fast to bring the best features as soon as possible. We would be happy to hear from you about what do you think about it in our community chat here: https://spectrum.chat/code-store
Resolver
Generate a template of a GraphQL resolver:
REST
Generates a template of a REST API endpoint handler:
Last updated
Was this helpful?