Link a project to Globe

The link command links a local Dart project to Globe. Linking is required to deploy a project.

Project linking is carried out automatically if the project is not yet linked when running the deploy command.

Usage

globe link
 Please select a project you want to link:
  Create a new project
  blog-frontend
  blog-backend-369d

Upon completion, the local project will be linked to your Globe account and you will be able to deploy.

How it works

Globe stores metadata about projects in the .dart_tool/dart_globe directory on your machine. This metadata is used to identify projects when deploying to Globe. If not already, the .dart_tool directory should not be committed to your Git repository. You can add this directory to your .gitignore file to ensure it is not committed.

If you accidentally delete this directory or run the unlink command, you will need to re-link the project before you can deploy again.

Linking Multiple Projects (e.g: Mono-Repos)

For directories containing multiple projects, the link command supports linking and managing multiple Globe projects.

Run the following command in your workspace directory:

globe link

The CLI displays a list of projects in the directory:

❓ Please select a project you want to link:
  ◯ Create a new project
  ◯ blog-frontend
❯ ◉ blog-backend-369d

Select an existing project to link or create a new one.

Viewing Linked Projects

To view all projects linked in the workspace, run:

globe link --show-all

This displays a table of all linked projects:

┌──────────────────────────────┬──────────────────────────────┬──────────────────────────────┐
 Project Project ID Organization ID
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
 blog-backend-369d bd239097-1b68-43e6-a887-466… eecbc0fb-ee17-4d87-9b74-0ce…
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
 blog-frontend 2e8e0149-db61-4883-b734-4d6… eecbc0fb-ee17-4d87-9b74-0ce…
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

Project-Specific Commands

In multi-project setups, you can run commands specific to a project by passing either project name or ID as argument.

Alternatively, if no argument is specified, the CLI will prompt you to select a project interactively.

Examples

  • Deploy a specific project:
globe deploy --project="blog-frontend"
globe deploy --project="2e8e0149-db61-4883-b734-4d6832824ca5""
  • Check tokens for a specific project

Alternatively, if no project is specified, the CLI will prompt you to select a project interactively.

glober token list --project="blog-backend-369d"
  • Deploy project interactively
 ~/Projects/OpenSource/website  globe deploy          ok
🔺 Select project:
❯ ◉  blog-backend-369d
  ◯  blog-frontend
  ◯  link new project +