# Command Line Interface > Directus has two command line interfaces (CLI) that you can use for various actions. One is used for server-side > actions that relate to your on-prem instance, like migrating the database or resetting a user, while the other allows > you to interact with a Directus instance as you would with an SDK. [[toc]] ## Server For server-side CLI, all functionality can be accessed by running `npx directus ` in your project folder. ### Initialize a New Project ``` npx directus init ``` Will install the required database driver, and create a `.env` file based on the inputted values. ### Bootstrap a Project ``` npx directus bootstrap ``` Will use an existing `.env` file (or existing environment variables) to either install the database (if it's empty) or migrate it to the latest version (if it already exists and has missing migrations). This is very useful to use in environments where you're doing standalone automatic deployments, like a multi-container Kubernetes configuration, or a similar approach on [DigitalOcean App Platform](/guides/installation/digitalocean-app-platform/) or [AWS Elastic Beanstalk](/guides/installation/aws/) ::: tip First User You can use the `ADMIN_EMAIL` and `ADMIN_PASSWORD` environment variables to automatically provision the first user on first creation using the `bootstrap` command. See [Environment Variables](/reference/environment-variables/) for more information. ::: ### Install the Database ``` npx directus database install ``` Installs the Directus system tables on an empty database. Used internally by `bootstrap` ### Upgrade the Database ``` npx directus database migrate:latest npx directus database migrate:up npx directus database migrate:down ``` Migrate the database up/down to match the versions of Directus. Once you update Directus itself, make sure to run `npx directus database migrate:latest` (or `npx directus bootstrap`) to update your database. --- ## Client For the client-side CLI, all functionality can be accessed by running `npx directusctl `. You can also install `@directus/cli` on your project dependencies or globally on your machine. Note that if you run `directusctl` (installed globally) in a folder containing a project that has a version of `@directus/cli` installed, the running global CLI will forward it's execution to the local installed version instead. ### Help & Documentation The documentation for all commands can be accessed through the CLI itself. You can list all the available commands through `directusctl --help` command. If you want help for a specific command you can use `directusctl --help` instead. ### Instances Most client-side CLI commands needs a running Directus instance in order to work. To connect the CLI to an instance, you can use `directusctl instance connect` command. These instance's configs are going to be saved on `~/.directus` folder. To manage the connected instances, you can use `directusctl instance ` commands. #### Selecting instances By default, commands will try using an instance named `default` when executing commands. If you want to change which instance you want to use, either pass `--instance ` to the command, or configure `instance` variable on your project's Directus config file. For example: > .directus.yml ```yml instance: my-project ``` ### I/O The CLI is designed with ease of use and automation in mind, this means that you can change the way the output is made by setting how you want the data to be written to the terminal. We currently support three formats, `table` (the default one), `json` and `yaml`. This makes it easier to parse and use data from Directus with other tools like `jq`, `yq`, `grep` or any other tools that accepts data from `stdin` It's also worth mentioning that everything is data. Try for example running `directusctl --help --format=json`. #### Table The default output format. This is the "pretty" output, you'll most likely want to use this if you're not dealing with data in a way you need to pipe it to another command and/or store it it for parsing. This output will output colors and highlight content if it detects you're running in TTL. #### JSON This format will output JSON notation strings to your terminal. By default if TTY is detected, it will highlight (can be turned off with special flags) and prettify the output to make it easier to read. Useful when you need to parse data using tools like `jq` for example. #### YAML This format will output YAML strings to your terminal. By default if TTY is detected, it will highlight (can be turned off with special flags) and prettify the output to make it easier to read. Useful when you need to parse data using tools like `jq` for example.