zespan link records which Zespan project the current directory belongs to, so
zespan policy plan and apply do not need a project id on the command line.
zespan projects list prints the same data without prompting, which is what CI
needs.
Both commands need a user session — run
zespan auth login first.
An API key authenticates a project, not a person, so it cannot answer “which
projects can you reach?”.Quick start
.zespan/config.json
.zespan/config.json
ZESPAN_PROJECT_ID=2845c0ef-… tells a human nothing about which organization it
belongs to. The link config stores the readable names beside the id for
exactly that reason, and error messages print the names rather than the UUID.
Re-running zespan link to change project keeps the environment already recorded
in the file unless you pass a new --env.
zespan link
zespan link refuses
before it makes any network call and names --project as the alternative,
rather than blocking forever on input nobody will type:
--project id your sign-in cannot reach writes nothing, and says so by id
rather than leaving a config file naming a project that does not exist.
zespan projects list
--json prints the same data as { user, projects }, with id, name,
orgSlug, orgName and role per project. It goes straight to stdout with no
indentation or colour, so it pipes cleanly into jq.
Only projects you can actually reach are listed — every organization you are a
member of, and every project in it that has not been deleted. It is the same list
the dashboard shows you.
Where the project id comes from
Forzespan policy and any other command that needs a project, the resolution
order is:
--project flag → ZESPAN_PROJECT_ID → .zespan/config.json → .zespan.yaml
zespan link outranks .zespan.yaml because it is the newer, explicit act
(“link this directory to that project”). Nothing changes for existing
projects, which have no .zespan/config.json until someone runs zespan link.
The environment resolves the same way: --env → ZESPAN_ENVIRONMENT →
.zespan/config.json → .zespan.yaml.
The API key and the API base URL are never read from either file — see
CLI overview.
Next steps
zespan auth
Sign in first — both commands need a user session.
zespan policy
Plan and apply guardrail policies against the project you just linked.
CLI overview
Configuration precedence and the two credentials.
Environments
What
--env targets, and how environment slugs resolve.
