magnet link command (alias: magnet init) connects the current directory to one of your Magnet workspaces. Subsequent CLI commands run from this directory (or any subdirectory) operate in the context of the linked workspace.
Usage
.magnet/project.json.
Options
| Option | Description |
|---|---|
--workspace <idOrSlug> | Workspace id or slug. Skips the interactive picker. |
--org <idOrSlug> | Alias for --workspace. |
--yes | Skip confirmation prompts (for CI and scripts). |
Examples
Link non-interactively (for CI):The .magnet folder
Why do I have a folder named “.magnet” in my project?
The .magnet folder is created when you link a directory to a Magnet workspace.
What does the “project.json” file contain? The ID of the linked Magnet workspace (orgId), plus its slug and name (orgSlug,orgName).
Should I commit the “.magnet” folder? No, you should not share theLike.magnetfolder with anyone. Upon creation, it is automatically added to your.gitignorefile.
.git, the link is discovered by walking up from the current directory, so commands work from anywhere inside the linked project.