Project Linking
Most workflow commands (status, logs, run, down, ssh, shell, dbshell) need to know which service you’re working on. Instead of passing workspace/project/env/service to every command, link your directory once and forget about it.
Quick link
Section titled “Quick link”If you already know your workspace, project, environment, and service slugs:
ancla link my-ws/my-project/production/my-serviceThis writes a .ancla/config.yaml in your current directory. Every ancla command run from this directory (or any subdirectory) will pick it up.
You can also link at a higher level:
ancla link my-ws # workspace onlyancla link my-ws/my-project # workspace + projectancla link my-ws/my-project/production # workspace + project + envInteractive setup with init
Section titled “Interactive setup with init”If you’d rather pick from a menu:
ancla initThis fetches your workspaces, projects, environments, and services from the API and walks you through selecting each one. The result is the same .ancla/config.yaml file.
If the directory is already linked, init asks before overwriting.
What gets stored
Section titled “What gets stored”The link creates .ancla/config.yaml in your working directory:
workspace: my-wsproject: my-projectenv: productionservice: my-serviceThis is separate from your global config at ~/.ancla/config.yaml (which holds your API key and server URL). The local file only stores the link context.
Checking the current link
Section titled “Checking the current link”ancla statusShows the linked workspace, project, environment, and service along with the current pipeline status (build/deploy).
Workspace: my-wsProject: my-projectEnv: productionService: my-service
STAGE STATUSBuild completeDeploy runningUnlinking
Section titled “Unlinking”ancla unlinkRemoves the local .ancla/config.yaml. Commands that depend on a link will prompt you to re-link.
How link resolution works
Section titled “How link resolution works”When you run a command that needs a service context, the CLI looks for .ancla/config.yaml starting from your current directory and walking up toward the filesystem root. The first one it finds wins.
This means you can have a monorepo with per-service links:
my-monorepo/ .ancla/config.yaml # workspace + project level services/ api/ .ancla/config.yaml # linked to the api service in production frontend/ .ancla/config.yaml # linked to the frontend service in productionLink vs. explicit arguments
Section titled “Link vs. explicit arguments”Every command that uses the link context also accepts an explicit argument. The argument always wins:
ancla ssh # uses linked serviceancla ssh other-ws/other-proj/staging/other-svc # ignores link, uses argument