# nexarch

Your architecture workspace for AI delivery.

## Quick start

```sh
npx nexarch login
npx nexarch setup
```

For browserless agent enrollment, use `npx nexarch enroll --code <code> --client <client>`.
Known clients receive their MCP connection configuration and Nexarch skills as part
of the same enrollment.

> `setup`, `mcp-config`, and `init-agent` are registry-driven and fail closed.
> If the published integration registry is unavailable/invalid, these commands stop until service is restored.

## Commands

| Command | Description |
|---|---|
| `nexarch login [--company <id>]` | Authenticate via browser and store company-scoped credentials; prompts for company when multiple memberships exist |
| `nexarch logout` | Remove local credentials |
| `nexarch status` | Check connection, registry health/version, and architecture summary for the company selected at login |
| `nexarch setup` | Auto-configure detected MCP clients, write instructions, and refresh all managed skills |
| `nexarch skills update` | Refresh all Nexarch-managed skills for installed agent runtimes |
| `nexarch enroll --code <code> --client <client>` | Redeem a one-time enrollment, configure the known client, and install its Nexarch skills |
| `nexarch mcp-config [client]` | Print config block for manual setup (supported client codes are registry-managed) |
| `nexarch mcp-proxy` | stdio→HTTP bridge used internally by MCP clients |
| `nexarch init-agent [--json] [--strict] [--agent-id <id>] [--redact-hostname]` | Run onboarding handshake and mandatory `agent` entity registration in graph |
| `nexarch init-agent --bind-to-external-key <key> [--bind-relationship-type <code>]` | Optionally bind the agent node to an existing graph external key |
| `nexarch init-agent` (default behavior) | Also upserts technology component entities (host, OS, Node.js runtime) and links them to the agent |
| `nexarch agent identify ...` | Submit provider/model/client identity metadata to complete agent profile enrichment |

## Bootstrap flow after `init-agent`

`nexarch init-agent` writes a bootstrap file at:

```sh
~/.nexarch/agent-bootstrap.md
```

That file contains a pre-filled `npx nexarch agent identify ...` command template.
The current workflow is:

1. run `npx nexarch init-agent`
2. open `~/.nexarch/agent-bootstrap.md`
3. copy the generated `npx nexarch agent identify ...` template
4. fill in the real provider/model/client details
5. run the completed command

Do not assume an `npx nexarch agent prompt` command exists unless/until it is explicitly implemented and documented.

## Company context behavior

- Company is selected during `nexarch login`.
- If your user has one active company, login auto-selects it.
- If your user has multiple active companies, login requires explicit selection.
- To switch company later, run `nexarch login` again and pick another company.

## Requirements

- Node.js 18 or later
- A Nexarch workspace account

## Documentation

[nexarch.ai/docs/cli-reference](https://nexarch.ai/docs/cli-reference)
