# Quickstart

Write a tool, run it on your machine, deploy it and call the deployed copy.

You need macOS or Linux, [Bun](https://bun.sh) 1.4 or newer, and a Zenitya
account. Zenitya is in private beta: if you have no invitation yet, request one
at [zenitya.com/early-access](https://zenitya.com/early-access).

Rather have your coding agent do it? Paste the
[setup prompt](https://zenitya.com/setup-prompt.md) into Claude Code, Codex,
Cursor or Pi, and it follows these steps with you.

<!-- ::agent-prompt -->

## 1. Install the CLI

```sh
curl -fsSL https://zenitya.dev/install.sh | sh
```

The installer verifies the release signature and puts `zenitya` and its short
name `zya` in `~/.zenitya/bin`, adding it to your PATH. Open a new terminal,
then check it:

```sh
zya --version
```

## 2. Sign in

```sh
zya login
```

This opens Google sign-in in your browser and asks which organization to use.
Add `--no-browser` to print the link instead. `zya whoami` shows who commands
run as.

## 3. Create a project

```sh
zya new my-tools
cd my-tools
bun install
```

`zya new` writes `zenitya.json`, `src/index.ts` with an example `echo` tool,
`package.json`, `tsconfig.json` and an `AGENTS.md` that points coding agents at
these docs. `src/index.ts` looks like this:

```ts
import { Project } from "@zenitya/sdk";
import { s } from "@zenitya/sdk/schema";

const project = new Project();
export default project;

project.tool("echo", {
  title: "Echo",
  description: "Return a message unchanged.",
  schema: s.object({
    message: s.string().describe("Message to return."),
  }),
  outputSchema: s.object({
    message: s.string(),
  }),
  hints: { readOnlyHint: true, idempotentHint: true },
  execute: async ({ message }) => ({ message }),
});
```

## 4. Run it locally

```sh
zya exec echo --local --data '{"message":"hello"}'
```

The output prints on stdout as JSON. Local runs load `.env` from the project
directory, so you can try a tool against real credentials before deploying.

## 5. Deploy

```sh
zya deploy
```

Deploying needs an owner or admin role. The CLI uploads your source, Zenitya
installs dependencies, bundles and checks your tools remotely, and the new
version goes live only if every step passes.

## 6. Grant the tool and call it

A deployed tool is callable only by groups it is granted to. In the
[Zenitya app](https://app.zenitya.com), open **Groups**, pick a group you are in
(everyone is in **Default**) and grant `my-tools.echo`. Then:

```sh
zya tools list
zya exec echo --data '{"message":"hello"}'
```

Without `--local`, `exec` runs the deployed copy.

## Next

- [Connecting agents over MCP](mcp.md): call the tool from Claude, Codex or Cursor.
- [Writing tools](tools.md): schemas, hints, logging and errors.
- [Secrets and network access](secrets.md): call real APIs from a deployed tool.
