Targeting
Every Max command operates on a target - a workspace, installation, or the global level. By default, Max figures out the target from your current directory. The -t flag lets you override that and address any node explicitly.
What is a node?
Max organises data in a three-level hierarchy:
Global (@)└── Workspace (e.g. "my-project") └── Installation (e.g. "linear-1", "github-prod")Each level in this hierarchy is a node. Every node has an address called a Max URL:
max://@/my-project/linear-1 │ │ │ │ │ └── installation │ └── workspace └── host (@ = this machine)Default resolution
Without -t, Max resolves your target from the current working directory - similar to how npm finds the nearest package.json:
~/projects/└── my-project/ ← workspace level ├── max.json ├── src/ ← still workspace level └── .max/ └── installations/ └── linear-1/ ← installation level ├── credentials.json └── data.dbThe resolution rules:
- Inside
.max/installations/<name>/- you’re at the installation level - Inside a directory with a
.max/folder - you’re at the workspace level - Anywhere else - you’re at the global level
# Inside ~/projects/my-project/ (workspace level)max ls # lists installations in this workspacemax search linear-1 ... # searches within this workspace
# Inside ~/projects/my-project/.max/installations/linear-1/ (installation level)max search LinearIssue # no need to name the installation
# Outside any workspace (global level)max -g ls # lists workspacesThe -t flag
Use -t to target a specific node regardless of where you are:
# Target a workspacemax -t my-project lsmax -t my-project status
# Target an installation (workspace/installation)max -t my-project/linear-1 search LinearIssuemax -t my-project/linear-1 sync
# Target with a full Max URLmax -t max://@/my-project/linear-1 search LinearIssueRelative resolution
Target values are resolved relative to your current context:
# If you're already inside the my-project workspace:max -t linear-1 search LinearIssue# Resolves to: max://@/my-project/linear-1When you’re in a workspace, a bare name is treated as an installation within that workspace. When you’re not in a workspace, a bare name is treated as a workspace.
The -g flag
-g is shorthand for targeting the global level (-t max://@):
max -g ls # List all workspacesmax -g status # Global health overviewThis is useful when you’re inside a workspace but want to see the global view.
Common patterns
# Check where you aremax status # Shows your resolved context
# List everything at your current levelmax ls # Installations (in workspace) or workspaces (global)
# Operate on a specific installation from anywheremax -t my-project/linear-1 search LinearIssue --allmax -t my-project/linear-1 sync
# Compare installationsmax -t my-project/linear-1 search LinearUser --limit 5max -t my-project/linear-2 search LinearUser --limit 5
# Global operationsmax -g ls # All workspaces on this machinemax -g status # Global healthWhat’s next
- CLI Overview - the full command set at each level
- Daemon Mode - how targeting interacts with execution