Sari la conținutul principal
FreeThree checks for your projectUptime, accessibility, SEO and cookie checks for your project
Menu

Sign in and choose a project

Sign in to the CLI through your browser and learn how it decides which project and which environment a command acts on.

On this page

Before the CLI can work with your hosted website, it needs two things: who you are and which project you mean. You sign in once per computer, through your browser. The project is found from the Git checkout you are standing in, or from a name you give. The CLI never guesses a project.

Sign in

  1. Start the sign-in. The first time, name the portal:

    tilizy auth:login --portal-url https://app.tilizy.com

    The command prints a short code and an address, and opens the address in your browser. Later sign-ins on the same computer remember the portal, so tilizy auth:login is enough.

  2. In the browser, sign in to the portal if you are not signed in yet. Check that the code on the page matches the code in your terminal, then authorise.

  3. Return to the terminal. The CLI has picked up the sign-in and saved it on your computer. Your password never passes through the terminal.

  4. Check who you are signed in as. The output shows your user and the portal:

    tilizy auth:info

On a computer without a browser, add --no-browser. The command then only prints the address and the code, and you open the address on another device.

Sign out

tilizy auth:logout --revoke

Without --revoke, the command only forgets the sign-in on this computer, and the access stays valid until you revoke it in the portal in your profile, on the Devices page. With --revoke, the access of this computer ends at the portal as well. Your other computers keep theirs.

Sign in from a script

For continuous integration, create a token in the portal in your profile, on the Devices page. Pass it on standard input:

echo "$TOKEN" | tilizy auth:token --stdin --portal-url https://app.tilizy.com

Keep the token in the secret store of your pipeline. Add --no-input to every command a script runs, so that nothing waits for an answer.

How the CLI finds your project

A command that needs a project takes it from exactly two places:

  1. A name you give. Pass the short name of the project with -p <project>. Many commands also accept it as an argument.
  2. The checkout you are in. The CLI reads the address of the Git remote origin and matches it to the repository connected to a project.

There is no third way. The CLI does not remember the last project you used and does not pick one from a list. Outside a checkout, or in a repository that belongs to no project, a command without -p stops with an error. It never acts on a project you did not name.

Find and fetch a project

List every project you can open. Projects that are checked out on this computer are marked, with their folder:

tilizy project:list

Fetch a project you do not have yet. The command clones the repository into your projects folder and starts the website locally. With --data it also copies the live database, with personal data replaced, and the files:

tilizy project:setup <project> --data

If a checkout is not recognised, bind it once. The command reads the address of origin and stores it on the project:

tilizy project:link <project>

Choose the environment

FlagEnvironment
-e localThe copy on your computer
-e <branch>The hosted environment of that branch
--stagingThe staging environment
--prodThe live environment

What happens without a flag depends on the command:

Kind of commandWithout a flagExamples
Works locally and on hosted environmentsActs on the copy on your computerapp:start, app:stop, app:status, app:logs, app:shell, app:open, db:shell, db:dump, db:load
Works only on hosted environmentsActs on liveapp:deploy, app:rollback, db:pull, backup:create, the files commands

Each command states its scope in its --help, under the heading "Scope". Read it before you run a command against a hosted environment for the first time.

Warning: tilizy files:rm deletes on live when you give no flag. Always pass -e <branch> or --staging when you mean another environment. tilizy app:destroy is the exception: it refuses live and always needs -e <branch>.

What can go wrong

  • A command stops because it has no project. Change into the checkout, or add -p <project>. Do not script around the refusal: it is there so that a command never lands on the wrong website.
  • The checkout is not recognised. The address of origin does not match the repository connected to the project, for example after you moved the repository. Run tilizy project:link <project>.
  • A command is refused although you are signed in. What you may do is decided by your permissions on the project, not by the CLI. Having a command does not mean you are allowed to use it on every project.
  • -p does not help with app:launch or app:create. These read the project file from the checkout, so they must run inside the checkout of that project.

Next: Run your website locally and the command reference.