You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/cli/dstack/project.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,33 @@ Before the CLI can be used, it must be configured with a [project](../../../conc
6
6
7
7
The `dstack project set-default` command can be used to switch between multiple projects.
8
8
9
+
??? info "Environment variable"
10
+
Alternatively to `dstack project set-default`, you can set the `DSTACK_PROJECT` environment variable. It overrides the default project set in `~/.dstack/config.yml`.
11
+
12
+
<div class="termy">
13
+
14
+
```shell
15
+
$ DSTACK_PROJECT=main
16
+
$ dstack apply -f examples/.dstack.yml
17
+
```
18
+
19
+
</div>
20
+
21
+
Also, you can install [`direnv` :material-arrow-top-right-thin:{ .external }](https://direnv.net/){:target="_blank"}
22
+
to automatically apply environment variables from the `.envrc` file in your project directory.
23
+
24
+
<div editor-title=".envrc">
25
+
26
+
```shell
27
+
export DSTACK_PROJECT=main
28
+
```
29
+
30
+
</div>
31
+
32
+
Now, `dstack` will always use this project within this directory.
33
+
34
+
Remember to add `.envrc` to `.gitignore` to avoid committing it to the repo.
0 commit comments