Skip to content

Latest commit

 

History

History
90 lines (55 loc) · 2.07 KB

File metadata and controls

90 lines (55 loc) · 2.07 KB

dstack project

Before the CLI can be used, it must be configured with a project, including a project name, server address, and user token. You can configure multiple projects using the dstack project CLI command. The configuration is stored in ~/.dstack/config.yml.

The dstack server command automatically creates the default main project and adds its configuration in ~/.dstack/config.yml.

The dstack project set-default command can be used to switch between multiple projects.

??? info "Environment variable" Alternatively to dstack project set-default, you can set the DSTACK_PROJECT environment variable. It overrides the default project set in ~/.dstack/config.yml.

<div class="termy">

```shell
$ DSTACK_PROJECT=main
$ dstack apply -f examples/.dstack.yml
```

</div>

Also, you can install [`direnv`](https://direnv.net/)  
to automatically apply environment variables from the `.envrc` file in your project directory.

<div editor-title=".envrc"> 

```shell
export DSTACK_PROJECT=main
```

</div>

Now, `dstack` will always use this project within this directory.

Remember to add `.envrc` to `.gitignore` to avoid committing it to the repo. 

dstack project add

This command adds a new project configuration.

$ dstack project add --help
#GENERATE#

You can find the command on the project’s settings page:

dstack project list

This command lists the projects configured on the client.

$ dstack project list --help
#GENERATE#

dstack project set-default

This command sets the given project as default.

$ dstack project set-default --help
#GENERATE#

dstack project delete

This command deletes the given project configuration.

$ dstack project delete --help
#GENERATE#