Project Linking
Project linking allows you to associate a local directory with a DPage organization and project. This saves time by avoiding the need to specify IDs for every command.
How it Works
When you link a project, the CLI creates a .dpage/ directory in your current folder with a project.json file. This file contains the organization and project IDs for that directory.
Link a Project
Run the link command in your project's root directory:
Terminal
dpage linkThe CLI will guide you through an interactive selection process:
1
Select Organization
Choose from a list of organizations you belong to.
2
Select Project
Choose the specific project you want to link to this directory.
3
Confirmation
The CLI will create the local configuration and update your .gitignore.
The
.dpage/ directory is automatically added to your.gitignore. You should not commit this directory to version control, as linking is developer-specific.Auto-Confirmation
For non-interactive use, you can skip prompts using the --yes flag:
Terminal
dpage link --yesUnlinking
To remove the association between a directory and a DPage project, run:
Terminal
dpage unlinkThis will safely delete the .dpage/ directory and its contents.
Resolution Order
Commands that require a project context (like indexing) resolve it in this order:
- Flags:
--organization-idand--project-idpassed directly to the command. - Linked Project: IDs found in
.dpage/project.json. - Error: If neither is found, the command will fail with a helpful error message.
If you're working on multiple projects, linking is the most efficient way to switch between them. Just
cd into the directory and run your commands.