# CLI

Authenticate once and let your existing coding agent configure the project.


## Run the workspace CLI

The CLI package is named `@everock/cli`; its executable is `everock`. Commands here use the source checkout so they do not depend on unpublished npm packages.

```bash title="Terminal"
pnpm --filter @everock/cli start login --api-url http://localhost:4001
pnpm --filter @everock/cli start whoami
pnpm --filter @everock/cli start projects
```

Login prints a browser verification URL and code. Approval expires after ten minutes. `--no-browser` prints the flow without opening a tab automatically.

## Initialize or link

```bash title="Terminal"
pnpm --filter @everock/cli start init --name "Checkout"
pnpm --filter @everock/cli start link --project-id PROJECT_ID --component api
```

`init` creates or reuses a project, registers the requested component, attempts repository integration, and returns SDK configuration. It does **not** install or edit your application SDK automatically; the coding agent performs those changes locally.

`link --local-only` records local repository identity without granting GitHub source access. Normal linking can require initial GitHub authorization.

## Session and local files

The CLI session lives in `~/.everock/config.json`; project linkage lives in `.everock.json` in the checkout. `EVEROCK_CONFIG_DIR` can isolate the global session directory. Keep credentials out of Git and logs.

```bash
pnpm --filter @everock/cli start logout
```

Logout revokes the session server-side and removes the local credential. The CLI still communicates with Everock's API; it replaces manual credential copying, not the API itself.

## Other commands

`logs --errors` reads request failures. `scan --file PATH` validates and publishes a local architecture summary. The hosting commands `push`, `dev`, `deploy`, and `rollback` belong to the optional hosting infrastructure; they are not required to observe an app hosted elsewhere.
